Using less with syntax highlight

You can use vim as your pager and obtain two benefits: syntax highlight and access to all the advanced commands (like search). You can do this under ubuntu by adding the following line to your ~/.bashrc:

alias less='/usr/share/vim/vimcurrent/macros/less.sh'

Note:

  • You have to have ...
more ...

Quick’n’dirty Mediawiki file crawler

URL='http://10.0.0.1' MIME='image/jpeg'   
 bash -c 'wget -q -O - "$URL/wiki/index.php?title=Special:MIMESearch&mime;=$MIME&limit;=500&offset;=0"   
 | grep -Po "\/wiki\/images[^\"]+"   
 | xargs -n1 -I {} wget "$URL{}"'

What it does: it uses the “MIME search” functionality on the wiki to locate ...

more ...

Creating a non-MAC bound CentOS 6 machine

I was building VMs to be deployed with Vagrant / Virtualbox for our QAs and discovered that on new instantiations of the machine the networking interface wasn’t coming up. The problem was that Virtualbox was assigning a random MAC address to the NIC (and rightly so, to avoid conflicts). I ...

more ...

Booting the Linux Kernel from Grub2

Recently a good friend of mine managed to uninstall all the kernels from his Ubuntu machine (what can I say - Monday morning and no coffee is a deadly combination). Luckily he had the install CD on hand so we did the following:

  1. Boot from the CD (we had Internet connection ...
more ...

Recovering encrypted home directory under Ubuntu

While the home-folder encryption in Ubuntu is far from a perfect solution (there is considerable data leakage from the swap file and the temp directory - for example once I’ve observed the flash videos from Chromium ~~porn~~ private browsing mode being present in the /tmp directory), it is a partial ...

more ...




How to save/restore iptables rules on Ubuntu?

This might be an obvious thing to old Linux-heads out there, but it sure caught me off-guard, so there might be some use in spelling it out:

iptables-save and iptables-restore do not actually save/load the iptables rules to/from an external file. You are responsible for redirecting the output ...

more ...

Don’t listen alone!

Do you like Linux? Do you listen to podcasts? If you’ve answered yes to both of those questions, you should know what LUG Radio is (if not, do a quick checking - I promise you that it will be worth it!).

The bad news? They stopped it in 2008. The ...

more ...