Optimize Images to Save Bandwidth and Speed Page Load

Comments: No Comments
Published on: Sunday, February 3rd, 2013

A few weeks ago I mentioned the wesley.pl script from GitHub to optimize images, and how I had modified it to keep (or discard) the EXIF / XMP information. Making sure images are as small as possible is important to save bandwidth and improve page load times (and google rank), so I think it’s worth discussing my image optimization process in more detail.

Continue reading…

Autossh Startup Script for Multiple Tunnels

Categories: Bash, CentOS, SSH
Comments: 8 Comments
Published on: Monday, December 10th, 2012

When an encrypted VPN is not available, the next best solution is usually port-forwarding one or more port(s) through an SSH tunnel. The down-side of SSH is that by itself it cannot maintain a persistent connection — network issues may force the tunnel to stop responding, or even drop completely. Autossh is a small front-end for SSH that can monitor the connection, and restart the tunnel if it drops or stops responding. I found that the startup scripts available for autossh on the internet were a little too basic for my needs — I wanted autossh to start multiple connections, and to start/stop each one individually if I needed — so I wrote my own.

Continue reading…

WordPress OS Disk Cache Report, Prime and Flush

Categories: Bash, UNIX (Generic), WordPress
Comments: No Comments
Published on: Thursday, December 6th, 2012

I wrote a bash script this morning to report the size of WordPress cache folders, the number of files they contain, read each file to prime the OS disk cache, and optionally flush the OS disk cache as well. This might be a script you could execute to email a daily/weekly report of cache folder sizes, or perhaps execute during/after booting a server to prime the OS disk cache, or even on a regular schedule to make sure the OS cache is always primed. The script also has a “flush” argument to sync and drop the OS disk cache, which isn’t very useful (to me) except to see the difference in speed between a clean and primed cache (about 11s vs 0.4s for all websites on my server).

Continue reading…

VPNs and Location Aware Settings on Mac OS X

Categories: AppleScript, Bash, Mac OS X, OpenVPN
Comments: No Comments
Published on: Monday, November 19th, 2012

Recently, a co-worker was asking about my configuration for connecting to the corporate VPN, and I thought the information might be useful for others as well — I use a combination of Tunnelblick; an OpenVPN client for Mac OS X, Sidekick; an application that changes Mac OS X settings based on your physical location (and/or network SSID, etc.), and a little shell script I wrote to start the VPN, define additional routes, and update my dynamic DNS hostname.

Continue reading…

Quick Freeze / Thaw of Reverse Zones

Categories: Bash, BIND, UNIX (Generic)
Comments: No Comments
Published on: Thursday, November 1st, 2012

I had to update several reverse zone files today, so wrote a quick for-loop in bash to freeze and thaw all the zones. The script parsed the zone file names and reversed them into a proper d.c.b.a.in-addr.arpa format. Later I tweaked it with sed to make it more flexible (in order to pass it a full or partial IP address), but ended up using tac for the reversing part instead – that’s what it’s made for after all. And if you’re wondering what tac stand for, just read cat backwards. :-)

Continue reading…

page 1 of 2»
Freelance UNIX SysAdmin
20121006-095055-jwolfe-49

Looking for a Sr UNIX Systems Administrator specializing in Systems Integration? I may be available for freelance or contract work, either remotely or on-site. You can contact me by email at jsm@surniaulula.com to discuss solutions specific to your needs.

  • Location : Montreal QC, Canada
  • Availability : 4-8 hrs / week freelance

Continue reading…

Social Pages and Feeds
FacebookGooglePlusLinkedInRSS