Author: Josh

  • CIFS over SSH – Extending the network

    I recently had an issue where a file copy from a celerra NAS to a server outside the network was failing and I couldn’t figure out why. The file copy was a pull from the outside server which needed access inside the network. The BGP route had somehow changed to go over Integra’s network rather…

  • Awstats with Apache and mod_rewrite

    I recently setup a new Awstats install and used mod_rewrite to make it easier to view web stats. Using the following configuration within a virtual host declaration, you can simply make requests in the following format: http://awstats/$CONFIG/$YEAR/$MONTH/$DAY/ This is assuming that you run daily rollups. ServerAlias awstats RewriteCond %{REQUEST_URI} !^/awstats/awstats.pl [NC] RewriteCond %{REQUEST_URI} !^/icon [NC]…

  • Bash tip: Print begin and end timestamp on apache logs…

    This morning I needed to audit some log files that I had recently processed through AWstats and received a report that there was a discrepancy in the data. The complaint was that one day was missing. I used the following bash script to print out the start and end timestamp of each log file: for…

  • System Administrator Technical Interviews

    I have had the opportunity to interview many candidates over the past few months and have a few tips: When indicating that you have VMware experience, clearly indicate which features you have experience with. I have interviewed many candidates who claim to be experts on VI3/vSphere and yet have never used clustering or shared storage.…

  • Apache 2.2 – Return 200 OK for missing images

    I recently faced a problem where I needed to configure Apache to return a 200 OK when it received a request for an image that was missing, along with a custom 404 ErrorDocument which was an image. The reason for this requirement is that when Outlook 2003/2007 displays an HTML page where an image request…

  • Reporting search referrals

    Here is a quick awk command that will parse apache web logs and print a simple virtual host/date/referral csv report that only includes referrals from google, bing, or yahoo: awk ‘tolower($11) ~ “google|bing|yahoo” {print $2 “,” $4 “,” $11}’ ${input_file} >> report.csv

  • Linux guest hangs at “starting udev” (VMware vSphere)

    Having recently upgraded the Virtual Infrastructure at work to vSphere, I have encountered many scenarios with CentOS 5.3 guests not booting or taking a long time to boot. The last message on the console typically indicates that it’s hanging while starting udev. The fix for this issue is to ensure proper time keeping practices have…

  • Expanding an ext3 filesystem online

    One common scenario that I face in my daily work is to add disk to various filesystems. Setting up systems correctly so that this is possible will save time and frustration. One of the easiest cases is adding disk to a virtual machine when the guest is using LVM and ext3. As always, please be…

  • Fedora 12 – Disable mouse focus

    One problem that I’ve had with Fedora 12 is that when enabling compliz the focus starts to follow the mouse pointer. This behavior is annoying to me as I don’t like events to occur unless I explicitly ask for them (aka click). To disable this feature, perform the following: 1. install control-center-extra 2. Open with…

  • Bash Tips – Parse mail logs for used mail boxes

    I was auditing a set of mail servers at work the other day getting a list of all active user accounts and developed this little one liner: zgrep LOGIN /var/log/mail.log.[1-9].gz | sed -n ‘s/.*user=\(.*\), ip.*/\L\1/p’ | sort | uniq >> /tmp/mailbox.list This script finds all logins from the mail log and prints out only the…