Posted by Brian @ 7:03 am on March 18th 2012

Things I did to fix my HP DV7 in Ubuntu

I have an HP dv7-6b78us laptop, which is fairly decent. Here’s a list of the things I had to do in order to get it to work properly in Ubuntu 11.10 64bit:

add to rc.local:
modprobe -r psmouse
modprobe radeon
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
exit 0

The first line in the above turns off the touchpad, which I never use. If I needed to use it I could:
sudo modprobe psmouse
The second line loads the open source ATI Radeon driver, the third line turns off the ATI card so it doesn’t suck power. The Intel graphics card is plenty powerful for my needs.

set brightness:
echo 2000 | sudo tee /sys/class/backlight/intel_backlight/brightness
The brightness keys don’t work. I haven’t yet assigned a command to the right keys but I’ll update this when I do. Replace 2000 with a value you want; look at /sys/class/backlight/intel_backlight/max_brightness for the max value.

# fix mic on dv7
options snd-hda-intel model=dell-s14 power_save=0 power_save_controller=N
(enable subwoofer but break mic:options snd-hda-intel model=ref)
#Fix dropping networking on resume from suspend
options iwlagn bt_coex_active=0

Make sure proprietary radeon drivers are blocked
blacklist fglrx

Optimize SSD (if you have an SSD that is):
add noatime,discard to main drive
tmpfs /tmp tmpfs defaults,nosuid,size=1g,mode=1777 0 0
echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch

Fix video mode error on boot:
sudo chmod a-x /etc/grub.d/05_debian_theme
also #24

Posted by Brian @ 8:48 am on September 13th 2011

Fixing the svn txn-current-lock Permission denied error in Subversion

I was setting up a new subversion repo recently in Ubuntu. I was able to check out files but when I tried a commit I hit this error:
svn: Can't open file '/var/svn/foo/db/txn-current-lock': Permission denied

So it was obviously a permissions issue, and here’s what the permissions looked like on that file:

-rwxr----- 1 root svn 0 Aug 12 18:00 txn-current-lock

Oops – I could only read but not write that file. Looking further it turns out the entire repo only had root write permissions, even though it was owned by the ‘svn’ group – I’m not sure how that happened, possibly a stupid mistake on my part. I had already set up a ‘svn’ group and added the users I wanted to have access to the repo to the ‘svn’ group, so I just had to make the repo writable by the group.

The fix was simple:
sudo chmod -R g+w /var/svn/foo/*
(where foo is the name of the repo)

Posted by Brian @ 9:22 am on September 9th 2011

Slugs for dinner in Edinburgh?

I was wandering near my hotel in Edinburgh the other day, and being somewhat esurient, was on the lookout for vittles. I chanced across this appallingly bad name for a restaurant. I wasn’t able to determine if this was a local delicacy. Unfortunately they were closed or I’d have gotten a better picture.

Posted by Brian @ 12:45 pm on August 14th 2011

Remove audio compression from all .mkv videos, including subdirectories

A while back I wrote about audio compression causing a black screen of death on my WD TV HD player with a one-line fix to the problem.

I have an improved solution. I wrote a quick BASH script that scans all the videos it finds in the Matroska (.mkv) format in the current directory as well as any subdirectories it finds, removing all compression from .mkvs it finds and saving a new mkv with “fixed” appended to the filename.

# This script will traverse all subdirectories looking for Matroska (.mkv) files
# When an .mkv file is found, it will be checked for compression
# If compression is found, create a new file without compression with "-fixed" added to name
# (e.g. badmovie.mkv -> badmovie-fixed.mkv)
# Run from the root directory that you want to begin scanning from (e.g. /home/foo/Videos or /media/USBdrive)
# 1/22/2012 v2
# better handling for files with spaces; removes all compression, not just track 1
# remove the need for a command line parameter
echo $start
find -type d | while read directory
cd "$start${directory#"./"}"
for file in *.mkv
if mkvinfo "$file" | grep ompress > /dev/null
cut_len=$(($file_len - 4))
fixedfile=${prefixedfile// /.}
mkvmerge -o "$fixedfile" --compression -1:none "$file"
if mkvinfo $fixedfile | grep compression > /dev/null
echo "$fixedfile still has issues"
cd ..

Note, I edited this post on 1/22/12 with the current version of this script which handles filenames with spaces and removes all compression, not just the first track.

Posted by Brian @ 12:15 pm on May 7th 2011

Completely disabling Akonadi in Kubuntu 11.04

Akonadi is a storage service that certain KDE programs use heavily. I only use the KDE windowing environment and I don’t use any of the applications in KDE, so akonadi was just wasting RAM and potentially CPU.

So to disable it, set StartServer=false in .config/akonadi/akonadiserverrc:


It might still load if you use KDE-dependent apps, or it might cause your system to blow up. But that should do the trick.

Posted by Brian @ 11:45 am on March 27th 2011

Fix the black screen of death playing x264/h.264 mkvs on WD TV HD player

I have a Western Digital WD TV HD media player that I really like, even though it was quickly orphaned by Western Digital as a product. Maybe someday we’ll have legislation that requires a corporation to provide a guaranteed time of product support, including software updates and bug fixes.

Anyway, once in a while the WD refuses to play a video in the Matroska “mkv” format, particularly those using the H.264 codec encoded with the mkvmerge utility. When this happens the WD basically shows a black screen and more or less locks up. Once that happens on the WD you can only eject the HD and reboot.

The fix for this is to remove video compression on the mkv in question, which sounds daunting but really is only a one-line command that takes a couple of minutes to execute and doesn’t change the quality of the video. You need the mkvmerge program which is part of the mkvtoolnix package in Ubuntu. mkvtoolnix is also available for Windows if you’re stuck there.

Here’s the command:
mkvmerge -o output.mkv --compression -1:none input.mkv

Where input.mkv is your original file and output is the fixed file.
(Edited: I changed the command to remove /all/ compression in an mkv)

Posted by Brian @ 6:08 pm on March 7th 2011

After searching many years

My quest to find the lost city of snacks is finally at an end.

Posted by Brian @ 9:01 pm on February 23rd 2011

Batch convert all ape files to mp3 in Ubuntu

More reasons to love Linux:
for f in *.ape; do ffmpeg -i "$f" "${f%.ape}.mp3"; done

edit for Ubuntu 14.04:
for f in *.ape; do avconv -i "$f" "${f%.ape}.mp3"; done


Posted by Brian @ 7:04 pm on January 22nd 2011

Bad doggie

Posted by Brian @ 6:45 pm on January 22nd 2011

Unexpected sight on the road

Driving in heavy rain the other day I did a double take as I saw this emerge from the mist.

Previous PageNext Page