rsync on a not standard port

Today a colleague asked me to sync some files to a server that is not listening on SSH port 22. I normally create a configuration entry in my ~/.ssh/config file, like Host tosync Hostname syncer.example.com Port 1234 User syncuser and then command rsync -va --progress --inplace . tosync: But this time I didn’t want to create the entry in my SSH configuration, because I need this trick in a script. So I started to read the rsync manpage and after some experimenting I found [Read More]

Ansible issue playbook

Playing with Ansible I did get the idea to make a nice welcome message when you log in to a server. This message needs to be placed in a file, which is configured in /etc/ssh/sshd_config with the banner option. I call this file /etc/issue.

[Read More]

Ode to the Haggis

Hendrik Jan Thomassen not only sent me the tail of Haggis hunting but also a nice ancient poem as an ode to Haggis. Here it is: The haggis season has begun and all over Scotland every gun Is taken down with loving care Though some prefer the haggis snare The haggis are a wiley lot That’s why they are so seldom shot Then hidden in the highland heather Great hairy Clansmen crouch together [Read More]
humor 

How to hunt the Haggis

Most people are familiar with my love of Scotland, single malt and (of course) haggis. But most people do not have a clue what haggis is and when you tell them, they walk out in disgust. But a colleague of mine found out that haggis is just an animal that can be hunted in the Scottish Highlands. This is how it’s done: …..asked me how the haggis were hunted so I explained that there were two types of haggis, who, because they lived on the steep slopes of the Scottish Highlands, developed legs of different lengths on their left and right sides depending upon which way they travelled round the mountain to graze. [Read More]
humor 

Resize a partition

I often have to increase the size of a virtual disk on a virtual machine. But I always seem to forget how to do it. I guess I have done it over a 100 times and I cannot remember exactly how I did it. So this blog entry is to help people on how to do this and as a reminder to myself. This example is done on a virtual machine with CentOS 6, but it can be done on every Linux. [Read More]
sysadm 

MySQL backup error

After upgrading my MySQL database server from version 5.0.95 to 5.1.61 I suddenly got these errors in the backup logging. mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `EVENTS`': Cannot proceed because system tables used by Event Scheduler were found damaged at server start (1577) dbdump gave errorcode 2 for database 'information_schema' 2012-08-09 09:07:53 -> Finished MySQL backup on host 'xxx.tonkersten.com' Hmm, no idea what has happened. I hope I didn’t do something stupid. [Read More]
mysql  linux 

CDE is Open Source

Today the classic, and old, Common Desktop Environment (a.k.a. CDE) was released into the Open Source world.

You can get the very alpha version at SourceForge.

I haven’t been able to get a running version by now, but I keep trying.

Good job, guys.

linux  code  news 

git status in the prompt

Working with git a lot I decided I needed some git status in my prompt. I searched the web and some solutions where almost what I wanted and this one by Sebastian Celis came very close. But it didn’t work with my version of zsh, because that didn’t seem to understand the =~ operator. I also think Sebastian makes things over complicated and so I changed some things aroud. This is what I came up with: [Read More]
git  sysadm  code  linux 

No network on CentOS 6

When installing a minimal CentOS 6 system, minimal really, really means minimal. After a reboot the network interfaces do not start, so network connectivity is non existing. Looking into that I noticed that the file /etc/sysconfig/network-scripts/ifcfg-eth0 contained DEVICE=eth0 HWADDR=11:22:33:44:55:66 NM_CONTROLLED=yes ONBOOT=no BOOTPROTO=dhcp TYPE=Ethernet USERCTL=no PEERDNS=yes IPV6INIT=no The lines that mess things up are NM_CONTROLLED=yes meaning the interfaces are managed with NetworkManager, which isn’t actually installed as part of a minimal install. [Read More]

New version of We-Blog

Today I released version 0.8 of We-Blog. I created a Google project and a Google discussion group. Version 0.8 is now the stable branch and 0.9 the development branch. What’s new? Well, to be really honest, not that much. I fixed some minor bugs and did a lot of code cleanup. Although the original code of Jaromir was very nice, there was some room for improvement. I removed a lot of double functions and variables and put them all together in a We. [Read More]
blog  code 

Finding key codes on Linux

It often happens that I get into a situation where I need to know key codes of pressed keys. On my Mac that’s simple. Just use the Key Codes by Many Tricks. But on Linux I constantly was trying to find out which key produced what. So I ended up writing a program for that. I started of in the shell, but that ended up being rather tricky and unnecessary complicated. [Read More]
code  linux  sysadm 

Shell tip

During one of my teaching sessions a student asked me if it was possible to find the number of spaces in a variable. As with all questions in Linux and UNIX the answer is a simple Of course that’s possible. In UNIX and Linux everything is possible. With some sed or awk this can be done within seconds. But I wanted it done completely within the shell, in this case bash. [Read More]
code  linux  sysadm 

Burning VIDEO_TS on OSX

I was trying to burn a folder with a VIDEO_TS directory onto a DVD. But in a way that it will start in a normal DVD player as well as starting automagically. And this all had to be done on Apple’s OSX. I googled a little and tried some things and this is what I can up with: hdiutil makehybrid -udf \ -udf-volume-name DVD_NAME \ -o MY_DVD.iso \ /path/to/VIDEO_TS/parent/folder Make sure that /path/to/VIDEO_TS/parent/folder is the path to the folder containing the VIDEO_TS folder, not the VIDEO_TS folder itself. [Read More]

What the *F*

I’m registered as a Computable expert and as required I do have a profile page on their website. And now I get this (partially in Dutch): Beste Ton Kersten, Via je profielpagina op Computable.nl stuurt gift d evals je onderstaand bericht. Met vriendelijke groet, Redactie Computable Contact me with this email giftevals@yahoo.com Hello am Gift i am 23 years old single. After seen your profile i became interested in you,so i decide to write you for us to build a good relationship if you don’t mind,you can email me but (giftevals@yahoo. [Read More]
blog  spam 

New header

Today I’ve posted a new version of the header program.

Nothing really fancy happened, just added support for zonefiles, in this case the Bind ones.

It’s available at the usual places.

code  linux 

sed tips and tricks

I’m creating a Puppet Starter Kit with some standard manifests included and a complete set of documentation. All documentation should be written in Markdown and will be served by Markdoc. But I want to generate all Markdown files from the Puppet manifests, so I only need to document the manifest file. Generating the Markdown is not that difficult, except that I kept ending up with empty lines at the top of the manifest code and I wanted to get rid of those. [Read More]
sysadm  linux  code 

Fix a lot of rights

A customer called and wanted help with an error they made. The error was simple, they typed: chmod -R 660 / and now things broke. Of course things broke. If they would not brake that would be very weird. Luckily they had a second server and a simple one-liner stole all the rights from this second server and and we could put these on the broken one. The oneliner find / -depth -printf 'chmod %m\t\t-- "%p"\nchown %u:%g\t-- "%p"\n' > rights. [Read More]

Puppet updates

When working with Puppet and a VCS (like git and SVN) it’s nice to have a simple way of updating the Puppet tree. My tree is always in /etc/puppet and owned by user and group puppet. User puppet is allowed to checkout the complete tree from git or subversion. I have created two one-liners to update the complete tree and make sure all rights are still correct. update_svn #!/bin/bash # update_svn su - puppet -c 'cd /etc/puppet; svn up; cd doc; . [Read More]

World IPv6 day

Today is world IPv6 day. So come on you all and make your things IPv6 aware and working. If Google can do it, you surely can as well ;-).

This site is available through IPv6 a long time already and can be reached at

2001:470:1f15:980::1

Join, and that’s an order!

IPv6 

Updated Pygments

I’m using Pygments for quite some time now and I just noticed there was a new version available (1.5). I installed that and I was wondering if there would be a lexer included for Puppet. Well, it wasn’t, but a short Google action directed me to the Pygments lexer for the Puppet DSL. Of course my old CentOS 5 system with Python 2.6 doesn’t want to install this, so I hacked the Puppet lexer into Pygments. [Read More]

pdfPres package created

To present PDF slides on Linux I use pdfPres. But when I want to use this on OS X Lion, this doesn’t work. So I created an OS X Lion package for pdfPres.

This is only tested on OS X Lion and it does require XQuartz.

Please, download the pdfPres package and test it.

MySQL database replication

This week I was asked to setup a system with a single MySQL master server and a couple of slave servers. I have done that before, so there is no problem. The problem is that I do not do that on a daily basis, so I need to check the commands every time I set it up. So, as a note to myself I describe how to setup a single MySQL master with multiple slaves. [Read More]
mysql 

Twitter from the console

Since a couple of days I’m also on Twitter. I tried to avoid it for a while, but I wanted to follow some people, so it was about time I started to Twitter as well. As you can imagine, no graphics for me. It turned out that wasn’t as easy as I hoped. Some of the Twitter command line tools did not work or where that old that they even didn’t compile. [Read More]

Strange question

In the last couple of weeks I’ve been teaching a course for shell-script starters.

When I was explaining $@ and $* and the difference between these two a student asked me:

Does the @ have anything to do with the fact that we are talking about an indirect linked list of command parameters?

WTF?

Unfortunately I couldn’t answer the question, because I don’t have any idea what he’s talking about.

Working on We-Blog

At the moment I’m working on We-Blog. I added an ‘alt’ tag to pages. The defined text will be shown on ‘mouse-over’ when you hover over the page link.

This is part of We-Blog 0.8. This release is not stable yet, but the current code is already on GitHub.

blog