#include <stdio.h>
int main( int argc, char* argv[] )
{
/* A Hello world example */
(void) printf( "Hello, World!\n" );
return 0;
}
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
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.
Have a look at the W3C Validation Service
Nanoblogger code plugin
Miek pointed me to a nice plugin for Nanoblogger called the Code Plugin
Some nice examples:
and
#!/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
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
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.
[Read More]
MySQL Backup
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
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 .
[Read More]
How I broke the triple-e and repaired it
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.
[Read More]
Portforwarding without IPtables
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
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,
<# (( EOF-36 )) will seek to 36 bytes before the end-of-file. You can apply this along with any redirection so that
cat < file <# (( 80 )) will cat the file starting from offset 80.
[Read More]
Eeepc battery script for 2.6.24 AND 2.6.25
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.
[Read More]