René’s old blog
-
Emacs wiki
I just stumbled upon http://www.emacswiki.org/cgi-bin/wiki/SiteMap, which looks like a very nice place. I found a newer version of longlines.el, for example.
-
Converting AAC audio files to mp3
This command will convert an AAC audio file to an mp3 audio file: ffmpeg -i input.m4a -acodec mp3 -ac 2 -ab 128 output.mp3
Batch conversion can be done with for i in *.m4a; do ffmpeg -i “$i” -acodec mp3 -ac 2 -ab 128 “${i%m4a}mp3”; done
-
Longest Common Prefix in perl
I can’t help finding this slightly elegant. Unfortunately I no longer remember where the idea came from. #!/usr/bin/perl use strict; use warnings; sub longest_common_prefix { my $prefix = shift; for (@_) { chop $prefix while (! /^$prefix/); } return $prefix; } print longest_common_prefix(@ARGV), ” “;
-
Xterm and the clipboard
It has long been an annoyance that xterm doesn’t follow the same rules with regard to the clipboard as most GTK/Gnome applications. Xterm by default only uses the PRIMARY selection for copy and paste, and follows the implicit selection model where the selection is set immediately when text is selected with the mouse, without any further action from the user. Most GTK/Gnome applications uses both an implicit selection model with the PRIMARY selection, and an explicit selection model with the CLIPBOARD selection. I don’t know of any way to get xterm to behave like most other applications, but this little set of X ressources will enable the use of the CLIPBOARD selection in xterm, when the Shift key is down. XTerm*VT100.Translations: #override Shift
: select-start() Shift : select-extend() Shift : select-end(CLIPBOARD) Shift : insert-selection(CLIPBOARD) Shift : start-extend() Shift : select-extend() Shift : select-end(CLIPBOARD) -
With GNU Emacs you can always learn
It is close to twenty years that I have been using GNU Emacs almost daily, and you still figure out new stuff. I’ve been somewhat annoyed that copying and pasting between Emacs and Gnome applications were so inconsistent, and then its all in the manual: Using the Clipboard As well as the primary and secondary selection types, X supports a “clipboard” selection type which is used by some applications, particularly under OpenWindows and Gnome. The command `M-x menu-bar-enable-clipboard’ makes the `Cut’, `Paste’ and `Copy’ menu items, as well as the keys of the same names, all use the clipboard. You can customize the option `x-select-enable-clipboard’ to make the Emacs yank functions consult the clipboard before the primary selection, and to make the kill functions to store in the clipboard as well as the primary selection. Otherwise they do not access the clipboard at all. Using the clipboard is the default on MS-Windows, unlike most systems.
-
irctail – track a file on an irc channel
Irctail is a small program I wrote to keep track of log files on various servers through an IRC channel. It will track stdin or a given file (like tail -f), and send the lines to an IRC channel. There are options to specify irc server, channel, nick and some more. An example: irctail -c […]
-
Labels on ext2 and ext3 filesystems
I just recently discovered that you can put a label on an ext2 or an ext3 filesystem, just like you can with a msdos/fat filesystem. The reason I didn’t know was probably that it didn’t matter, but now with hal and gnome-volume-manager automounting removable disks, the disks in my usb enclosures are mounted as /media/usbdisk, […]
-
D-Link DI-704P router
I recently bought a D-Link DI-704P router with the intent of using it as a first line of defense in front of a Linux server I have on a public IP. The basic stuff is working as expected, mostly “virtual servers” or “port forwarding” which is used to allow access to the select services I […]
-
Vmware and tmpfs
With the installation of udev a tmpfs file system is mounted on top of /dev at boot. Device nodes are created automatically by udev as the devices appear, but in the case of vmware it doesn’t work. Vmware needs some device nodes that are created when vmware is configured, so they aren’t there when /dev […]
-
Resampling audio data
I’ve never done much with audio data, so when I had to write some audio files to cd, and they weren’t sampled at the right rate, I had a problem. Fortunately, I found sox: sox input.wav -r 44100 output.wav resample did the job. And I tought it was going to be difficult 🙂
-
Mozilla Thunderbird and the order of accounts
It has long annoyed me that I couldn’t control the order my mail accounts are listed in the left pane in Mozilla Thunderbird. In the end I decided to just edit my ~/.mozilla-thunderbird/default.xxx/prefs.js file to get it right, and after several unsuccessful attempts I found out how easy it is. Open your prefs.js file in […]
-
I love my internet connection
I have my internet connection through a community network called Bryggenet, which serves a part of Copenhagen with internet, cable and telephony services. The connection is a shared 62Mbit/s line, brought to my house through a 100Mbit/s network 25 september 2004, 09:50 $ apt-get update Fetched 9470kB in 3s (2420kB/s) $ apt-get dist-upgrade Need to get 95.8MB of archives. Fetched 95.8MB in 17s (5453kB/s)
Ups, I forgot to mention the price of this connection: $25/month, flat fee. 10 oktober 2004, 18:00 $ apt-get update Fetched 9491kB in 3s (2499kB/s) $ apt-get dist-upgrade Need to get 62.4MB of archives. Fetched 62.4MB in 13s (4625kB/s)