Get in touch:
01524 851 877
07718 896 553

VGA Multi Head Monitor Switching Off And On – Radeon X1300 Pro

Posted on May 27 2011

I was setting up a fourth monitor on my system today and when I finally got my xorg.conf correct the new monitor (VGA) was switching itself off and then straight back on again approximately every 30 seconds.

At first I thought it was the monitor itself so swapped it for another one but as it turns out it was s daemon called ‘upowerd’ causing the problem. Thanks to the guys over at #radeon on freenode for pointing this out.

upowerd polls the monitor every 30 seconds and on some VGA setups this causes the monitor to briefly switch off and then on again. Killing the upowerd process stops the monitor doing so but within a couple of minutes the process starts back up again. In the end I just moved the binary somewhere else so it couldn’t be started and it has cured the problem. From what I can tell upowerd not running isn’t a huge problem but time will tell if it comes back to bite me in the future…

** EDIT – Well there is a problem with not running upowerd it would seem. The PC won’t go into standby without it running. I have decided to look into sorting this out properly but in the short term I am just running upowerd before I put the machine into standby and killing it when I switch it back on. This seems to do the job OK but not an ideal long term solution…

XEmacs window height 0 too small bug and a fix

Posted on Feb 10 2011

I am an avid user of XEmacs and have recently started using it for my LaTeX editing as well after getting fed up with a few limitations of my old editor. I ran into a bug in it however that can halt usage of it rather quickly which occurs when you already have one .tex file open and try to open another file.

If you attempt this with some versions of XEmacs the open file dialog will not appear and you will see the following error:

window height 0 too small (after splitting)

There is a workaround for this bug (which hopefully will be fixed in an upcoming XEmacs release).

First you have to locate the file minibuf.elc. In Ubuntu 10.10 (with XEmacs version 21.4.22) this file is located in :

/usr/share/xemacs-21.4.22/lisp/minibuf.elc

Open this file and within it you need to search for the following string:

split-window frame-height 3

Replace the 3 in that line with a 5. After this open your init.el file. This is usually in ~/.xemacs – In this file add the following line:

(load-library "minibuf.elc")

Et Voila! After you have done all this you should be able to get the open file dialog to appear.

Image File Conversion Script

Posted on Jan 12 2011

Here’s a nice simple script to convert all the pdf files in a directory to jpg files using the convert program. To use this you will need ImageMagick installed on your Linux/Unix host.

#!/bin/bash

for file in `ls *.pdf`
do
   convert $file `echo $file | sed 's/\.pdf$/\.jpg/'`
done

Ubuntu On Lenovo Thinkpad X201 (Blank Screen Problem)

Posted on Apr 26 2010

Just got myself one of these and had a few problems getting Ubuntu to even boot from a USB stick on it. Although it sounded like everything was going smoothly the screen was blank for some reason.

A quick google about brought up this bug:

Launchpad Bug Report

The solution to the problem is in comment #8 on there. Basically you need to use the following boot option to get the display working correctly

xforcevesa i915.modeset=0
Just stick this in at the bootloader and it should be fine. When Ubuntu is fully installed just put the same line into /etc/default/grub to make the change permanent.

Ubuntu 9.10 Sound Problems And Script Solution

Posted on Jan 05 2010

I have been having a problem recently with my desktop PC where the sound would work perfectly through the speakers but as soon as I plugged in my headphones the volume decided to gradually fade down over 10 seconds to nothing. After this I would get no sound at all.

This hasn;t really been a big problem until very recently as I have decided to use my headphones a bit more to give my girlfriend a bit of peace and quiet. Obviously the problem needed fixing.

After a bit of messing around I managed to totally disable my sound card by accident. After doing this I stumbled across this nice little script.

This script did a brilliant job for me of detecting my sound card and configuring it perfectly in a matter of seconds with a little bit of user interaction from myself. I would highly recommend this script for anyone that is having sound issues.

Texmaker High CPU Usage And Slow Typing On Ubuntu 9.04

Posted on Oct 29 2009

I have been using Kile for a while for my LaTeX editing needs but after getting a new netbook (running Ubuntu 9.04 netbook remix), and not wanting to install the KDE libs I decided to switch back to texmaker.

I installed it and loaded up a document to start doing a bit of work in it and the typing was extremely slow. I also noticed that the CPU usage shot up whenever I was typing. I tried the same on my desktop with the same results.

I did a bit of searching and it appears this is a known bug.

The only workaround I can find is to use the following command to run texmaker.

texmaker -graphicssystem raster
This seems to work but isn’t ideal. I would quite like to know what actually causes this. Of course there is every possibility that this will be gone in 9.10. I will find out soon when I upgrade but the Ubuntu server traffic is ridiculous today with it being the release day so I think I’ll leave it a while before I do any upgrades.

Get Nautilus Not To Show The Desktop

Posted on Oct 21 2009

I have been an avid user of fluxbox for many years as my window manager but one tool I particularly like from Gnome is nautilus. The only problem I had with it is that by default it deals with drawing the desktop when it loads so my background settings disappear and it loads the standard Gnome desktop icons by default which I don’t like.

This is easy enough to solve as you can just use the following when starting nautilus from a terminal:

nautilus --no-desktop
This stops the default desktop drawing behaviour. Obviously this isn’t ideal if you want to launch nautilus from a menu so you can use the following tool to set this to be the default behaviour.

gconf-editor
Load this app then go to apps->nautilus->preferences. In that section there is an option named ‘show_desktop’. Simply uncheck this and every time you launch nautilus in the future it will load without messing around with the desktop.

Expanding A Vmware Disk

Posted on Jun 16 2009

After trying to compile a new kernel in VMware I ran out of disk space and needed to resize the .vmdk disk. It is a fairly simple process and the following command does all the work for you if you:

vmware-vdiskmanager -x 12GB disk.vmdk
Obviously the new size of the disk can be set after the -x argument and the format for this can be found in vmware-diskmanager –help.

After this has been resized you will need to resize the partitions inside the VM. If you have a Linux Live CD to hand you can stick that in and boot up your VM. You need to be pretty quick and click inside the VM to be able to input commands ASAP. When you have done this hit escape in order to set the boot up sequence and tell it to boot from the CDROM.

When your live cd has fully booted load up gparted (or your own preferred choice of partition editors) and grow your main partition into the new free (unallocated) space. In my case I also had to delete the swap partition and move it but this will depend on each individual case.

After that is all done you should be able to reboot your VM with the new larger disk.

Linux Kernel Module And ndisc_get_neigh()

Posted on Jun 16 2009

I am currently looking at a way to get the MAC address of the next hop of a packet within a kernel module. I had previously made the silly assumption that this should be relatively simple. Of course that turns out not to be the case.

After browsing the kernel source I came across the following function in net/ndisc.h:

static inline struct neighbour * ndisc_get_neigh(struct net_device *dev, const struct in6_addr *addr)
This seemed perfect for what I wanted so I used it and got the following link error:

WARNING: "nd_tbl" [/path/to/source/np++.ko] undefined!
After a little digging I discovered that the list of neighbours (nd_tbl) stored by the kernel is not exported and therefore modules have no way to access it.

Since then I have tried a number of different approches (doing a rt6_lookup() and trying to obtain the MAC through that etc) but none of them have proved successful. The only glimmer of hope was that the sk_buff pointer I was being passed by the netfilter hook displayed the correct MAC address every now and again by using the skb->dst=>neighbour->ha variable. However most of the time it displays 33:33:00:00:00:01 for some reason.

I am going to continue digging around and see why it is not always being displayed properly through the sk_buff (I’m guessing this doesn’t always get properly set for some reason but considering it is 33:33:00:00:00:01 every time this is not a coincidence). If this method yields no results soon howver I think I will be left with the last resort option of having to supply a kernel patch with the NP++ code. This is a real pain as all the kernel patch will do is exprot the nd_tbl struct but it may have to be done.

If anyone knows of a workaround for this without patching the kernel I would love to hear it…

Running Scripts At Startup On Ubuntu

Posted on Jun 05 2009

With a lot of the boxes I set up I write at least one custom script that needs to be run at boot time to configure a bunch of stuff for one reason or another.

The scripts themselves are irrelevant but making sure they run when the machine boots is obviously important.

It is a simple process but I often forget the command so it’s going on here. Create the script you want to run and plonk it into /etc/init.d/.

Now make the script executable.

chmod +x /etc/init.d/script.sh
Now that is done you need to inform the system that you have a new script that you want to be run on startup. On Ubuntu this is done as follows.

update-rc.d script.sh defaults
The defaults argument puts a link to the scripts start procedure at run levels 2, 3, 4 and 5. It also puts a link to the scripts stop procedure at run levels 0, 1 and 6. For more information on how to configure this more finely look at man(8) update-rc.d.