Posts with category: linux
- Track your (Synology) NAS when it’s stolen • 16 Apr 2011
When a friend of mine recently got his MacBook stolen, I quickly verified if I had installed Prey Project on each laptop/desktop PC I have. For those who do not know Prey:
- Redirecting with Apache’s .htaccess • 04 Jul 2007
When you migrate web sites from one place to another, and the URLS change, you don’t want to lose visitors that still use the old links. If your ‘old’ website ran on Apache, you can use its mod_alias/mod_rewrite functionality to...
- Convert Bind DNS zone into PTR records • 15 Jun 2005
The following script I made in order to convert the forward DNS records in a /var/named/db.[domain] file into the correct format for a reverse DNS db.[subnet prefix] file. `` #!/bin/sh (…) DNSROOT=/var/named PREFIX=$1 DOMAIN=$2 shift 2 DNSPRE=$DNSROOT/db.$PREFIX DNSDOM=$DNSROOT/db.$DOMAIN echo “;...
- Installing NTP (time synchronisation) • 19 May 2005
Set timezone (optional)
create symbolical link from /usr/share/zoneinfo/... to /etc/localtime:
ln -sf /usr/share/zoneinfo/Europe/Brussels /etc/localtime
- Perl HTML scraping part #1 • 21 Jan 2005
Here we are, back at the scene of the crime. Yes, I know it’s been a while. And the task of the day is:
- Probe average cpu utilisation (MRTG) • 21 Oct 2004
There are two main tools to keep track of your CPU usage: top and vmstat.
- Estimate # of lines in a log file • 21 Oct 2004
Let’s say you need an (approximate) count of the number of lines in a huge file. The most obvious way of calculating this would be using wc, but this actually can be quite slow: # time wc -l /var/log/squid/access.log<br />...
- Squid: list top X referers • 19 Oct 2004
If your Squid server logs the referers of its request (i.e. you’ve configured squid-cache with --enable-referer-log before compiling and you’ve included a referer_log /var/log/squid/referer.log in your squid.conf file), you can easily show top 50 of most popular referers with a...
- Redhat versions: what am I running? • 19 Oct 2004
If you manage multiple RedHat servers, or if you just stumble on a Linux server, and you have no idea what kind of machine it is, nor what the version of the OS is, try the following commands: