Update: This article is updated thanks to Colin Keith his excellent comment. I was extremely inspired by it Maintaining a large number of servers cannot be done without proper programming skills. Each good system administrator must therefor make sure he … Continue reading
Tag Archives: Linux
The below example is a very simple TCP server script written in Perl, which uses the AnyEvent module. It will create a separate process for each connections and has the ability to return data to the parent process. The below … Continue reading
A secure and very random password generator module written in Perl. It can be used to generate passwords or unique strings which can be used in sorts of operations. The default character set is alpha-numerical based, but can be set … Continue reading
Nagios plugin script written in Bash to check the master-slave replication in PostgreSQL (tested on PostgreSQL 9.2.4) (executed on the slave). The script will report how many bytes the slave server is behind, and how many seconds ago the last … Continue reading
There aren’t many Inotify daemons available that can work recursive and offer a descent flexibility regarding Inotify signals. For basic rsync operations, lsyncd isn’t that bad but it isn’t that flexible for system administration. The fact that it is written … Continue reading
If you have a hosting account at Hetzner with free backup space, you can not access this backup volume using rsync. One way of creating a simple backup, is by using the tar command with the incremental option. You will … Continue reading
Below is a small Perl example how to check for NFS mounted shares on a Linux host. The script does not need any specific modules, and makes use of the /etc/mtab file.
1 2 3 4 5 6 7 8 9 |
#!/usr/bin/perl use strict; use warnings; my @mount_points = do {local @ARGV = '/etc/mtab'; <>}; foreach my $mnt (@mount_points){ next unless $mnt =~ /nfs/; my ($node, $mnt_point, $fs, $options, $dump, $fsck) = split /\s+/, $mnt; print "Found NFS share $node mounted on $mnt_point\n"; } |
There are definetly a few modules on CPAN which will allow to easily change file permissions in Perl, but you do not always have the chance or possibility to install CPAN modules. The following examples explain how to change the … Continue reading
The Roundcube version (0.3.1) in Debian Squeeze is just too outdated. To create a new Debian package, using the latest version of Roundcube, is fairly easy. Download the latest source (currently 0.8.1) from http://www.roundcube.net/download, and put the TAR image (roundcubemail-0.8.1.tar.gz) … Continue reading
One way to secure your MySQL backups, is to encrypt the backup file using PGP/GnuPG. Of course you will need to own a PGP/GnuPG private key, which can be easily created using the PGP/GnuPG tools. On a Debian/Ubuntu Linux host, … Continue reading