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
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.
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
echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
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.
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
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 https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/699802 #24
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)
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.
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
find -type d | while read directory
for file in *.mkv
if mkvinfo "$file" | grep ompress > /dev/null
cut_len=$(($file_len - 4))
mkvmerge -o "$fixedfile" --compression -1:none "$file"
if mkvinfo $fixedfile | grep compression > /dev/null
echo "$fixedfile still has issues"
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.