Categories
Tech

tail and format Apache log files (Perl one-liner)

Here is a quick Perl one-liner that lets you tail an Apache log file and view nicely-formatted output: tail -f YOURDOMAIN_LOG_FILE | perl -ne ‘$|=1;my ($host,$date,$url,$status,$size,$referrer,$agent) = $_ =~ m/^(\S+) – – \[(\S+ [\-|\+]\d{4})\] “(\S+ \S+ [^”]+)” (\d{3}) (\d+|-) “(.*?)” “([^”]+)”$/;print $host . ” – ” . $date . ” – ” . $url .”\n”;’ […]

Categories
Tech

RowPro Version 3 Live Water No Trees Mod

This is a mod for RowPro Version 3 to allow live water mode with no trees (not available from the program options). From my testing so far this mod provides an increase in frames-per-secondĀ  (fps) performance, most notably if your video card is able to handle standard 3D mode but not Live Water mode. Do […]

Categories
Tech

Add a guest subnet on your LAN

I have a private LAN here on a NetGear FVS338 VPN Firewall Router, with a couple of servers for internal use. Our wireless network is password-protected, and I hate giving out the password to people that want to use our wireless while they are visiting. Or I have to ask them to look away while […]

Categories
Tech

ZoneMinder Viewer Windows 7/Vista Gadget

EDIT: I’m tabling this for now. It works, but because Windows will only view sidebar gadgets using the IE rendering engine (instead of, say, Firefox), you can’t use mode=stream, you have to use mode=jpeg. This is OK but it leads to a *tremendous* number of mysql connections on the ZM server and I’m seeing higher […]

Categories
Tech

Run child perl script in the background

I had a situation where a parent Perl script (web-accessible, in cgi-bin) needed to call a long-running child Perl script that was outside cgi-bin. I wanted the parent to call the child and then exit immediately, allowing the parent script browser window to stop loading and the child to continue running in the background and […]

Categories
Tech

Domain misspelling phishing sites

There’s no quicker way to give hackers your Facebook username and password than to mistype the Facebook URL in your browser window and type it into a phishing site. (Phishing sites are designed to look like the real site, but are run by Very Bad People With Nothing Better To Do so that they can […]

Categories
Tech

WordPress Comments Always Visible

If you need to make WordPress comments visible on the index page (not just within a post), add this line wherever you want comments to show: <?php $withcomments = true; comments_template();?> You might need to disable comments elsewhere in the template, or they might show up twice, but that depends on the theme. One commenter […]

Categories
Tech

Prevent Squirrelmail Brute Force Attacks

You installed Courier or Dovecot and you put SquirrelMail on your box for webmail. Then you were good enough to set up fail2ban or (my favorite) CSF/LFD. But you tested a brute force attack on Squirrelmail’s login page, and you noticed that LFD doesn’t detect brute force login attempts. Why not?

Categories
Tech

VPN with Windows Mobile

Your WinMo ICS connection doles out an IP address in 192.168.0.0 range by default. Problem: when you connect to your VPN with a LAN that is on the same subnet, nothing works. The solution is to change the registry entry: HKLM\Comm\BTPAN1\Parms\TCPIP IpAddress: 192.168.0.1 change to 192.168.1.1 Viola. Your PC gets an IP in a different […]

Categories
Tech

Remote View Headless Server (TTY)

If you need to view what’s happening on another TTY on your headless linux box, you can SSH in, su, and then do: tail -f /dev/vcs1 This will enable you to see what’s happening on the headless TTY on your local screen. There’s a utility called “screen” that is similar, but the above trick works […]