1liner

How to loop mount image files with several partitions

Image files for embedded devices often have several partitions in them. To loop mount them locally we have to calculate the offset of the partition within the image. Here we go:

Deleting all x32 packages from a x64 CentOS/Fedora

The x64 flavors of CentOS and Fedora linux always install compatibility packages for x32 apps. Which is quite annoying on a server! This is how you get rid of them:

rpm -e `rpm -qa --qf "%{name}.%{arch}\n" | egrep "\.i[36]86$" | while read p ; do echo -n "$p "; done`

Hua!

Mirror your famous youtube movies

Useful:

youtube-dl -o ikea.flv "http://youtube.com/watch?v=0hKIt1r2FOI"
mplayer ikea.flv

DNS debugging

This shows all details of a non-recursive DNS request (forward and reverse), including delegations and additional answers like glue records:

$ dig -t A +trace marge.fargonauten.de. +all
$ dig -t PTR +trace 100.215.114.217.in-addr.arpa. +all

Very handy in case of broken zones. Use tcpdump to see more details ;-)

Erfinde und setze, 2

Ich vergess es immer wieder, diesmal schreib ich's mir auf: Ersetze in allen Konfigurationsdateien für eth0-Aliase "ONBOOT=yes" durch "ONBOOT=no"

for file in /etc/sysconfig/network-scripts/ifcfg-eth0\:* ; do
sed -i -e /ONBOOT=/s/yes/no/ $file ;
done

(Erster Teil)

Setzen und erfinden

Aus beispielen kann ich besser lernen als aus man pages, daher hat mich diese sammlung von sed-1linern begeistert!

1liner: Find authorative NS according to WHOIS

This finds the authorative nameservers for com/net/org/de domains according to WHOIS:

whois takatukaland.de \
 | egrep "^ *N(s|ame S)erver: *[[:alnum:]]" \
 | sed -e 's/^.*erver: *//'

Useful when migrating nameservers.

Inhalt abgleichen