Posted by Brian @ 7:35 am on June 13th 2014

No sipping allowed?

20140613-082301.jpgIt appears that the slow food movement has yet to reach Yogyakarta.

Posted by Brian @ 8:30 am on September 28th 2013

A visit to the mines of Moria

20130928-191912.jpg

Ok not exactly. But I just visited the old
Roman cistern in Istanbul and wonder is this was the inspiration. It was beautiful and eerie. I kept an eye out for Orcs just to be sure. What would have (maybe) been cooler would have been how they used to do it – by boat!

Posted by Brian @ 11:20 pm on December 21st 2012

How to generate an SSL cert for Stunnel4

openssl req -new -x509 -days 365 -nodes -out stunnel.pem -keyout stunnel.pem

Copy the file to /etc/ssl/certs

Add or uncomment the following line in /etc/stunnel/stunnel4.conf:
cert = /etc/ssl/certs/stunnel.pem

Posted by Brian @ 4:22 pm on March 27th 2012

Beng Melea, Cambodia

My last visit to ruins on the trip turned out to be the best. Beng Melea is a semi-destroyed fortress from the early 11th century, about 65km from Angkor Wat. I scored a guide that took me inside, around, and on top of this magnificent site, to places that most tourists never take the time to explore.

20120327-143456.jpg

Posted by Brian @ 4:22 pm on March 27th 2012

Koh Ker, Cambodia

Today I visited the royal city of Koh Ker, abandoned in 944 A.D. It’s about 130km or more from Angkor Wat. I was the only one here at Prasat Pram. This was my favorite place there, where the trees seem to explode out of the top of these thousand year old temples.

20120327-122031.jpg

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.

/etc/modprobe.d/alsa-base.conf:
# 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
/etc/modprobe.d/iwlagn.conf:
options iwlagn bt_coex_active=0

Make sure proprietary radeon drivers are blocked
/etc/modprobe.d/blacklist-local.conf
blacklist fglrx

Optimize SSD (if you have an SSD that is):
/etc/fstab:
add noatime,discard to main drive
tmpfs /tmp tmpfs defaults,nosuid,size=1g,mode=1777 0 0
/etc/rc.local:
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 https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/699802 #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.

#!/bin/bash
#
# 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
#
start=`pwd`/
echo $start
find -type d | while read directory
do
cd "$start${directory#"./"}"
for file in *.mkv
do
if mkvinfo "$file" | grep ompress > /dev/null
then
file_length=${#file}
cut_len=$(($file_len - 4))
prefixedfile=${file:0:$cut_len}-fixed.mkv
fixedfile=${prefixedfile// /.}
mkvmerge -o "$fixedfile" --compression -1:none "$file"
if mkvinfo $fixedfile | grep compression > /dev/null
then
echo "$fixedfile still has issues"
exit
fi
fi
done
cd ..
done

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:

[QMYSQL]
Name=akonadi
......
StartServer=false

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.

Next Page