Browsed by
Tag: linux

Using swatch to throttle script log messages

Using swatch to throttle script log messages

At work we have a few scripts that we would like to monitor, and define a few messages that should trigger an SMS to be sent to the person on call. As most of these scripts log to syslog, and we have a our linux servers set up to forward syslog messages to a central log host, we going to monitor the central syslog for important messages originated by the scripts. In order to avoid message storms, however, we need…

Read More Read More

Simple script for testing regular expressions in Perl

Simple script for testing regular expressions in Perl

At work the other day I was creating regular expressions (regexps) in perl for use with swatch. Instead of testing the regexps by entering them into the swatch config file, restart swatch, and use the “logger” command to trigger swatch to take action, I thought I’d simplify it by creating a small script. Since swatch is written i perl, I created a tiny script in perl so that there wouldn’t be any regexps mismatch between how the script interprets regexps…

Read More Read More

Experimenting with hugepages to reduce CPU and memory resources

Experimenting with hugepages to reduce CPU and memory resources

Most computers today have support for virtual memory. An application (i.e. process) running on such computers sees its address space as one large range of contiguous addresses, even if its memory chunks may be scattered around the physical memory (RAM). This means that when the process requests a particular memory location, the computers must figure out which physical memory location this corresponds to. The mapping of virtual memory to physical memory is stored in the page tables. For processes that…

Read More Read More

Creating encrypted backups of linux systems

Creating encrypted backups of linux systems

I recently bough myself a new external USB hard drive to hold backups of my laptop and one of my desktop computers running Ubuntu and Fedora, respectively. I wanted to run encrypted backups of both computers individually, so that they were protected by separate key phrases. After reading up on a few different solutions, I came across two great tools for this purpose: “encfs” to create encrypted folders “rdiff-backup” to create the backups

Measuring disk cache impact on system performance

Measuring disk cache impact on system performance

When you access data or load applications on your computer, the data blocks containing the data or applications are typically fetched from your local hard drive. These data blocks are loaded into memory, and are then ready for your computer to process. Since fetching data blocks from the hard drive or other external sources are very expensive in terms of time, your operating system typically implements a disk cache – data blocks that are loaded into memory remain there for…

Read More Read More

Incremental backups of linux boxes using rsync

Incremental backups of linux boxes using rsync

rsync is a great tool for running backups. When running multiple backups of the same file, rsync stores the data only once unless the data have changed. In the latter case, only the file deltas, i.e. the difference between the two files, is transferred, which can save both transfer time and bandwitdh. One really favorably effect of running rsync like this is that you can browse the backup folders afterward, and each backup will look like a full backup. So…

Read More Read More