Wake-on-LAN Wrapper Script Revisited

Almost a year ago, I posted this article describing a simple, CLI-based way to trigger the Wake-on-LAN magic packet on your network to wake a sleeping machine. Trouble is, that script is showing its age, taking advantage of some deprecated utilities to perform its function. This updated script performs the same task using a more modern toolchain. #!/bin/sh # find the IP address in the output of `nslookup` ip=`nslookup imac | tail -2 | head -1 | awk '{print $2}'` # find the MAC address in the output of `ip neigh` mac=`ip neigh | grep -i -m1 $ip | awk '{print $5}'` # send the magic packet wol -h $ip $mac The ip utility replaces ifconfig, arp, and many other utilities in most current Linux distributions.
Read more →

MySQL: Copying Column Data Between Tables

Everyone who administrates databases, large or small, will eventually encounter the need to copy data from one table to another. This often occurs in application development when tweaking data model designs, copying data stored in an existing table into a newly-created table. In such cases it is often also necessary to update the existing table with the row ID of the associated data in the new table. Consider the following example:
Read more →

Simple Wake-on-LAN Wrapper Script

Our home network includes a number of Linux-based systems and one Apple iMac. Because the Mac hosts all of our family photos, and because printing from a Mac to a Linux printer is a headache, it made the most sense for us to connect the printer directly to the Mac. However, this creates an issue when printing from one of the other computers: if the Mac is asleep, the shared printer does not respond to requests.
Read more →

MP3 Encoding Support in Ubuntu 11.04

Today I went to copy my music library from Banshee to an old iPod mini. I found out the hard way that the Ubuntu 11.04 upgrade tool uninstalls the necessary programs for MP3 encoding support, causing Banshee to fill my iPod with WAV files. This is most likely a [philosophical decision](http://www.ubuntu.com/project/about-ubuntu/our-philosophy “Our philosophy | Ubuntu”) stemming from the ongoing debate between [open-source pragmatists and free software idealists](http://en.wikipedia.org/wiki/Free_software_movement#Criticism_and_controversy “Free software movement – Wikipedia”).
Read more →

Apache and SSL – The Easy Way

It’s no secret–SSL is confusing. Creating and signing certificates is a convoluted process, especially from the command line. Fortunately, Debian-based systems have an easy way for Apache users to create, sign, and install their own SSL certs. This tutorial assumes that Apache is already installed with the default configuration. ### Configure SSL ### Step one is to configure Apache to enable `mod_ssl`: # a2enmod ssl Enabling module ssl. See /usr/share/doc/apache2.2-common/README.Debian.gz on how to configure SSL and create self-signed certificates.
Read more →

Command Line DVD Ripping

I recently took on the task of digitizing our old VHS tapes. While digging through the tapes I came across an old, region-2-encoded DVD copy of *Rocketman*, starring Harland Williams. I bought it years ago before it was available on region 1 DVD. In those days I had a DVD drive which I kept set to region 2, but no longer. It’s time to get rid of this thing, but not before we make ourselves an MP4 copy.
Read more →

Shred Empty Drive Space

If you are familiar with the **shred** command, you know it is an easy way to make sure sensitive data is *really* deleted. Shred overwrites a file with random data before deleting it, so that the original data cannot be recovered. Shred works by overwriting the data *in place*, or over top of the original file. But what if the file has already been deleted? One way to destroy the data is to overwrite all unused space on the drive (or partition) with random data.
Read more →

Migrating IMAP Accounts Between Remote Hosts

I have come to rely on IMAP for email access. It is the most convenient way to ensure access to all my mail from more than one computer. I recently switched to a new hosting provider and I didn’t want to lose all of my archived email stored on the old host’s server. Fortunately, I found a Perl script designed to synchronize IMAP mailboxes between two servers. The script is called **imapsync**.
Read more →

SSH From the Inside

Problem I need SSH access to a particulr machine (schoolsvr) which is behind a NAT. I only need to enable access from a single client (homesvr), which has a public IP address of its own. Both machines are running sshd. I can access homesvr from a shell on schoolsvr, but not vise-versa. If I had admin access on schoolsvr’s gateway, I could alter the NAT to forward some unused port (say, 12345) to schoolsvr:22, which would allow me to SSH to schoolsvr using the gateway’s public IP and port 12345.
Read more →

A Good SSD/HDD Partitioning Scheme

An SSD is a great investment. Data loads super fast and there are no moving parts to fail. But SSD storage space is expensive, and most users have a lot to store. A common solution is to install the OS to the SSD, and move personal data (the /home directory) to a secondary HDD. While this is the easiest way to take advantage of SSD speed, the results are less than ideal.
Read more →