rickogden.com

Archive for the ‘Tech’ Category

LTSP Part 1 – gPXE

Disclaimer: This is a work in progress blog post. There may be better ways of doing things, and things may have been done wrong. Although I hope you will find this helpful, please don’t take the contents of this post as gospel.

At work we have Ubuntu terminal servers which the students currently connect to using NX on ThinStation in the labs. This is not an ideal setup, especially because the ThinStation kernel is too old to run on (even relatively) modern hardware. It is designed to setup an old computer as a thin client, and allow it to access a terminal server which will do all the hard work.

The other issue which we have is that the network is not owned or managed by my department (computer science), but by the central IT department of the university. This means I do not have access to the DHCP server which is required to PXE boot the computers. On top of this, the computers need to dual boot between the thin client/terminal server and a local installation of Windows.

This is where gPXE comes to the rescue! What gPXE allows me to do is retrieve an IP address from the university DHCP server, and then create my own network boot script completely separately.
Read the rest of this entry »

The Research Begins

As some of you may know, I have now officially started my masters. It is a technical MSc (by Research) on Location-based Social Media Services. The easiest way to describe this is I will be designing and developing a Wiki for a variety of media (text, audio, images and video) which (unlike Wikipedia) is not found using “keywords”, but instead is found based on the location of the client.

I am currently starting a literature survey in this area and have discovered a great, free, multi-platform reference manager called Mendeley, which is incredibly useful for literature storing, organising and tracking (and will even generate a bibliography)! I am researching on who’s currently doing what in location based and social media applications. This includes what applications are out there, what technologies are out there (for information transfer/web services and location analysis) and also what is currently being researched.

I will hopefully be blogging regularly about this, and keep this blog updated with my findings. Please leave comments if you have any suggestions regarding areas I should look into, applications or if you have any insight into this area.

Netbeans 6.9 Beta + Zend Framework

Having just got my brand new MacBook Pro, I’ve been setting it up as a development environment (blog post about that to come). I decided to install the new Netbeans 6.9 beta. The main reason for this is the Zend Framework (and Symfony) support.

In the past I have found Netbeans to be pretty good with code-completion when being used with Zend Framework, however with the release of Zend Tool (something I do really like), you’ve had to switch from Netbeans to the command line in order to create the project and then create a new Netbeans project from existing sources. This was a bit of a hassle.

Now, all you need to do is download the Framework, go into the Netbeans preferences > PHP > Zend tab, Zend script box should point to the zf script (from within the bin directory of the ZF downloading). On Mac and Linux it wants the zf.sh file (on Windows it will probably want the zf.bat file, although not tested). Once that has been set up, you can now create brand new Zend Framework projects from within Netbeans, and it preconfigures everything for you. Lovely!

Backup Server Slow Down

Recently I noticed that my backup server was slowing down. Doing system checks told me that it wasn’t running out of memory, nor was the CPU being highly utilised. It was only when I went into the server room and noticed that the hard drive activity light was persistently on that I realised what was causing the slow down.

I ran iotop and analysed what process was continually writing to the disk. I noticed this process was updatedb.mlocate. This is the Ubuntu indexing process, which goes through all the files indexing them to make searching much quicker. As this backup server uses backuppc and has years worth of backups, it has many thousands of files to be indexed and meant that updatedb.mlocate (which is run daily) was taking longer than 24 hours to index.

To solve this problem I edited the file /etc/updatedb.conf and added the backuppc directory to the line that tells updatedb.mlocate not to index files within a certain path. This is simply done by adding “/var/lib/backuppc” to the end of the line that starts off with “PRUNEPATHS=”.

So mine now reads: PRUNEPATHS=”/tmp /var/spool /media /var/lib/backuppc”

MooTools Cross Fader

I’ve recently developed a script in JavaScript which will perform smooth transitions between a number of elements. This is built using the MooTools framework and is available to download from the labs.

RIP Internet Explorer 6

The time I never thought I’d see is now on the horizon. The web moving away from supporting Internet Explorer 6.

Many web developers are all too aware of the pain of getting their websites working correctly in all web browsers and THEN having to make sure they work in IE6. This is not only inconvenient and irritating, but expensive. However, with Google announcing it is no longer supporting IE6 and now Amazon following their lead, it is appearing that very soon (not immediately) people will be forced to update/change their web browser to use these large and prominent websites. Many other sites have also dropped IE6 support (list at http://idroppedie6.com/).

Finally we will be able to spend our time on functionality rather than legacy support.

Define: “Computer Scientist”

I was in a meeting the other day, and something cropped up which was cause for much debate. This was attempting to define exactly what a “Computer Scientist” is. This is of course very relevant to the BSc (hons) Computer Science degree programme.

The question is: What skills should a graduate of this discipline have at his/her disposal? It’s all well and good saying “a bit of everything to do with computing”, but in practice an approach like that is very hard. How do you balance? Is there a bias? If I refer back to my Breadth Vs Depth post, I am talking about programming in specific. However, there is a lot more to “computer science” than just programming.

The “Science” part of “computer science” suggests that this is far more analytical than, say, a “software engineer” which is more development orientated. That is not to say that a “computer scientist” shouldn’t be a capable “software engineer” and vice versa. Are these two disciplines blurring? What industry should a computer scientist go into, rather than a software engineer?

Comments on a postcard please!

suPHP + Userdir on Ubuntu

Recently I’ve had the need to combine suPHP with the userdir mod for Apache on Ubuntu. By default they don’t play nice together. So here is a quick guide on how to get it working.

If you have installed a standard LAMP server (there are many guides on how to do this), you now need to install the suphp package for apache, this is called libapache2-mod-suphp:

$ sudo apt-get install libapache2-mod-suphp

Once that has been installed open the file /etc/suphp/suphp.conf in your favourite text editor. Find the line that has the docroot on, and change the docroot so that it is just “/”. This means that the suphp engine will parse anywhere in the file system, and not just in the standard html directory, thus allowing users to have their own.

docroot=/

You may also want to change the security options as appropriate, just change the “false” to “true” of the applicable ones the enable them. This is worth experimenting with. Further down you will want to set the “check_vhost_docroot” is set to false, this again is to do with the fact that userdirs are not in the vhost’s document root.

check_vhost_docroot=false

Finally you have the min_uid and min_gid properties. These are worth altering if you still want to be able to have a website running as www-data (such as the default website). If this is the case, change them both to the uid and gid of www-data (33 by default). It is not recommended to allow suphp to run as root, so do not set it to 0.

min_uid=33
min_gid=33

Finally, you need to enable the mods suphp and userdir, and disable the mod php5, this is done with two commands, and then restart apache2:

sudo a2dismod php5
sudo a2enmod userdir suphp
sudo /etc/init.d/apache2 restart

This should then allow you to run php scripts as the user who created them. To test this, create a new php file that contains:

<?php
system(id);

This will give you information of the user that the php process is running as. I recommend changing the ownership and retrying it, just make sure sure suphp is running as it should be.

Happy New Year and Updates

With it being the festive season, I have not done a huge amount of interest recently. I’m hoping to have a few things for you soon. Currently I have been experimenting with Drupal, having never used it (properly) before, this is a real learning curve.

Also I am working on getting suPHP to work with userdir, to allow users of a server to have their own webspace in a secure fashion. I will be blogging about this when it is done.

However, I have found a few things that may be of interest:
Things you probably didn’t know about PHP – Some really interesting and neat things you can do with PHP.

PHP Object Generator – Generates class structures and objects, so you don’t have to

Arithmetic in Bash

Bash is not exactly brilliant at performing numerical calculations. Recently I’ve required the need to see how many people are currently logged in on the terminal servers through NX. Now, if people are logged in via standard SSH, then it’s quite easy to count:

who | wc -l

However, if you want to perform a line count of the NX list, you have 6 lines at the top which are not part of the count. In order to perform this subtraction, we need to do a calculation. To do this in bash we use a $(()):

echo $((2 + 2))

So, if we were to use this when performing the command on nxserver, this is how it would look in the end:

echo $(($(/usr/NX/bin/nxserver --list | wc -l) - 6))

Or, if you’re not running this script as root (and using sudo):

echo $(($(sudo /usr/NX/bin/nxserver --list | wc -l) - 6))