To keep this short and simple, I hadn’t used my netbook for a couple of days and it turns out I had installed xbindkeys. Probably in a case to get a key working as a shortcut for something, but never getting beyond actually installing it and creating the default config as the program suggests by running xbindkeys –defaults > ~/.xbindkeysrc. This just happens to enable 3 default keybindings, one of which is Ctrl-F (!?) to open an xterm. It also grabs that shortcut, and it no longer does its usual task in the program you’re running.

It also ignores xkb keyboard layouts, so for me using dvorak that means my Ctrl-U shortcut just disappeared, no more delete line of text in terminal, yay!

Fortunately I worked out that my issue was with Ctrl-F and a google search for that and xterm keyboard shortcut lead me to a where some poor sob had also run into the issue, but had worked out that xbindkeys was the culprit.

I’ve filed a wishlist bug report on the Debian BTS, but I doubt they’ll see it as something worth fixing.

 

After a boring moment and coming across a little guide video on youtube that used Windows 7 with the rotating desktop wallpapers, I decided to see if I could make rotating wallpapers work in XFCE. A quick google search later and I came across this simple guide: http://www.linuxjournal.com/content/creating-slide-show-backgrounds-xfce

I only had to tweak the cron job line to stop the command output going to system mail every time it ran, and it all worked as expected.

My crontab line: */5 * * * * /usr/bin/xfdesktop –display=:0.0 –reload >/dev/null 2>&1

Another interesting way that doesn’t use cron is described here:

http://rockhopper.dk/linux/software/xfce/xfce-auto-rotate-wallpaper-without-cron/

 

If you have to install CentOS, or you just want to have a nosey, the best way to install it is using the Netinstall CD.

I followed this little guide: http://www.chrisgountanis.com/technical/45-centos-netinstall.html, and it worked out great.

I chose the raw base system install in the graphical installer. It downloaded about 400-500mb of data, installed the packages and after a quick reboot left me with a console screen in vmware, exactly what I wanted.

The only trick was to make sure I was pointing to the right folder in the mirror’s ftp/http directory.

 


When a member of an irc channel I lurk in talked about signing up to the Palm Developer forum this sparked my curiosity about the Palm Pre Developers Kit. So I had a little nosey around the Palm website to see if they had a Linux version of the SDK, which they do. Palm use virtualbox as the virtual machine which is easy to install as well as providing an Ubuntu package for the Pre image. While packaged for Ubuntu also installs with no trouble on Debian squeeze.

The last required package is novacom, the debug/control server required to control the Pre virtual image and let you install any applications you write for the Pre onto the virtual image. This package unfortunately takes advantage of Ubuntu using the Upstart init system instead of init.d as in Debian so does not install cleanly. One option you could take is to uncompress the package and manually install/run the novacom binaries. I chose however to write a simple replacement startup script for init.d, which hopefully is fully functional, and repackage it following this blog post:

http://binaryunit.blogspot.com/2008/01/dist-upgrade-goes-segmentation-fault.html

The Debian package starts novacomd with the init script exactly as the Palm package does using Upstart but also cleanly stops novacomd and should purge the init.d script when purging the config during package removal.

Grab the package here: palm-novacom_0.3-svn177284-hud9_debian_i386

Edit: This package badly fails Lintain and the packaging guidelines, I will try and clean that up and post a more clean package soon fingers crossed.

Edit: Fixed! Mostly ;)

 

As I have mentioned in other posts the ISP plan I have features a higher cost per GB than their regular pay as you go plan, but gives 75 gigabytes free transfer during the offpeak times of 2am-8am. This generally end up working out really well cost wise for me, but most of the traffic measuring tools measure on a day by day basis. Given my delirious state at the time, my previous little vnstat python script was appalling, and doesn’t even work. So here is the new improved version.

'''
VNStat Onpeak/Offpeak calculator
Author: Nameeater
Url: http://www.codemonkies.net/linux
Use: Calculates the data usage during Onpeak, 8am-2am,
     and Offpeak, 2am-8am, using vnstat.
'''
 
#! /usr/bin/env python
 
import os
import time
 
 
totalrx=0
totaltx=0
onpeakrx=0
onpeaktx=0
offpeakrx=0
offpeaktx=0
current_hour=time.localtime()[3]
hour_data=[]
 
vnstat=os.popen('vnstat --dumpdb')
data=vnstat.read()
 
for lines in data.split('\n'):
    if "h;" in lines:
        hour_data.append(lines)
 
for i in hour_data:
    h=i.split(';')
    if int(h[1]) > current_hour:
        break
    if int(h[1]) not in range(2,8):
        #debug print h[1], h[3], h[4]
        onpeakrx+=int(h[3])
        onpeaktx+=int(h[4])
    elif int(h[1]) in range(2,8):
        offpeakrx+=int(h[3])
        offpeaktx+=int(h[4])
 
print time.ctime()
print "-"*6
print "Offpeak Rx: ",offpeakrx/1024, "MB."
print "Offpeak Tx: ",offpeaktx/1024, "MB."
print "-"*6
print "Onpeak Rx: ",onpeakrx/1024, "MB."
print "Onpeak Tx: ",onpeaktx/1024, "MB."
print "-"*6
print "Total Onpeak: ", (onpeakrx+onpeaktx)/1024, "MB."
print "-"*6
 

You can either check if a variable has been defined through exceptions, such as:

try:
    myVariable
except NameError:
    print "myVariable has not been defined."

Or use the locals() and globals() functions to check if the variable has been defined in the matching scope.

if 'myVariable' in locals():
    print "myVariable has been defined."
 
if 'myVariable' in globals():
   print "myVariable has been defined."

This took a little searching to find, but I found the answer over at stackoverflow:

http://stackoverflow.com/questions/843277/python-checking-variable-existing.

 

Given my limited budget for broadband it was great news when my ISP offered a plan with free offpeak traffic up to 75 gigs a month. I already left my gateway server up overnight so it was easy to setup anything I may download as a scheduled download using the at command and a cron job to killall any application left downloading when the offpeak time ends at 8am.

One of the biggest thing I needed to download during offpeak was debian packages for my desktop, either for upgrade/dist-upgrade’s or installing sizable packages like OpenOffice.org. I needed to be able to download those packages on my gateway box, so I poked around with apt’s man page and came across –print-uris. This lead to the following little snippet to generate a file of url’s to point at wget or aria2 to download:

sudo apt-get -y --print-uris update | grep 'http://' | awk '{print $1}' | sed "s/'//g" > filename.txt

Note: I had to use –force-yes when running dist-upgrade on lenny.

 

A couple of years ago my family purchased a Canon MP150, a bog standard multifunction center. It was an impulse buy, so any concern that it may not work in Linux was easily brushed aside, especially since the rest of the family still heavily used Windows XP. And it didn’t work in Linux.

But with great fortune the gutenprint project now (well, really over a year ago, but after the initial searches I gave up looking) supports the Canon MP150 as well as a sizeable list of other Canon printers.

The OpenPrinting-gutenprint drivers in ubuntu do not yet have the Canon drivers so below is how I setup the Canon MP150 driver on Ubuntu Hardy.

Visit http://www.openprinting.org/show_printer.cgi?recnum=Canon-PIXMA_MP150 and download the package you need, rpm or deb, i386 or 64bit, depending on what distro and architechture you are running.

I downloaded the ‘x86 32 bit (DEB for LSB 3.2)’ package and installed it with dpkg:

sudo dpkg -i openprinting-gutenprint_5.2.2-1lsb3.2_i386.deb

The openprinting-guntenprint package installs with all the ppd files compressed with gunzip. I am not sure if this is how they are supposed to be, perhaps more current versions of cups/gnome printer config are able to use them compressed, but in hardy they couldn’t. Instead I uncompressed the driver I needed into the same folder and selected it in the gnome print config.

First find the driver you need in the openprinting-gutenprint driver folder, replace Canon with the folder of printer brand that you are looking for if it is not a Canon printer:

dean@subspace:/opt/OpenPrinting-Gutenprint/ppds/Canon$ ls | grep -i mp150
Canon-PIXMA_MP150-gutenprint.5.2-en.ppd.gz
Canon-PIXMA_MP150-gutenprint.5.2.sim-en.ppd.gz

Next, uncompress the two files with gunzip:

dean@subspace:/opt/OpenPrinting-Gutenprint/ppds/Canon$ sudo gunzip -d Canon-PIXMA_MP150-gutenprint.5.2.sim-en.ppd.gz
dean@subspace:/opt/OpenPrinting-Gutenprint/ppds/Canon$ sudo gunzip -d Canon-PIXMA_MP150-gutenprint.5.2-en.ppd.gz

Now plug the printer in and turn it on, and head to the gnome print config under System -> Administration -> Printing, click New Printer and hopefully it should be at least partially recognised as in the screenshot below.

In your case it may autodetect the driver, in my case it only found the Turboprint driver, ugh. Instead select the Provide PPD file radio button and click on the bar below it with the folder icon. Head to /opt/OpenPrinting-Gutenprint/ppds/Canon in the location bar, or click through the path and select Canon-PIXMA_MP150-gutenprint.5.2.sim-en.ppd, choose Open then Forward.

Give your printer a name, which will appear in any print dialogs for you to choose, and if you want to, describe it as well.

Click Apply and you’re now done! You should see your printer in the list and be able to print a test page, or even try printing documents in all your favourite Linux applications.

 

If you are looking for an easy to use python script to convert your m4b audio files into ogg files, head over to Robert Penz blog where he has a great script to do exactly that.

Robert Penz Blog – Python m4b to ogg conversion script.

Thanks to Robert for the great script, I used it on a sizeable audio book file and it worked great.

 

I ended up moving my debian vmware guest folder into another partition as its original partition was nearly full. This lead to VMware prompting me with a dialog asking if I had moved or copied the folder, hinting that I should say it that I had copied it if I wasn’t sure.

Problem was that when I started up the debian guest image the network interface had gone. After a quick google I came to realise that the reason VMWare asks if the image was moved or copied is because it gives new hardware ID’s and MAC address if you’ve copied the image so the id’s do not clash if you run both the original and copied image.

The fix is to delete the MAC address from the udev config file for the network interface and after a quick restart the new MAC address was detected and the network interface was back.

udev network config file:

/etc/udev/rules.d/z25_persistent-net.rules

Many thanks to fileformat blog at wordpress.com.

© 2012 Linux Sand Garden Suffusion theme by Sayontan Sinha