Updating Thinkpad Firmware with Linux

Lenovo packages its UEFI firmware updater as either a Windows installable package or a bootable CD image. The bootable image is great for those running Linux on their systems. However, if you do not have an external CD drive or do not want to burn a CD, the update process takes a few more steps. Fortunately, the updater can be extracted from the CD image and written to a USB drive with Linux.

Read More

Enable NVIDIA modules in EC2 GPU Instances without Rebooting

Recently, I needed to use GPU instances with a custom AMI1 on EC2. The image I needed to use did not contain the necessary NVIDIA and CUDA2 modules and instead contained nouveau. This posed a unique situation because normally a reboot is necessary after installing the official module. However, the software I was provisioning the instances with was unable to resume after rebooting. Using this short script I was able to swap the opensource nouveau module for the NVIDIA module without rebooting the instance.

Read More

svn2git: Tag Already Exists

If you find yourself migrating a repository from subversion to git you may run into a couple issues. One common issue I ran into was where an engineer updated a tag. When converting a repository with a modified tag, svn2git1 will stop and return an error message stating that a duplicate tag is present. Fortunately, this is an easy issue to correct. You simply need to delete the tag and rerun the conversion.

Read More

Publish Vagrant Boxes with rsync

The built in vagrant push command allows you to post your boxes publicly to Atlas. However, what if you want to publish boxes to an internal or private server over ssh? Fortunately, the push command can be redefined. Out of the box it is possible to use other methods that allow publishing boxes to both Heroku and via FTP/SFTP. Vagrant also allows using a custom shell script with local-exec to publish your boxes.

Read More

Bulk Delete Messages from Postfix Queue

Have you have ever had a script or application accidentally send thousands of messages through your postfix queue? With this simple tip you no longer need to wait for those messages to be processed through the Postfix queue. This one liner is also helpful if you have a lot of differed messages in the Postfix queue you would like to discard. You can simply use standard linux tools to awk through your Postfix queue and drop those unwanted messages.

Read More

Quickly Transfer Files Between Servers

When transferring files between systems usually rsync or scp are all that is needed. Sometimes, there are difficult edge cases. For example using rsync to transfer many files spread across 1000s of directories quickly. Recently, I needed to move several TB worth of files in varying size spread across 1000s of directories. I found that rsync spent most of the time traversing directories and not copying the data. I turned to the webs to find a better solution.

Read More

View Man Pages with Preview on Mac OS X

I am always looking for better ways to integrate the unix components into Mac OS X. I recently came across a great way to connect the man pages to a more visual mode in OS X. Sure, you could always use xman as a visual multi window view for the man pages, screen, or some other multi window handler. However, I was not impressed with the x window environment on OS X because it requires a lot of modification to leverage the fonts and the rendering engine of the OS.

Read More

List and Disconnect PostgreSQL DB Sessions

Some times it is necessary to terminate a PostgreSQL query and connection. This can be very helpful when you have a run away command or script. It can also be helpful if your application has submitted a query to the backend that has caused everything to grind to a halt. Fortunately, postgres comes to the rescue and provides a few helpful commands that will allow you to cancel the query from the database and optionally terminate the user or application’s connection.

Read More