Tag Archives: commandline

HOWTO automate Debian installs with preseed

Automatic (you know, for the people)

Automatic (you know, for the people)

I’ve installed Linux, probably 100s of times, and while going through all the questions and answers used to be fun, once you have everything decided it’s mainly a case of tab, space, enter, tab, tab, enter, space, space, tab, enter. I remember reading about kickstart, which was Red Hat‘s way of automating the install process, but Debian GNU/Linux (and by extension Ubuntu Linux) support  preseed. From Debian’s wiki, “Preseeding provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. This makes it possible to fully automate most types of installation and even offers some features not available during normal installations.” So preseeding automates the install of the OS, the questions that you’d normally need to answer interactively are predetermined, and defined by a supplied configuration file, and sometimes boot parameters. So while Ubuntu is known for it’s user-friendly OS installer, Ubiquity, preseeding the Debian-Installer  (also known as “d-i”) is the recommended method for automating Ubuntu installations and for building custom install CDs. With this in mind I set out to build a preseed config file that would automate installs of virtual KVM machines we were provisioning at a gig, but looking at how I do such bare-bones base installs, this would work for most of my normal Debian installs at home too.

HOWTO monitor your servers via Twitter

Alert: your server has failed!

UPDATE: thanks to a reader’s comment I looked into what it would take to get this working again since Twitter has completely disabled the old style of authentication in favor of full on OAuth. Basically a lot. To just post messages now it seems far more complex than it once was.My original idea with this was to do it as low tech as possible so users wouldn’t have to install a ton of stuff and configure it – I wanted it to ‘just work’ easily. Now with OAuth it seems this will never work easily, first of all you have to ‘register an application‘ for it to have access to OAuth – which seems crazy to me, we don’t want it to have access, just the ability to push a message to an account. Then if you look there are libraries out there that *can* post, but look at the directions for one of the libraries, it involves not only building the app and getting temporary access to the twitter API, then you also have to get the two keys from that and bake them into the app by recompiling it, and then more configuration, etc. So for now I am MARKING THIS IDEA AS DEAD. If I figure out a new way to do it that I can sketch out I will, or if anyone else has a simple way post it in the comments and I’ll update it here. Thanks for your interest and good luck!

HOWTO: send commandline email with attachments

You've got mail!

Are you like me, do you have scripts running on servers and you need to know what they know? If there’s output in a file you can sed/grep/awk info out of them and have them emailed to you, but if you don’t know specifically what you’re looking for you may need the entire file/log/whatever. You’ll need a utility called uuencode, which is a utility that,