Saturday, June 27, 2009

MAC Address fiddling

Changing the MAC address of your Linux workstation is an incredibly easy task (in this example, from :a9 to :aa)...


  1. Determine the existing MAC address of the interface to be changed:
    $ sudo ifconfig wlan0
    wlan0 Link encap:Ethernet HWaddr 00:24:2c:e3:c8:a9


  2. Bring the interface down:
    $ sudo ifconfig wlan0 down

  3. Set the new MAC address:
    $ sudo ifconfig wlan0 hw ether 00:24:2c:e3:c8:aa

  4. Bring the interface back online:
    $ sudo ifconfig wlan0 up

  5. Verify the change took:
    $ sudo ifconfig wlan0 | grep HWaddr
    wlan0 Link encap:Ethernet HWaddr 00:24:2c:e3:c8:aa



Voila.

Friday, June 26, 2009

Connectivity, ancient Slackware, and other stuff

So sitting in the passenger seat of my brother's sedan, I was able to get online with my (sadly discontinued; it was a great, cheap, Linux portable, and all-important for me, it was the only then-available netbook without a camera; the replacement Mini 10, and the Vostro A90, are both camera-laden, as are all the other netbooks on the market now that I'm aware of) Dell Mini 9 and my Millenicom mobile broadband adapter ($50/month for truly unlimited service, pay-as-you-go), and got some client work done. Nothing huge, just reviewing a contract, adding a few lines to an addendum, and bouncing it back to him. On the way to the family farm, in the middle of nowhere.

While I was there, in the middle of corn fields, I was able to use my BlackBerry to send a copy of a fax I'd sent out using TrustFax to another party via email (downloaded the preview from their web interface and attached it as a file using the standard OS 4.5 BlackBerry mail application). Tech can be, at times, maddeningly frustrating when it doesn't work, or when it connects you to the drama at the office when you'd rather not have seen the flashing red "message waiting" light... But the times it lets you spend time with family and still get done the time-critical tasks that need doing -- yeah.

So while at the farm I stumbled across one of the first Linux distributions I ever used, a Slackware 3.0 CD-ROM from the Linux System Administrator's Survival Guide. This wasn't my first go-around with Linux; that was Slackware 2.2.0 (with August 1995's 1.2.13 kernel; of course, kernel 2.0 wouldn't be released until the summer of 1996, and the first Linux box I put into production went online in January 1996) I got bundled with the book Linux Unleashed. (Eventually I outgrew the books and just started buying dirt-cheap CD-ROMs from Cheap*Bytes. This was in the days before my college had high speed connectivity; I think the entire campus was sharing a 56k leased line. Once, I signed up for an MSN dial-up account -- which came with 100 free hours -- to download a Linux distribution.)

Anyway, with a few magical incantations:

$ sudo dd if=/dev/sr0 of=/media/PNY/Slackware3.iso
$ eject cdrom
$ sudo mount -o loop /media/PNY/Slackware3.iso /mnt


I have an ancient piece of my history I can play around with a little bit. Maybe fire up VirtualBox and see if I can get it to live again (like Arren did with the DV-8).

Thursday, June 25, 2009

In-Flight Internet

I was on an old MD-80 last night, flying from LAX to the midwest with American Airlines. As soon as we got the "approved portable electronic devices" go-ahead I pulled out my ThinkPad and fired it up, and as I went to kill the onboard WiFi I was surprised to see a hotspot. I connected to it and sure enough, after clicking through the "try it on us!" greeting, I had a fully working Internet connection. At 30,000'! Gogo Inflight. It didn't appear to be restricted in any real way; I was able to SSH and FTP out, send SMTP messages, access my IMAP server, browse the web, etc. I'm a bad geek, in that I didn't run a connection speed test (instead I hopped on Facebook and posted a bunch of "OMG I'm FLYING and talking to you on Facebook!" inanity) or otherwise determine the parameters of the link...

It was (only?) a decade ago I was totally enamored with the 9600 baud connections available through cabling a laptop's internal model (or PCMCIA card modem) via the RJ11 port provided on seatback telephone handsets, billed at like $2.00/minute, that would at least allow me to check mail / SSH in to an errant server or whatever, while en route to Europe. (I couldn't find a lot of information on this, was kind of a flash-in-the-pan thing that didn't last very long. Here's a blog post with pictures, and someone else remembering that tech...)

Tuesday, June 23, 2009

Netbook bag

I picked up a cheap Targus bag, ostensibly for netbooks, at Best Buy for $30 about a month ago, mostly because it was (a) the only netbook case they carried and (b) was being offered in a promotion with an adorable free Ultra Mini Retractable Optical Mouse which made the bag almost free.  But it never felt quite right,  it didn't seem setup for netbooks.  When I began idly looking for a replacement case, it became clear why -- it wasn't a netbook case, it was (based on the DVD301-WM model number, and the inordinate number of 5" disc shaped pockets (in a case for a device that, as a rule, doesn't have an optical drive) a portable DVD player case.  Sigh.

My needs aren't great, but I did want things like a cellphone pouch and pen loops -- when I'm grabbing the Mini 9 to hit the road, it's with the expectation I'm going to do some work.  That, for me, involves at least one carry-along pen.  (And usually a bottle of Noodler's Polar, or Luxury, Blue, but I've digressed.  Yeah, fountain pens and bottled ink.  I kick it old-school, as I boot into my alpha release Linux environment...)

Anyway, just a shout out to the Targus TSM097US, which appears to be everything I need in a netbook case.  Not sure why more netbook cases don't provide at least pen loops, seems so basic.  This one actually seems useful for the urban bedouin.  No affiliation, just, if you're looking for what I was looking for, maybe now you'll find it.  (Though Best Buy didn't have it in with their cases, I had to hunt for it and found one lonely sample shoved back behind other bags under their netbook display models.  I'd looked it up online and knew it was in the store (or at least carried by the store), and flying out tomorrow afternoon, I was ... determined.

Firefox Easter Egg

Found this amusing (let's see if it works): About robots.

(I'm geeky enough I didn't have to google for most of the references... The first one is Asimov's First Law of Robotics (ah, memories of plowing through those books as a fifth grader); I'm pretty sure the second is from Bladerunner; the third ... okay, had to Google it, Marvin (do I have to relinquish my Geek Card for not having HHGTTG memorized?); the fourth is a reference to Bender. Oh, and Cylons. The Cylons have a plan.

Oh, and Klaatu Barada Nikto is a phrase everyone should have memorized, whether because it might end up on your cubicle wall or because misspeaking it while retrieving the Necronomicon (in the event you're ever dragged back in time by a vengeful evil) can have dramatic consequences.

ThinkPad SL500 and Linux

I like the ThinkPad SL500. I know it catches flack for basically being an IdeaPad in ThinkPad clothing, but I don't care. It works well enough and the price was certainly right. Linux works almost flawlessly on it, out of the box (caveats, I don't have a fingerprint reader or Bluetooth; I use the SDHC card reader, trackpad, WiFi, USB drives, etc). The few things that didn't work were, e.g., the volume controls, hotkeys, and the screen brightness. These were all cured with a relatively painless kernel upgrade. I'm running Ubuntu 9.04 which, as of this writing, is using a 2.6.28-13 kernel; these steps bring it up to the 2.6.30 kernel with an additional ThinkPad SL500 (and perhaps other SL models) specific driver module.

  1. Obtained the Latest kernel from: http://kernel.ubuntu.com/~kernel-ppa/mainline/ (e.g., http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.30/. Files I downloaded for my Intel Core 2 Duo SL500:


    • linux-headers-2.6.30-020630_2.6.30-020630_all.deb

    • linux-headers-2.6.30-020630-generic_2.6.30-020630_i386.deb

    • linux-image-2.6.30-020630-generic_2.6.30-020630_i386.deb

    • linux-source-2.6.30_2.6.30-020630_all.deb




  2. Install the kernel:
    $ sudo dpkg -i linux-headers-2.6.30-020630_2.6.30-020630_all.deb
    $ sudo dpkg -i linux-headers-2.6.30-020630-generic_2.6.30-020630_i386.deb
    $ sudo dpkg -i linux-image-2.6.30-020630-generic_2.6.30-020630_i386.deb
    $ sudo dpkg -i linux-source-2.6.30_2.6.30-020630_all.deb


  3. Reboot.


  4. Download kernel module from: http://github.com/tetromino/lenovo-sl-laptop/tree/master (I clicked through to download the 'raw' versions of Makefile and README and lenovo-sl-laptop.c to a local directory). Change into the directory where those files reside and:
    $ make all
    $ sudo cp lenovo-sl-laptop.ko /lib/modules/`uname -r`/kernel/drivers/misc
    $ sudo depmod -v


  5. Configure the rest of the system:
    $ sudo depmod
    $ sudo gedit /etc/modprobe.d/blacklist.conf
    blacklist thinkpad-acpi # added (anywhere in the file)

    $ sudo gedit /etc/modprobe.d/lenovo-sl-laptop.modprobe.conf
    options lenovo-sl-laptop control_backlight=1

    $ sudo gedit /etc/rc.local
    # Added before the exit 0 line:
    echo 0 > /sys/module/video/parameters/brightness_switch_enabled
    modprobe lenovo-sl-laptop

    $ sudo /etc/rc.local



And voila, the brightness control, volume, etc., should be working! I love it when a plan comes together.

Cross-platform fonts

Working on a document in OpenOffice on the Mac, Windows (occasionally), and Linux works well enough, but sometimes you don't want to use FreeSerif, whatever ideological purity might be found therein. I like Georgia, and Garamond. The following command will, on an Ubuntu box, install the semi-free (as in speech) Microsoft TrueType core fonts, which include Georgia:

$ sudo apt-get install ttf-mscorefonts-installer