Linfiniti Geo Blog

GIS for Open Source People

Browsing Posts published in August, 2009

I have been working on building a small training lab. The idea is that I will have six thin client pc’s and use my day to day desktop machine as a server. The server will run dhcp and the Linux Terminal Server Project server modules to provide a boot over ethernet (PXE) service for the thin clients. With LTSP I will be able to look at the screens of my trainees and share my screen back with them.

I did the basic install something like this:

sudo apt-get install ldm ldm-ubuntu-themes thin-client-manager-backend \
         thin-client-manager-gnome ltsp-manager controlaula ltsp-server-standalone \
         ltsp-build-client ltsp-server
}}}

I’ve disabled the DHCP functions on my home router and set up my dhcp configuration file like this:

{{{
#
# Default LTSP dhcpd.conf config file.
#

authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
    # Give any computer requesting an address an IP Address in the range 20 to 250
    range 192.168.1.20 192.168.1.250;
    option domain-name "linfiniti.com";
    # Using open dns prevents phishing attacks and other potential dns based exploits
    option domain-name-servers 208.67.222.222,208.67.220.220;
    # Example of how to give a computer the same IP address each time it connects
    host timbuntu {
      #Always make this computer ip 1
      hardware ethernet 00:22:3f:df:bf:0b;
      fixed-address 192.168.1.2;
    }

    option broadcast-address 192.168.1.255;
    option routers 192.168.1.1;
    option subnet-mask 255.255.255.0;

    # For pxe boot

    # next-server 192.168.0.1;
    # get-lease-hostnames true;
    option root-path "/opt/ltsp/i386";
    if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
        filename "/ltsp/i386/pxelinux.0";
    } else {
        filename "/ltsp/i386/nbi.img";
    }
}

I did encounter one gotcha when following the instructions at https://help.ubuntu.com/community/ThinClientHowto and that is due to the fact that the server runs x86_64 Ubuntu and the clients are 32 bit. To take care of future clients that may also be 64 bit, I added client support for both architectures like this:

#x86_64
sudo ltsp-build-client
#x86_32
sudo ltsp-build-client --arch=i386

Currently I am using my fit-pc as the thin client, and I will probably look at buying four Acer One Aspire netbooks (going for ZAR 2000 a pop now at Incredible Connection!) for the remaining clients assuming they can do PXE and run at a decent resolution on an external monitor.

I’m still getting things set up and configured, tested etc so I can’t say how well this approach all works out yet. My fallback will be to use NXServer if it doesnt work out, which has the advantage of requiring less configuration to set up and less bandwidth to use, but the disadvantage of not providing all the training room tools like screen takovers and screen sharing. I’ll post more once I have got everything running in earnest to let you know how it works out….

Ok so I have a few production databases that I need to back up regularly. The trick is I want to run the backup from a remote machine so that the backup lives on a separate server to the actual database system. You can run backups manually like this (assuming your database is called ‘postgis’):

pg_dump -h dbhost -f postgis_`date +%d%B%Y`.sql.tar.gz -x -O -F tar postgis

When you run the above command, you will be prompted for a password. After entering the password you will find a date stamped backup. Very nice, but you may have noted that pg_dump has no option for giving it the password on the command line – it expects you to do that interactively. So what do we do if we need to automate the packup using a cron job? The solution is to use either ~/.pgpass or the PGPASSWORD environment variable. So here is how I automated the backup by placing a script in /etc/cron.daily/

export PGPASSWORD=secret
pg_dump -h dbhost -f postgis_`date +%d%B%Y`.sql.tar.gz -x -O -F tar postgis

I’ve been doing quite a bit of web development these days and have found the jQuery library to be indispensible. Here are a few addons and samples that I found to be really useful:

I’ll add to this list over time as I come across more interesting gizmos.