January 2008 Archives

Carla Schroder

AddThis Social Bookmark Button

One thing that did not make it into the Linux Networking Cookbook was a chapter on setting up VLANs (Virtual LANs). VLANs are logical subnetting, rather than being constrained by your physical Ethernet switches. Now that “smart” switches have gotten so inexpensive, VLANs are nice options even for small networks. For one example, you can run multiple subnets off a single switch. Parts 1 and 2 of my three-part series are here:

Do More With Less: Build a Linux VLAN
Do More With Less: Port-Based VLANs

Windows and Mac clients can also be members of your VLANs; part 3 will address tagged VLANs, routing and Linux client configuration.

Part 3 runs next week.

Caitlyn Martin

AddThis Social Bookmark Button

Like most people who do tech work of some sort or another for a living I love my toys. I’d love to have the latest and greatest gee whiz system and if I won the lottery I probably always would. Today’s best full-featured distros all have native 64-bit versions. One of my favorites, Vector Linux was a little late to the table but I’m pleased to report that the current release, Vector Linux 5.9 Standard, has a 64-bit version in beta right now. Good news.

Of course not everyone can afford the latest and greatest. In the developing world in particular people make do and sometimes manage to do wondrous things with what folks here in the United States would call obsolete. Even if hardware is new it is sometimes designed to be what would normally be considered a low spec system either to be energy efficient (green computing) or low cost. The laptop designed for OLPC is a great example. So are green systems and low cost systems designed for use in first world, developed countries, including systems based on Nano-ITX and Pico-ITX technologies. ASUS Eee PC, designed for ease of use, small size, and low cost is another great example that’s generated a lot of buzz. I know for most of you I’m preaching to the choir but I actually was criticized in a comment to my recent review of AliXe 0.11b for suggesting keeping old computers running is somehow a good idea.

Yes, there are a bunch of lightweight Linux distributions that meet this need nicely. Vector Linux started out as such a distro a decade ago but evolved into a full featured distro. The Vector Linux developers have returned to their roots, though, and now have Vector Linux Light in alpha. VL Light is an ultra light version of VL built with a current kernel and current applications but designed to run smoothly in just 64MB of RAM. I have Vector Linux successfully running on an old Liberty small footprint box with just a Pentium 133MMX processor and 32MB of RAM. That’s normally Damn Small Linux territory but it’s nice to be able to run something a bit more modern and a bit more capable on the old beast.

Kudos to the developers at Vector Linux for scaling down as well as scaling up. There’s nothing more friendly to the environment or the budget than keeping an old system going rather than building or buying a new one. So long as a computer can do what you need it to do it’s not obsolete. I’ll be following up my AliXe review with reviews of other lightweight and small footprint Linux distributions, including Vector Linux Light when it’s released.

Juliet Kemp

AddThis Social Bookmark Button

Occasionally it is necessary to print out a text file. There are a couple of ways of making this happen in a slightly prettier fashion than simply using lp file.txt.

a2ps is one possibility - it gives you nice borders & prints by default 2 x A5 pages sideways on A4 (landscape). There are a vast array of options. However, none of them give you double-spacing, which if you’re printing in order to edit, is a nuisance.

pr, on the other hand, doesn’t do the pretty thing, but does do double-spacing. And you can pipe its output elsewhere.

So we get:

pr -d -t | a2ps
which will send output to your default printer. (Use the -o switch to a2ps to get a postscript file instead if you want to check layout first.) The -d switch does double-spacing, the -t switch suppresses the filename and page header, which you don’t want because a2ps will provide them.

Obviously if you want real proper nice printing then I commend to you the splendid LaTeX, but if you need plain text then putting in then stripping out all that markup is a PITA.

chromatic

AddThis Social Bookmark Button

I’m at the KDE 4.0 release event, and Haavard Nord from Trolltech just announced they’ll license Qt 4.0 under the GPL v3 in addition to GPL v2. The KDE folks in the room gave that announcement a standing ovation. Apparently they’ve worked recently on being able to relicense parts of KDE under the GPL v3 as well.

Juliet Kemp

AddThis Social Bookmark Button

I have cron-apt set up on all my machines — you can get it to install any updates automatically but that sounds like Bad News to me, so instead it’s set to download and email me. I had a script that took names-of-machines-to-upgrade as arguments and did the rest for me, but that involved typing up to 50 machine names. And I am lazy.

So I finally got around to writing a script that parses a local mailbox, grabs the machine names from the subject lines, and does the rest from there. My involvement now is:

  1. Get Thunderbird to show me only the cron-apt emails (via tag filter — tags are automatically applied).
  2. Quick check of the emails to make sure nothing outrageous is going to happen.
  3. Select all, hit Ctrl-6 to move them to the special mailbox (TB QuickMove Extension allows you to allocate up to 10 mailboxes to key combinations).
  4. Find terminal window, run script.

Note that in an ideal world I’d be using Net::SSH::Perl to check for the root ssh key, but I was having problems with CPAN when I wrote this.

#!/usr/bin/perl -w

use strict;

my $homedir = "/home/user";
my $file    = "$homedir/mail/aptget";
my $sshkey  = "$homedir/.ssh/key";
my $cmd     = "apt-get -y upgrade";
my @hosts;

sub runcommand();

open FILE,"+<$file";

# Subject line looks like:
# Subject: CRON-APT completed on machinename [/etc/cron-apt/config]
while (<FILE>) {
    next unless /CRON-APT completed/;
    my @line = split;
    my $hostname = $line[4];
    push @hosts, $hostname;
}

# Check if sshkey is in ssh list & add it if not
if (`ssh-add -l` =~ /.* $sshkey/) {
    runcommand();
}
else {
    `ssh-add $sshkey`;
    runcommand();
    `ssh-add -d $sshkey`;
}

print FILE "";
close FILE;


sub runcommand() {
    foreach my $host (@hosts) {
        print "Host is: $host\n";
        system("ssh root\@$host -i $sshkey $cmd");
    }
}
Carla Schroder

AddThis Social Bookmark Button

I finally broke down and ordered a LapGenie. I would have bought one a long time ago, but at $139 my inner cheapskate just couldn’t quite take the plunge. Well I finally did, and I’m glad. It’s lightweight, sturdy, and comfortable. It supports the weight of my laptop, adjusts to a useful range of heights and angles, and I can squirm and fidget all I want to without upsetting the computer. I use it all over the place- couch, bed, and outside chair when the weather permits.

It seems to be well-made, so I expect many years of service. They have a 30-day money-back policy and a good warranty. It showed up five days after I placed the order- many thumbs up for the LapGenie.

Juliet Kemp

AddThis Social Bookmark Button

We have an NFS system which involves part of the local disks of all desktops being exported via NFS. Mostly this is consistently accessed via /disk/machinename, but some desktops have more than one local directory that’s exported. I finally got around recently to rewriting the (very old and no longer functional) script to query the LDAP database and get this info for a given machine name:

#!/usr/bin/perl -w 

use strict;
use Net::LDAPS;

die "Usage: showdisks machinename\n"
        unless (@ARGV == 1);

# Get & set values
my ($search) = @ARGV;
my $server   = "ldaps://ldap.example.com";
my $cert     = "/etc/ldap/servercert.pem";
my $base     = "dc=example,dc=com";

my $ldap = Net::LDAPS->new( $server,
                             verify => 'optional',
                             cafile => $cert ) or die $@;
my $mesg = $ldap->bind;

my $filter = "(nisMapEntry=*$search*")";
 
$mesg = $ldap->search(  base   => $base,
                        filter => $filter,
                        attr   => ['cn', 'nisMapEntry', 'nisMapName'],
                     );

$mesg->code && die $mesg->error;

my @entries = $mesg->sorted('nisMapEntry');

foreach my $entry ( @entries ) {
    my $location  = $entry->get_value( 'nisMapEntry' );
    my $automount = $entry->get_value( 'nisMapName' );
    my $dir       = $entry->get_value( 'cn' );

    # The if is because otherwise you get warnings from the first couple of lines 
    # of the LDAP return.  
    if ($dir) {
        my ($auto, $path)= split /_/,$automount;
        print "$location : /$path/$dir \n";
    }
}

$mesg = $ldap->unbind;
Hope it’s useful to someone! If your LDAP automount info wasn’t exported from NIS you may have different names for those attributes.
Caitlyn Martin

AddThis Social Bookmark Button

Over the past year or two I’ve been drifting away from Fedora, Ubuntu, and Mandriva towards distros derived from Slackware for desktop use. The reason is simple: these distributions tend to have the best performance I’ve found, particularly on older or limited hardware. Slackware itself lacks some graphical tools and user friendly features that more popular distros have but is outstanding in terms of stability and reliability. A number of Slackware derived distros retain those benefits while offering the ease of use many of us have come to expect. AliXe is such a distro, albeit one designed to be small and compact, making it particularly suitable for older hardware. True to it’s Canadian heritage, AliXe also offers full support for both French and English despite it’s small size.

AliXe is designed to be run as a live CD. Those burdened with slow connections will be pleased to see that the iso image is less than 340MB in size. An optional installer (not included in the iso) is available for a conventional hard drive installation. The AliXe website warns that this is for “experts only”, in part due to an utter lack of documentation. AliXe also offers the option to run entirely cached in RAM provided you have enough memory. AliXe is built with the Linux Live scripts so a frugal install, similar to Damn Small Linux, where the iso image is installed directly to the hard drive and is booted read-only, is also possible. You are then effectively running the Live CD with the speed of a conventional hard drive.

The AliXe code base is a heavily modified version of Slax 6rc6, which in turn is based on Slackware 12. Unlike Slax, which uses KDE for the desktop environment, AliXe uses the smaller, lighter, but still powerful Xfce. In order to remain small AliXe offers just one of each type of application it provides, including the desktop. I tested AliXe on my five year old Toshiba Satellite 1805-S204, which has a 1GHz Intel Celeron processor and 512MB of RAM.

Advertisement