Shane Duffy

Archive for the ‘Linux’ Category

After getting a CurrentCost energy monitor a week ago I decided it was time to get some useful data out of it. I have 3 phase power so I wanted a tool which would create graphs for each of the phases along with combined total data. The solution to my problems would have to be custom coded and I also wanted an application which could be used cross platform as I regularly use both Windows and OSX.

My choice was to use Adobe Flex as it can provide some nice looking graphs and I have been meaning to do more work using the Flex in flash player or using Adobe Air technology to create a desktop application.

CurrentCost Application

CurrentCost Application

Im creating an application which I can give back to the community which have been developing applications already for the CurrentCost meter. So I decided to use a very simple architecture for this first demo application which uses a simple client server model.


At some stage most of us have needed to work on our websites and move things around, For most people would do this live on the website and this does not make for a great experience for your customers and clients who end up visiting broken and half finished pages. Or even worse the search engine crawlers that come along and find sample text on your pages.

One of the neat tricks of a .htaccess file is been able to enable a maintenance page for all your visitors to your website but still been able to access the website yourself for testing and development.

RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^86\.43\.107\.123
RewriteCond %{REMOTE_HOST} !^86\.43\.107\.201
RewriteCond %{REQUEST_URI} !/maintenance\.html$
RewriteRule .* /maintenance.html [R=302,L]

The above when placed in a .htaccess file will redirect all clients who are not coming from
or to the maintenance.html webpage

Simple yet very handy to have!

Im working on a project now and using subversion a lot for the project. One of the things that has been annoying me in the last while is sometimes I want to move code into another svn repository while working on it, and really the only way to do it is to remove all the .svn directories check out the top level empty directory of the repository I want to place the code into and then do svn add *

The only problem been that removing all the .svn files can be a real pain on large projects.

find . -type d -name ‘.svn’ -print0 | xargs –0 rm -rdf

Is a very handy command that I now use all the time. What this does is find all the .svn directories and removes everything below them, leaving me free to add the code back into another subversion repository.

Update: This is also very handy way of reducing the transfer size if using SCP to move your code between servers. As when working on SVN subversions files the .SVN directories can double the size of your code on disk as they store copies of the files in the .svn folders for later comparison

Here is how I got Ubuntu 7.10 installed and working on my parallels virtual machine, also you might find Ubuntu 7.10 Linux Unleashed a very useful book to read.

VM Memory: 512 HD size 6-10GB

1. Boot the install CD. When the menu screen comes up press F6 for boot options before it starts the install

2. Delete the ‘splash’ option and press the Return key to start up the installation. This will prevent the terminal window from being hidden by a splash screen so you can do the next steps.

3. The install system will begin to boot and the display server will die as before. However now it will go back and forth between the graphic display window and the terminal window. During the moments that it is in the terminal window you can type to the command shell. If it comes up with the window that says ‘The display server has been shut down about 6 times in the last 90 seconds’ go ahead and type Return to select the OK and you will again get the terminal window and in a few minutes get the dying display server again. Persevere and you can keep typing thing in the terminal window.

4. First type ctrl-c to kill the script and get you a shell prompt. Then using vi or pico as you prefer, edit xorg.conf as root:

sudo pico /etc/X11/xorg.conf

5. Scroll down to the Device section (not Input Device), and insert inside it the line

Option “LVDSBiosNativeMode” “false”
then save the file and exit the editor.

6. Start up the display server again by typing the command


This will bring up a window filled with a grey pattern. Have patience and wait, and in a minute or two you will get a real Ubuntu desktop with an Install icon on it. Double-click the Install icon to start up the install process.

7. The display server error will keep happening, but the install continues anyway. Whenever you get the ‘The display server has been shut down about 6 times in the last 90 seconds’ window you have to type Return again to get back to the install window. It is really annoying having to do that every few minutes, but eventually the install is completed.

8. However you are not yet done. If you reboot after the installation (remember to disconnect the install CD) you will still get that display server death problem. The next steps are to get rid of that:

9. Reboot the virtual machine and when it says to press ESC to get the boot menu, quickly press ESC to get the boot menu, scroll down, and boot in recovery mode. That gives you a root shell prompt in a terminal window.

10. Type the appropriate keys to get your mouse back and in Parallels’ Actions menu select Install Parallels Tools. That will show you instructions on how to install the tools, and will connect the tools CDROM image.

11. At the root shell prompt, type the commands that you were shown to install the tools

mount /media/cdrom
cd /media/cdrom
shutdown -r now

12. That last command reboots the virtual machine. When it comes back you should have a working Ubuntu 7.10

I would also recommend Ubuntu 7.10 Linux Unleashed, 3rd Edition

So earlier today I was trying to install the latest version of Ubuntu 7.10 on my Macbook pro with out any success.

Turns out there are some issues with the VM machine and memory, by setting the VM to use only 512MB instead of the 1024MB I had alloted first time round the installer process now runs without crashing.

Updated: See Ubuntu 7.10 install guide parallels

Ubuntu 7.10 Linux Unleashed, 3rd Edition
Ubuntu 7.10 - Coming soon

Just downloaded the lastest release of of Ubuntu. And decided to install in under Parallels of which Im running the current latest version 5162. Unbuntu installer just seems to lock up while trying to install with no errors or warnings and can only be recovered by resetting the the VM.

There seems to be a number of users on the parallels support forums reporting the same problems and posting work arounds of installing Ubuntu 7.04 and preforming a distupgrade to get the latest version install.

For now Im going to poke around with the install some more and see if I can come up with anything that would help anyone else having the same problems.

Updated: See Ubuntu 7.10 install guide parallels 
and Installing ubuntu 7.10 on Macbook pro (parallels)

Subscribe to this blog now!

Top Clicks

  • None
July 2018
« Feb