Category Archives: Bash

Running old Ubuntu versions as chroot with proot

Currently I am working on building a modern Clang/LLVM-based toolchain for ancient Ubuntu versions. In order to do that I wrote a few helper scripts I am using in conjunction with proot to run old Ubuntu rootfs1 inside a chroot … Continue reading

Posted in Bash, EN, Linux, Programming, Software, Unix and unixoid | Tagged , | Leave a comment

prune-kernels function …

If you are like me, you will have noticed on Ubuntu (and sometimes Debian) that stale old kernels remain on the disk even when they aren’t needed anymore. I wrote a little Bash function to get rid of those kernels. … Continue reading

Posted in Administration, Bash, EN, Linux, Programming, Unix and unixoid | Tagged | Leave a comment

Selecting the editor on Debian/Ubuntu non-interactively

Set the selected editor on Ubuntu/Debian for yourself and root in one line: echo ‘SELECTED_EDITOR=”/usr/bin/vim.nox”‘|tee $HOME/.selected_editor| \ sudo tee /root/.selected_editor or echo “SELECTED_EDITOR=\”$(which vim.nox)\””|tee $HOME/.selected_editor| \ sudo tee /root/.selected_editor // Oliver

Posted in Bash, EN, Linux, Programming | Tagged , | Leave a comment

by the way …

Convenient little snippet to get my external IP: echo $(wget -q -O – ip.assarbad.net/text)

Posted in Administration, Bash, EN, Linux, Unix and unixoid | Leave a comment

CVS and SSH on a very old machine …

Had trouble getting it to work with ancient versions of ssh (OpenSSH_3.1p1) and cvs (Concurrent Versions System (CVS) 1.11.20). Until I figured that I could write a little wrapper script to see what’s wrong. The wrapper script looked like this: … Continue reading

Posted in Bash, Linux, Software, Unix and unixoid, VCS | Tagged , | Leave a comment

Top ten disk space hogs in current folder

du -cks *|sort -rn|head -11|awk ‘{printf “%-8.2f MiB\t%s\n”, $1/1024, $2}’ NB: first item is the total size, so it outputs eleven lines. Update: a better version is this one: du -cks *|sort -rn|head -11|awk ‘{printf “%-8.2f MiB\t”, $1/1024;\ for(i=2; i

Posted in /dev/null, Bash, EN, Linux, Unix and unixoid | Leave a comment

DNAT for a Jabber/XMPP service

Problem: you have one external IP and want to run separate services on different hosts behind the router. Here’s a small script to DNAT the router to the host behind it. Netfilter will take care of the return traffic (so … Continue reading

Posted in Bash, EN, Linux, Software | Leave a comment