Jaunty up and running
Posted on July 13, 2009
| 1 min
| 78 words
| Ton Kersten
Oke, that’s it. Ubuntu Jaunty up and running. After hardly two hours of
installing and configuring it’s done. I have Ubuntu up and running. With
zsh, Firefox 3.5, OpenOffice 3.1 (although I never use it), all the VPN
connections I need, TeX Live, Mutt, ext4, XFCE 4.6, Wifi, webcam and all
the things I forgot.
I didn’t need Google, hack it or whatever. Just configure it the way I
want. Out of the box, no problems.
[Read More]
Updated the Geek Code
Posted on June 5, 2009
| 1 min
| 58 words
| Ton Kersten
It was a long time ago that I created a Geek Code Block for myself. As I
aged this block aged with we, so it was about time I updated it.
Take a look at the about page to see the new code. I also added a
decoded version for those who do not like to decode stuff.
Adding repositories to OpenSolaris
Posted on May 16, 2009
| 1 min
| 102 words
| Ton Kersten
After a week of Prince2 and coming back to my old self again I started
my laptop in OpenSolaris. There where some minor things that needed to
be resolved. Trying to resolve these was not at all easy, because I
needed some extra software not available in the OpenSolaris repository.
Searching the web (Google is certainly your friend) I found some extra
repositories I could use. These can be easily installed using the
package manager, so I’ll give the URL’s only.
[Read More]
Donating blood 100 times
Posted on May 15, 2009
| 1 min
| 73 words
| Ton Kersten
Being a blood donor since 1982 I have been donating blood on a regular
basis. Today I reached the milestone, that I’m very happy about. I
donated blood 100 times. This equals 50 litres of blood in total.
I would like to urge you all: Please give. It doesn’t cost you
anything but a little time and you help a lot of people. So: Give
If you live in the Netherlands goto
Sanquin
Prince2 foundation exam
Posted on May 13, 2009
| 1 min
| 160 words
| Ton Kersten
The last 3 days were very hectic. I attended the course Prince2
Foundation which prepared me for the Prince2 exam. Three days of good
old, hardcore studying. I really felt like an old man, not a student. I
can hardly believe I did this for years non-stop and partied all the
time. I even get exhausted thinking about it. Those were really good
times, with very fond memories.
But all the hard work payed off. I did pass the exam (unofficially for
now) and I do now have a Prince2 Foundation qualification.
[Read More]
Installing OpenSolaris on my laptop
Posted on May 10, 2009
| 2 min
| 337 words
| Ton Kersten
My private laptop came delivered with Windows (of course), but I wanted
a UNIX/Linux like OS as well. Running a lot of computers with Linux
(Ubuntu, CentOS, Slackware, Debian and others) I decided I wanted
something else.
I came up with the idea that it should be Solaris, to experiment with
the fantastic ZFS. But the real Sun Solaris lacks support for my laptop,
so I thought I could run OpenSolaris, which has better hardware support.
[Read More]
sed breaks links
Posted on May 4, 2009
| 1 min
| 212 words
| Ton Kersten
When using the stream editor (sed) with the -i option, it does
break links. Like this:
~$ mkdir test
~$ cd test
~/test$ echo Hello > f1
~/test$ ln -s f1 f2
~/test$ ls -l
total 4
-rw-r--r-- 1 tonk tonk 6 May 4 09:28 f1
lrwxrwxrwx 1 tonk tonk 2 May 4 09:28 f2 -> f1
~/test$ sed -i.bck 's/Hello/Bello/' f2
~/test$ ls -l
total 8
-rw-r--r-- 1 tonk tonk 6 May 4 09:28 f1
-rw-r--r-- 1 tonk tonk 6 May 4 09:29 f2
lrwxrwxrwx 1 tonk tonk 2 May 4 09:28 f2.bck -> f1
~/test$ rm f2 f2.bck
~/test$ ln f1 f2
~/test$ ls -l
total 8
-rw-r--r-- 2 tonk tonk 6 May 4 09:28 f1
-rw-r--r-- 2 tonk tonk 6 May 4 09:28 f2
~/test$ sed -i.bck 's/Hello/Bello/' f2
~/test$ ls -l
total 12
-rw-r--r-- 2 tonk tonk 6 May 4 09:28 f1
-rw-r--r-- 1 tonk tonk 6 May 4 09:29 f2
-rw-r--r-- 2 tonk tonk 6 May 4 09:28 f2.bck
[Read More]
That bloody Shift-Backspace
Posted on April 24, 2009
| 2 min
| 239 words
| Ton Kersten
On my laptop I’m running Ubuntu Linux 8.04 with
XFCE 4.6 and it works great. But (Isn’t there
always a but'?) every once in a while I killed my Xsession with some
type of key combination. The standard combination for this is
`Ctrl-Alt-Backspace so I switched that off in the file
/etc/X11/xorg.conf'. I added the`ServerFlags`section, like this. ~ Section "ServerFlags" Option "DontZap" "on" EndSection ~ After restarting I tried the dreadful`Ctrl-Alt-Backspace
and I thought that `Bob’s your uncle'.
[Read More]
Hilbert's paradox of the Grand Hotel
Posted on April 22, 2009
| 1 min
| 73 words
| Ton Kersten
Last week I saw a documentary about the German mathematician
David Hilbert. This very
interesting documentary had some nice mathematical problems that seem
impossible to solve, but when thought through there always was a little
loophole.
If you are a bit into maths, this really is stuff to read.
Patches for IceWM online
Posted on April 15, 2009
| 1 min
| 109 words
| Ton Kersten
I’ve been using IceWM on and off for many years
now. And because we used it in our UNIX/Linux education environment I
did create some patches for IceWM. Some of these patches are now part of
the mainstream version and (of course) some are not.
My patch files can be found here.
These patches are mostly focused on window management such as (This list
is not complete): ~ + win_allowRestore + win_allowMove + win_allowSize
+ win_allowMaximize + win_allowMinimize + win_allowHide
win_allowRollup + win_allowRaise + win_allowLower + win_allowLayer
win_allowMoveto ~ and some are focused on system control (reboot and
family)
[Read More]
W3C Compliant
Posted on April 14, 2009
| 1 min
| 54 words
| Ton Kersten
I did take a lot of care to make this site W3C compliant, but a little
bug entered the code. This spoiled it and W3C give me 48 errors. Of
course that’s too much. A little debugging session showed the problem
and now I’m W3C again.
Nanoblogger code plugin
Posted on April 10, 2009
| 1 min
| 71 words
| Ton Kersten
#include <stdio.h>
int main( int argc, char* argv[] )
{
/* A Hello world example */
(void) printf( "Hello, World!\n" );
return 0;
}
#!/bin/bash
# A Hello world example
echo "Hello world"
If you want to cut and paste code examples, just go into `vi` and give it a
~~~ {.vim}
:%s/^[0-9]* //
Editing files and posting to git
Posted on April 9, 2009
| 2 min
| 249 words
| Ton Kersten
A couple of days ago I posted that I was converting to git. Well, that
was not the completely truth. I already had switched to git.
But what I didn’t like was the fact that git doesn’t support
keyword-expansion and therefore there’s no way of knowing what version
of the file you are editing. I do like this in CVS and SVN, so I
implemented it in a script called
vigit.
[Read More]
Version control with git
Posted on April 8, 2009
| 2 min
| 222 words
| Ton Kersten
Some time ago I decided it was time to change from subversion to git for
my version control system. The advantages where obvious. git is
distributed and so I can code on my laptop without being connected to my
home server. When I do get home I just sync the repositories and
everything’s OK.
But, how to do this. I took the easy road and created an user on my home
server and made sure I could login with SSH key authentication. After
that I did:
[Read More]
MySQL Backup
Posted on April 6, 2009
| 1 min
| 71 words
| Ton Kersten
When using a MySQL database, it’s often very useful to create backups of
the databases. This can be done with the MySQL dump command, but this
does not allow for separate week, month and year backups. On the web I
found the tool
automysqlbackup and
that did almost what I wanted. I changed it a lot and my version can be
found here or here.
The Header Script
Posted on April 2, 2009
| 2 min
| 257 words
| Ton Kersten
In my daily working routine I do create a lot of shell scripts, LaTeX
source and whatever. I always try to keep things simple and consistent.
This not always being easy, so I wrote a Perl program that generates a
standard template for a lot of standard code. This could be e.g. Bash
shell, Perl, RPM spec file, LaTeX source, C source, etc.
The only thing this program needs is Perl and a file in your home
directory called .name.info. This file should contain a tag and the
value on a single line. An example:
[Read More]
How I broke the triple-e and repaired it
Posted on October 19, 2008
| 2 min
| 268 words
| Ton Kersten
Last weekend I decided it was time again to completely update my eeePC.
So I ran the command tantrum everybody knows:
apt-get update
apt-get upgrade
and that gave me 287 new and updated packages.
After that I needed to reboot because I got a lot of new stuff.
Well, there the trouble began. No X, no network, no mouse, no USB etc.
It was in a terrible state.
Digging around and repairing the odd stuff, I got X running, but still
no mouse and no network. I thought that there had to be a general
problem, because it looked impossible that everything was broken without
some major hickup. Digging further and further I suddenly noticed that I
did have a lot of files with the name ending in dpkg-new. That gave me
the clou that these where new configs and new scripts that didn’t update
the original ones. why wasn’t clear, first get the thing up and running
again.
[Read More]
Portforwarding without IPtables
Posted on October 14, 2008
| 1 min
| 200 words
| Ton Kersten
Live’s good and the problem is simple. Having a Linux server at home
with two virtual machines running within VMware server, I would like to
have a tunnel to the host OS and forward ports for smtp, imap, rdp
and maybe some others.
I thought this could simply be solved with IPtables, but that turned out
to be a big pain in the *ss. It didn’t work as I wanted, I locked myself
out several times and still it didn’t do exactly as I wanted.
[Read More]
Seek in the Kornshell
Posted on September 16, 2008
| 1 min
| 117 words
| Ton Kersten
Searching for shell builtins to speedup Nanoblogger, we stumbled across
a very charming and nice way to implement a tail function in the
Kornshell.
This works in KSH93 and newer.
The new redirection operators, <# and ># are used to seek. For
example,
will seek to 36 bytes before the end-of-file. You can apply this along
with any redirection so that
[Read More]
Eeepc battery script for 2.6.24 AND 2.6.25
Posted on September 13, 2008
| 2 min
| 333 words
| Ton Kersten
The new kernel for the EeePC (2.6.25) has deprecated the
/proc/acpi/battery interface, so I had to write a new script for use
in my own zsh prompt.
The script will work in both 2.6.24 and 2.6.25, so without further
ado, here it is. It is written as a function for easy inclusion in any
prompts.
#!/bin/zsh
bat() {
PROC=/proc/acpi/battery/BAT0
SYS=/sys/class/power_supply/BAT0/uevent
STATE=
# dc: design capacity, rc: remaining capacity
if [ -f $PROC/info ]
then
STATE=$PROC/state # 2.6.24
dc=$(grep 'last full' < $PROC/info | awk '{ print $4 }')
rc=$(grep 'remaining' < $PROC/state | awk '{ print $3 }')
elif [ -f $SYS ]
then
STATE=$SYS # 2.6.25
dc=$(grep '\<power_SUPPLY_CHARGE_FULL\>' < $SYS | awk -F= '{ print $2 }')
rc=$(grep '\<power_SUPPLY_CHARGE_NOW\>' < $SYS | awk -F= '{ print $2 } ')
else
exit
fi
p=$(echo 3k $rc $dc / 100 \* p | dc )
if grep -iq discharging $STATE
then
printf " %02d" "$p"
else
if [ ${p%.*} -lt 100 ]; then
printf " %02d+" "$p"
fi
fi
}
bat
[Read More]