Author Archives: Tommy Butler

apt-get “public key is not available: NO_PUBKEY”

Problem:

When you run `apt-get update`, you get an error similar to:

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5C808C2B65558117

The solution:

? ? ? https://github.com/tommybutler/apt-key-install

You can fix it with a series of one-off commands that you’ll probably not memorize and always end up googling…  Or, you can automate this into an single easy command by adding a few lines to your .bashrc file or with a script.  I wrote the code for both options which you can snag from github (link above)

After you install it, just type, for example:  apt-key-install 5C808C2B65558117

Make sure you trust the key before you install it, and there you go! ?

Organize Photos By EXIF Date, or “How To Fix Your Shotwell Library With Perl”

exifsort --source ~/unsorted/media/files --dest ~/Photos

When you take a picture with your digital camera or smartphone, a time stamp is embedded in the file.  Other cool types of info are also embedded, but that’s not in the scope of what I’m covering here.

I wrote a tool in Perl called exifsort.  It takes a directory tree full of unorganized photos and movies, maybe dating from many years back, maybe several levels deep, and it organizes all the files into a date-based directory hierarchy exactly like f-spot or shotwell.  In fact, you can use it to put disorganized media files right into your f-spot/shotwell library without even opening the software. Continue reading

Autostart VMware Virtual Machines at Boot in Linux

Do you run VMware Workstation on your Linux machine?  I do.  A lot.  So much in fact that I’ve found it necessary to do things with VMware workstation that it doesn’t do on its own.  Maybe in time it will change and add such features, but for now you can’t auto-start VMs on boot.  Well, not without some tweaking. Continue reading

Compiled and Encrypted suid Perl Programs

The Use Case

I recently found myself in need of a way to escalate privileges for only one user on my system (me), for the purpose of running only one script without prompting for a password.  It made sense to run the script setuid and have the code enforce the policy that I alone am allowed to run it.  Using sudo in a way that limits permissions to the use of a given single command is one way to do it, but I saw this as a challenge.  I had a perl script and I wanted to run it suid.  I wanted to know if it could be done.  And I proved it could, though it wasn’t easy at first. Continue reading

Script to Offline and Remove A Disk In Linux

This script will offline and remove a hard drive from your Linux machine.  That doesn’t mean it physically pulls it out of your server 😉  Instead the script spins down the disk, removes it from your server’s list of devices under /dev, and powers it off. This is really handy if your system keeps locking up because of a bad disk. Continue reading

Lacuna Expanse and Team UNSC

Screenshot-The Lacuna Expanse - Massively Multiplayer Online Space Strategy Game

Screenshot-The Lacuna Expanse – Massively Multiplayer Online Space Strategy Game

Lacuna Expanse is a fun, free MMORPG I got involved in a few months back.  It is written in Perl, which is how I came to know about it in the first place.  It uses XMLRPC, AJAX, JSON, all kinds of cool technologies, and it also exposes an open API to script against.  What’s even better is that there are already free and open source libraries and scripts to use if you want to automate things in the game.  Naturally, many if not most of them are also in Perl.  For me that is a big win. Continue reading

Animated Gifs on Linux with ffmpeg and imagemagick

This post is somewhat inspired by the fact that Google+ now makes cool little gif animations from photo bursts of 5 pics or more when you upload.  Very nifty.  But, ugh, the images are SMALL and often choppy.  What if you want larger picture dimensions, smoother or longer animations?  For those who care about making these *ridiculously cute* animations out of mpeg or avi movies from your phone/camera/youtube… this is for you. Continue reading

Lunch With Larry Wall

That’s him, the legendary TimToady.  Larry Wall is personally responsible for one of the greatest joys in my life: Larry created Perl.

Perl has remained a core staple in my toolbox of awesomeness since 1999, when I discovered it as a younger developer/engineer just starting out my career.  Over the years, Perl has been been a tool I’ve used both for fun and profit, building and automating all sorts of things.  As I explained to Larry at lunch, his work made mine possible, and the rewards of my having embraced Perl have been Continue reading