Debian Handbook

I have added the Debian Handbook to my Resources navigation menu.

Debian 6.0 Handbook

The handbook is available at: http://www.techish.net/debian-handbook/

You can install it on your Debian system (available in Unstable):

apt-get install debian-handbook

The documentation is stored in: /usr/share/doc/debian-handbook/.

You can also download the handbook from Raphael’s site: http://raphaelhertzog.com/2012/05/10/the-debian-administrators-handbook-is-available/ as well as from the handbook development site: http://debian-handbook.info/

Limit Bandwidth in Apache2

Limit bandwidth with Apache using the libapache2-mod-bw package which installs mod-bw.

Install Package

apt-get install libapache2-mod-bw

Load Module

a2enmod bw

Modify Apache’s configuration

Add the following in the VirtualHost section… in Debian, the Virtual Host configuration files are typically found inin /etc/apache2/sites-available/.

BandwidthModule On
ForceBandwidthModule On
# 1mbit/s (128KB/s) - value is in bytes
Bandwidth all 131072
ErrorDocument 510 510.html
BandWidthError 510

Reload Apache

service apache2 reload

Using Pipe Viewer for File Progress in Linux

There are numbers of ways of producing a file copy, compression, deletion, decompression dialog progress in Linux.

I was looking for a new way of doing it (yes, I know about tar’s checkpoint) and other similar methods. I came across a utility called ‘pv’ or Pipe Viewer.

pv – monitor the progress of data through a pipe

pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA.
To use it, insert it in a pipeline between two processes, with the appropriate options. Its standard input will be passed through to its standard output and progress will be shown on standard error.

pv will copy each supplied FILE in turn to standard output (- means standard input), or if no FILEs are specified just standard input is copied. This is the same behaviour as cat(1).

root@nitrous:/mnt/oldlinux/var/vhost/gallery/var# tar -cf - albums/ | pv -s $( du -sb albums | awk '{print $1}') | gzip > /backups/gallery_albums.tgz
 311MB 0:00:21 [15.2MB/s] [>                                   ]  2% ETA 0:11:50
root@nitrous:/mnt/oldlinux/var/vhost/gallery/var# tar -cf - albums/ | pv -s $( du -sb albums | awk '{print $1}') | gzip > /backups/gallery_albums.tgz
 3.9GB 0:04:36 [14.9MB/s] [===========>                        ] 36% ETA 0:07:52

Check your distribution repos for the ‘pv’ package. Happy hacking =)

Bind9 Wildcard DNS

Decided instead of managing all the DNS records for techish.net. that I would just setup wildcard entry for techish.net.

In my zone master file, I added the following:

*.techish.net. IN A 74.219.241.252

Then I reloaded bind9

/etc/init.d/bind9 reload

Voila, wildcard DNS.  Make sure you put the entry after all your static definitions and if you add more static definitions, put them above that wildcard entry.