Posts mit dem Label en werden angezeigt. Alle Posts anzeigen
Posts mit dem Label en werden angezeigt. Alle Posts anzeigen

Freitag, 28. Mai 2010

How to disable AAAA queries for IPv6 / configure your resolver

Today I stumbled upon a very nasty behaviour of glibc - again.

On a host which has no access to IPv6 at all and no module-support in the kernel, it seems the connect() call fails when there is a AAAA record in place for a remote server.

This means I cannot wget a webpage if an AAAA record exists for the page, etc.

You will find many solutions on how to 'disable IPv6' - but they all miss the resolver in glibc, the part that is behind the 'gethostbyname' call.

I like to disable AAAA DNS-queries for IPv6 completely - and the solution is easy:

#cat /etc/resolv.conf 
options no-inet6
nameserver ...
nameserver ...

Just documenting it here, because the manpage does not document the 'no'-Feature and searching for this on google was not helpful at all.

Freitag, 8. Mai 2009

obfuscated bash contest...

Guess what this (bash) one-liner does:

bc <<< `tar -c /tmp/a /tmp/b  2>/dev/null | xxd | \
awk '{print $10}' | tr -d '\n' | \
sed -n 's|^.*[0-9]\{7\}\.[0-9]\{7\}\.[0-9]\{7\}\.000000\
00000\.\(.*\)\.[0-9]\{6\}.*[0-9]\{7\}\.[0-9]\{7\}\.[0-9]\{7\}\.000000\
00000\.\([0-9]\{11\}\)\.[0-9]\{6\}.*$|\1 - \2|p' `
In my case it just printed -5... ;o)

Samstag, 22. November 2008

The superfluous first post


   Blog myblog = com.blogger.createBlog("superfluousandsparse");
   Post firstpost=new BlogPost();
   firstpost.setTitle("The superfluous first post");
   //TODO: Fix the recursion....
   firstblog.setContent("Blog myblog = com.blogger.createBlog(\"superfluousand....");
   myblog.publish(firstpost);