Wednesday, December 30, 2009

Wireless problems on karmic - no probe response, disassociating

Adding to the litany of problems I have experienced with Ubuntu Karmic, I have been having terrible wireless problems at home. I'm experiencing disassociations every couple of minutes:

[ 7647.936113] wlan0: no probe response from AP - disassociating
[ 7649.299667] wlan0: authenticate with AP
[ 7649.336162] wlan0: autheniticated
[ 7649.336170] wlan0: associate with AP
[ 7649.436184] wlan0: RX ReassocResp from AP
[ 7649.436192] wlan0: associated
[ 7688.948079] wlan0: no probe response from AP - disassociating
[ 7696.585236] wlan0: direct probe to AP try 1
[ 7696.648183] wlan0 direct probe responded
[ 7696.648192] wlan0: authenticate with AP
[ 7696.748181] wlan0: authenticated

Turns out it is a problem with ath9x in the kernel so it isn't canonical's fault.

Installing linux-backports-modules-2.6.31 seems to have fixed the problem.

Friday, December 18, 2009

Set mp3 track names based on filename

A quick and dirty script I used to set mp3 track names based on file name for a given directory. Uses python and the id3v2 tagging tool. I didn't bother with album, artist, genre etc. because you can already use id3v2 to set them en-masse.

#!/usr/bin/env python

import glob
import os.path
import os
import re
import sys

list = glob.glob(os.path.join(sys.argv[1],"*.mp3"))
for thisfile in list:
track = re.sub("^[0-9]+(\s|\.|\-)+","",os.path.basename(thisfile))
track = track.replace(".mp3","")
print("/usr/bin/id3v2 -t \"%s\" \"%s\"" % (track,thisfile))
os.system("/usr/bin/id3v2 -t \"%s\" \"%s\"" % (track,thisfile))