Unless you continue to remember it

The dynamic device interface for Linux is called udev.  Generally it works without complaint or frustration but it does have some interesting side effects if you are doing more involved system configuration.  The one that tripped me up today is that udev keeps a record of every nic card that has been dynamically created during it’s lifetime.  For example, if you are using wireless USB nic (see my post yesterday) and you plug in a different one than you used before; the new nic ID is going to be wlan1 instead of wlan0.  Generally nobody would care; but in this case I did.  Thankfully modifying these records is pretty easy.  The device history is stored in /etc/udev/rules.d/70-persistent-net.rules and can be modified by hand.  Just change the wlan1 to wlan0 and delete the other entry.

Once again, text file configuration is FREAKING AWESOME!

The gap between the ones and the zeroes

Wireless configuration on embedded Linux systems has been pretty well documented for a while now.  If you are running a Desktop version of Linux then the probability of your wireless device being supported (either natively or through the WindowXP visualization layer NDIS) is likely to be transparent to you.  The situation is slightly different when you enter the embedded side of Linux where non-native driver support is really not an option.  That said, I have fallen in love with the Edimax Technology wireless USB nic (it uses the RealTek chipset) because they are smaller than my thumbnail, work with any Linux distribution you can think of (even Raspberry Pi), and  cost about  10 bucks.  Heck, they even support 802.11n.  To get this thing enabled/working on Debian from the command-line has been pretty simple.

apt-get install firmware-realtek
modprobe rt18192cu
ifconfig wlan0 up

Then iwlist wlan0 scan will show you a list of the available wireless networks.  Basically apt-get download the drivers, modprobe installs the the drivers, ifconfig turns on the wireless device (otherwise you get a wlan0 Interface doesn’t support scanning : Network is down when you try to scan the.  Not exactly the best error message, but anyway…

The evils which have never happened

I found this stupidly useful shortcut inside of cron.  Generally crontab entries look like this:

* * * * *  username dosomething

With the * corresponding to minute, hour day of month, month, day of week.  But cron also has a couple shortcuts that are useful for general system maintenance.  Specifically @reboot which replaces  ALL of the “*”‘s and will be run after each system reboot.  There is also a system wide directory under  /etc called cron.d which is wonderfully useful for package management because you can drop custom package cron jobs into the directory without directly editing the crontab file.

All of this information is well know among the Unix community as a whole and fairly well mentioned is about 10,000 different places.  Here is something that isn’t quite as easy to find but still ends up being pretty important…

File entries in cron.d cannot have a period in their name…. no file extension… no period separator… NOTHING… otherwise cron simply doesn’t run the file!!!

I just about killed myself debugging this one over the last two days. </crying>  Now if you will excuse me, I am going to drink my body weight in beer.

Frittered away by detail

My first reading of the http 2.0 draft proposal left me with the feeling that they were trying to address issues that are not really problems.  At least, not a problem unless you happen to be someone like Google or Cisco.  Part of what has made the internet so ubiquitous is the easy ability for people to see and understand the basic underpinnings of how everything works.  For example, I challenge you to find a developer who didn’t start their career by right-click -> View Source’ing a website. This is the very same reason that exceedingly popular web specifications are commonly NOT industry specifications. For example something like XML is so obnoxiously complex and excessive that it often seems like the only companies using (and making money) of such technologies are large institutional players like Oracle and IBM.  Instead start-ups, innovation creators, and entrepreneur continually choose things like JSON because it is simple and easy to make robust.  Honestly, I don’t know a single developer using AJAX that actually uses XML (the X in AJAX) because all it does is add size and complexity.

If you get the chance please read this great post by The Accidental Businessman.  It does a good job of explaining some of the issues I see in http 2.0 and what we are loosing by making a more “computer focused” internet.

Its appointed time for everthing

If you are a command line junkie, you really need to check out @climagic on twitter.  Some days are better than others but I am constantly amazed at what is possible in bash/csh.  That said, here are a couple commands I have needed recently, many will be worthless to anyone else but oh well:

  • ar vx mypackage.deb Unpackage a Debian binary install package. The result is actually three tar.gz files
  • dpkg -l  – List all installed Debian packges on a given system.
  • dpkg -c mypacakge.deb  –  List all files provided by the named Debian package.
  • hub pull-request -i 123 -b account/project:master -h account/project:branchtomerge  –  hub is a github utility that allows you to use some github functionality directly from the command line.  The preceding command will issue a pull request for branchtomerge into master and even tie the request to a given issue number (in this case issue #123.)
  • echo $(sha256sum $DEB | cut -f1 -d’ ‘) $(ls -l $DEB | cut -f5 -d’ ‘) $(basename $DEB)  –  This command creates the package hash structured named used INSIDE of Debian changes files.  Using the same command with (sha1sum|md5sum|sha256sum) will provided all three needed package id’s.  The reason this is useful is when you need to recreate a changes file without the original source package.  The rest of the file is fairly straight-forward but the signed package section has to absolutely precise. Also check out this link for more information.
  • asciiquarium  – OK, you might have to install this one first, but it is a full aquarium in ascii characters, including sharks that eat the fish.  Submarines, fishing hooks, and even the lock ness monster.
  • grc tail -f /var/log/maillog –  Note to self, I need to make an rpm for this package.  grc is a generic colorizer for other command line programs that don’t use color by default (like tail, traceroute, syslog, etc…)
  • isohybrid -h 64 -s 32 mycdimage.iso  –  Adds a simple filesystem layout to a standard iso image so it can be written to USB drive as well as an regular CD.  Really useful for building custom Linux CD/USB images.

Forms it never takes, places it can never be

So, after looking around for an answer today I finally found out where the Debian install CD stores its cd/usb boot menu configuration files.  While I have already had a great deal of experience editing grub.conf files by hand, this methodology simply doesn’t work on an “El Torito” Joliet CDROM image.  So Debian set-up their boot image (as part of the initial ram disk) inside of the /ISO/isolinux/ directory where ISO is the uncompressed version of the boot image.  Specifically you can configure things like:

  • The boot option timeout in /isolinux/isolinux.cfg
  • The background splash image in /isolinux./splash.png (640×480 on the default menu set-up)
  • Which sub-menu’s, options, boot methods, and GUI installs are available via the /isolinux/menu.cfg

Honestly, I may be the only person on the planet trying to figure this stuff out; but here it is for future reference or for anyone who wants to make their very own custom Debian install CD .