So, recently, I installed Ubuntu karmic cleanly on my main desktop machine here at home, and I have really liked it. I even switched to KDE, and everything has been working better than it had been in GNOME. I tried setting up Skype the other day, and ran into an issue with the microphone. It turns out that since the new Skype uses PulseAudio, there’s a further configuration step that’s not so obvious. I found out here that you have to do the following:
sudo apt-get install pavucontrol
pavucontrol
Then, go to the Input Devices tab, and unmute the sound (click the little speaker with a red X until the controls at the bottom are enabled). Then, change the Port setting until you can see the bars move when you tap the microphone. Then try Skype. This worked perfectly for me – it’s too bad it’s not connected to the KDE sound mixer, but oh well. Maybe in the future that will happen.
audio, karmic, kde, linux, microphone, pulseaudio, skype, sound, ubuntu
OOC is cool. Yesterday I started writing some code in it after reading about it on the github blog. Here is the first result:
I’m extremely happy with how well this performs. Using the latest ooc Java compiler from the github trunk to handle the each() functions, this compiles down to a bunch of C code, and then is automagically compiled behind the scenes into an ELF Binary! This is totally awesome, and I have to commend nddrylliog and the other contributors for their work on this awesome project. Now I should use it for something useful :D
A quick note about getting it running on Ubuntu:
sudo apt-get install sun-java6-jdk
git clone git://github.com/nddrylliog/ooc.git
cd ooc
JAVA_HOME=/usr/lib/jvm/java-6-sun/ make
At least, that’s how I did it. Then I compile all my ooc with a Makefile like this:
INPUTS=$(wildcard *.ooc)
TARGETS=$(patsubst %.ooc, %, $(INPUTS))
all: $(TARGETS)
%: %.ooc
java -jar ~/repos/ooc/bin/ooc.jar $@
That will compile all ooc files in the directory.
awesome, code, gist, github, irc, language, ooc
I used to use lirc with mplayer to allow my Packard Bell crappy remote to work awesomely, but I have since lost that configuration and switched to smplayer, since it’s awesome. Today, I figured out how to control smplayer using similar means.
Read more…
awesome, configuration, infrared, linux, lirc, mplayer, smplayer, ubuntu
It’s a sad day when a random one-hit wonder band who stole your name gets a higher page rank in Google than you do.

Poor Franz Ferdinand. I’ll bet he’s rolling in his grave. He should Black (back)Hand that band.
funny, google, history, image, music, terrible, wow
I was having a bunch of trouble today importing my old MySQL amarok database into the new nightly version of amarok I installed. The Amarok Wiki had a great section on how to convert a MySQL Amarok collection into an SQLlite one. This was the key to importing my old 1.4 collection into the new 2.2 nightly version of Amarok.
amarok, data, database, import, linux, music, processing, ubuntu
So, there I was, watching Firefox 3 thrash my CPU and IO, when I decided that I needed a replacement. Something elegant, fast, preferably threaded… oh! Google Chrome! So, I finally found a link to download the unstable version of the browser based on the latest revisions, of which I got version 4.0.213.1-r27053.
Now, I’ve used Chrome in Linux before, and a few things about Firefox kept me hooked. Today, though, I was on a mission to change all that. I wanted basically all the functionality I got from Firefox in my Chrome experience as well. This article should help others do the same.
Read more…
addons, chrome, customization, firefox, google, themes
This is possibly the best one-liner I’ve ever written:
gcc -x c -o /tmp/out - -lgmp <<< '#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <gmp.h>
void omg_i_love_leonardo_of_pisa(uint32_t num, mpz_t * result) { mpz_t retval, last, tmp; mpz_init(retval);
mpz_init(last); mpz_init(tmp); uint32_t i = 1; if(num == 0) return; mpz_set_ui(retval, 1U);
mpz_set_ui(last, 0U); for(; i < num; i++) { mpz_set(tmp, retval); mpz_add(retval, retval, last);
mpz_set(last, tmp); } mpz_set(*result, retval); } int main() { uint32_t num; mpz_t fibo; mpz_init(fibo);
omg_i_love_leonardo_of_pisa(1000001, &fibo); mpz_out_str(stdout, 10, fibo); printf("\n"); return 1; }
' && time /tmp/out
It compiles a C program given from STDIN, puts it in /tmp/out, and runs it with time to find the time it takes to run. It generates the 1,000,000th Fibonacci number. Try it!
awesome, bash, c, code, linux, one-liner, programming, shell
Postgres has the same type of ability MySQL has to read in files, yet much nicer syntax. LOAD DATA INFILE from MySQL is just COPY in postgres. I decided to try having it read from a named pipe today, and it worked out nicely.
Read more…
awesome, data, databases, dba, dump, postgres
There’s this site that has an equipment exchange I wanted to keep track of. Yet, it’s done with what seems to be a custom php file rather than vbulletin, so none of the usual RSS feeds from the site apply to it. So, I decided to make a scraper/feed-generator to get me the latest version every 5 minutes and generate a nice RSS feed, so I can view it in Google Reader. The volume of posting is low enough that this won’t be annoying to see in my daily feeds.
I usually use Ruby for this because it offers Hpricot, a very nice and fast scraper and XPath interface. This time, I resolved to find something that does RSS generation better, and I stumbled upon RubyRSS, which happens to be in the core ruby distribution!
Read more…
code, generation, gist, github, rss, ruby, rubyrss, scraping, web, xpath
I found out from this site that GPG can be used to generate random text for passwords. Here’s the command:
gpg --gen-random 1 20 | gpg --enarmor | sed -n 5p
Very simple. I may have to use this in the future.
WARNING
This limits you to the Base64 character set, greatly limiting the search space for password cracking. One should really use something other than enarmor to spit out a random printable ASCII string…
Update
OK, I did it. It took some time, but it works nicely now, and generates MUCH better passwords:
hank@tardis:/nexus/tardis/hank$ for i in 1 2 3 4; \
do gpg --gen-random 1 20 | \
perl -ne's/[\x00-\x20]/chr(ord($^N)+50)/ge;s/([\x7E-\xDB])/chr(ord($^N)-93)/ge;s/([\xDC-\xFF])/chr(ord($^N)-129)/ge;print $_, "\n"';
done
p8$K`frjdkp;i-c2]2a2
glj#""I/eY\aYe3p}2y@
U2cXL&2^2/@7P2d#;?E=
kG)|N?[ZP2t2'bH22e;$
I know that probably looks like gobbledy-gook, but the main part of it is this:
gpg --gen-random 1 20 | perl -ne'print "Your password: ";s/[\x00-\x20]/chr(ord($^N)+50)/ge;s/([\x7E-\xDB])/chr(ord($^N)-93)/ge;s/([\xDC-\xFF])/chr(ord($^N)-129)/ge;print $_, "\n"'
Run that in a terminal, and profit.
linux, passwords