Groesbeek, view of the 'National Liberation Museum 1944-1945' in Groesbeek. © Ton Kersten
Fork me on GitHub
Archive for June 2012

What the *F*

2012-06-29 (118) by Ton Kersten, tagged as blog, spam

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.com)

They are sending me spam!!!!

Maybe it's about time I do a mail server hardening consultancy job smiley

New header

2012-06-28 (117) by Ton Kersten, tagged as code, linux

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.

sed tips and tricks

2012-06-22 (116) by Ton Kersten, tagged as code, linux, sysadm

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. Of course this should be done with sed, because the whole generation process is written in bash. When playing around with sed I found

sed '/./,$!d' filename

which, I think, is genius in it's simplicity. After you find something, do not remove. Life in UNIX and Linux is nice!

Read more »

Puppet updates

2012-06-18 (115) by Ton Kersten, tagged as code, puppet, sysadm

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; ../bin/gendoc'

update_git

#!/bin/bash
# update_git
su - puppet -c 'cd /etc/puppet; git pull; cd doc; ../bin/gendoc'

But, of course, it's not handy to type update_git today and update_svn tomorrow. And I also don't want a path to /etc/puppet/bin.

The solution is a very simple one, as always:

cd /usr/local/bin
ln -s /etc/puppet/bin/update_git pupdate

and now I only have to type pupdate and things work out.

Fix a lot of rights

2012-06-18 (114) by Ton Kersten, tagged as linux, sysadm

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.sh

produces output like this

chmod 644       -- "/etc/sysconfig/kdump"
chown root:root -- "/etc/sysconfig/kdump"
chmod 644       -- "/etc/sysconfig/rhn/sources"
chown root:root -- "/etc/sysconfig/rhn/sources"
chmod 644       -- "/etc/sysconfig/rhn/sources.rpmforge.txt"
chown root:root -- "/etc/sysconfig/rhn/sources.rpmforge.txt"

Running this script on the broken server left us with something that was working.

Running

dpkg -x <package name>

on all cached packages in /var/cache and after that a

dpkg --reconfigure -a

Solved the rest.

Pheeeuuwww, we were lucky smiley

World IPv6 day

2012-06-06 (113) by Ton Kersten, tagged as ipv6

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 smiley.

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!