tmux

I was introduced to a very nice tool yesterday: tmux. It's very much like screen which I have been using for years, but actively developed and better. The quality of tmux's code was apparently enough to impress Theo de Raadt which is good enough for me! ;-)

  • Ctrl+b % (split screen vertically)
  • Ctrl+b " (split screen horizontally)
  • Ctrl+b left|right|up|down (navigate among sections)
  • Ctrl-b d (detatch, "tmux a" to reconnect

That's all the keys I need!

Debian console resolution

Console resolution can be set via GRUB 2 by adding the following 2 lines to "/etc/defaults/grub"

GRUB_GFXMODE=800x600
GRUB_GFXPAYLOAD_LINUX=keep

and then running "update-grub".

This changes the resolution of both the grub menu an the Linux console (tested on Debian Squeeze).

Dad's new website

My dad recently launched a website to publish some his linguistic research. :-)

I've already had the opportunity to listen to some of his lectures and they were pretty cool and surprisingly understandable, so it's great that some of his work is now available to a wider audience.

Grub2 passwords

GRUB 2 is a bit of a pain to configure, to put it mildly...

Here's how to set a password for a Windows menu option on a dual-boot system (tested on Debian with grub-pc 1.99-11):

1. Generate a password hash with "grub-mkpasswd-pbkdf2".

2. Create a new file "/etc/grub.d/01_auth" with the following contents (replace hash in "password_pbkdf2" with your own from step 1):

#!/bin/sh
cat <<EOF set superusers="admin" password_pbkdf2 admin grub.pbkdf2.sha512.10000.C97A...blah...0B6 EOF

3. Edit "/etc/grub.d/30_os-prober" and replace

menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os {

with

menuentry "${LONGNAME} (on ${DEVICE})" --class windows --class os --users admin {

4. Set the executable permission on this file with "chmod +x".

5. Run "update-grub" and reboot to test. You should now be prompted for credentials when you select the Windows menu item.

Fun times with Perl

A few days ago I 'discovered' Perl and I like it a lot. My job involves parsing a lot of log file data and Perl is my new friend.

It all started when I came across this excellent introduction and a few hours later I was slicing up log files left, right and centre. And looking at my scripts so far it doesn't seem to be that much more incomprehensible than my PHP code! :-)

I'm already missing the simplicity of PHP though - something as trivial as parsing a timestamp (using PHP's excellent datetime function) is not quite so trivial in Perl.