Skip to content

Home

How to display UTF-8 in your Putty bash shell

My girlfriend was having some problems displaying the correct characters while talking on IRC through irssi, and putty. Eventually I came to the conclusion that it wasn’t my server or irssi that was configured badly. Searching the internet I found this:

echo -ne 'e%Ge[?47he%Ge[?47l'

Simply put that into your .bash_profile or .bashrc and relog to your server. It’s a collection of terminal escape codes that together means ESC %G – “switch to UTF-8”.

Quake Wars and switchscreen

Still being thrilled about having gotten my 22” monitor, after 2 years of nagging (I need to emphasize that I’ve spent TWO years nagging my better half about a damn monitor. Did I mention I spent 2 years?), I briefly spoke to a co-worker of mine about having nothing to play after I quit World of Warcraft. He said that he’d heard about a game called Quake Wars, and that it had a Linux-client. So I took a look at it, downloaded the demo, and now I’m hooked! Not as much as before, but it’s fun nonetheless. Anyway – playing the game with a 1680×1050 monitor resolution is INSANE! I can just about feel a grenade blowing up in my face. We’re about 3 people at work planning on making a clan, so we just need a few more to make it work. And I am definitely going to buy the full game tomorrow! For more information about Quake Wars, take a look at http://community.enemyterritory.com/.

Right, that was that about Quake Wars. Now to my next subject – a nifty little program named switchscreen. A quote from the website:

switchscreen is a command-line utility that moves the X mouse cursor to a given point on a given screen. I wrote it because I could find no other program that can define both the mouse position and screen number.

In other words – you can use your keyboard to navigate between your two monitors instead of your mouse! I find it to be a wicked program that I just had to mention. ;)

Update: I forgot to mention yesterday (as I’m typing it’s the 29th) that I nearly got bald and (even more) nuts by not being able to find the “x-devel-” package for SuSe, being that we need libx.h to make switchscreen work. Just fire up YaST and search for xorg-x11-devel, and there you go!

Create a DVD with growisofs

#!/bin/sh

# Create an AUDIO_TS subdirectory if it does not exist
[ ! -d AUDIO_TS ] && mkdir AUDIO_TS

chown -R root:root AUDIO_TS VIDEO_TS
chmod 500 AUDIO_TS VIDEO_TS
chmod 400 VIDEO_TS/*

growisofs -dvd-compat -Z /dev/dvd -R -J -dvd-video .

Mount iso

mount -t iso9660 -o ro,loop=/dev/loop0 /var/tmp/some.iso /mnt/cdrom

encrypt

#!/usr/bin/perl

# Shows your encrypted password

print "Enter your password: ";
chomp($password = );
$salt = sprintf("%02x",($$^time^rand)&0xFF);
print "Your encrypted password is: ".crypt($password,$salt)."\n";

xsu

#!/bin/sh

# Program to run X-programs as root
# (when you get the "**WARNING** cannot open display" message)

su - -c "exec env DISPLAY='$DISPLAY'
XAUTHORITY='${XAUTHORITY-$HOME/.Xauthority}'
"'"$SHELL"'" -c '$*'"