Installing Pandoc

John Macfarlane released a new version of Pandoc that has a lot of new enhancements. A lot of things have changed in the Markdown input types and it’s now compatible with PHP Markdown. This is very nice, because a lot of implementations use the extensions defined by PHP Markdown. I downloaded the dmg file to install it on my MacBook Pro and it works like a charm. So, I decided to install it on my new CentOS 6 server to build documents there. [Read More]

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 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]

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 '' 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]

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 

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]

Updated to Linux 3.0

I have a eeePC 900 (the 9" version) running Arch Linux for some time now. I didn’t update it for a while, so, today being a rainy Sunday, I decided it was time to do it. So, I typed: pacman -Syu and waited for about half an hour. And look what I got Linux eeetje 3.0-ARCH Everything is running nice and smooth, so I’m very happy. Can’t wait to get my hands on Linux 3. [Read More]

umask per directory

Some users insist on using bash. This is a good shell, but not as good as zsh. But, I do want them to be able to use the per directory umask as well as all the zsh users. So I started digging, as the bash shell does not support a chpwd hook. This is what I came up with: chpwd() { # Set the initial umask case "${PWD}/" in /etc/puppet/*) um=$(umask) umask 007 ;; *) [[ x"${um}" ! [Read More]