Archive
Posts from 2010
Sorting data by dates, numbers and much much more
Every year or two I try to re-read manual pages and documentation about my favorite UNIX tools (bash, awk, sed, grep, etc.). Each time I do this I pick up some cool new nugget of information, and refresh my mind on things that I may have forgot. While reading through an article on sort, I came across the following note about the sort "-k" (field to sort by) option: "Further modifications of the sorting algorithm are possible with these options: -d (use only letters, digits, and blanks for sort keys), -f (turn off case recognition and treat lowercase and uppercase characters as identical), -i (ignores non-printing ASCII characters), -M (sorts lines using three-letter abbreviations of month names: JAN, FEB, MAR, ...), -n (sorts lines using only digits, -, and commas, or other thousands separator). These options, as well as -b and -r, can be used as part of a key number, in which case they apply to that key only and not globally, like they do when they are used outside key definitions."* This is crazy useful, and I didn't realize sort could be used to sort by date…
$ read more →Displaying GPG public keys in ASCII format
I was debugging a gpg issue earlier this week, and needed to dump the contents of a public key in some type of human readable form. After a bit of googling I came across the crazy awesome pgpdump utility, which provides a command line interface to display the contents of a GPG public key. To use this tool, you can pass the key file as an argument to pgpdump: Pgpdump will display the algorithms used to create the key, as well as the key-lengths that were used. This is amazingly helpful when debugging key-related issues (hash algorithm mismatches, key-size discrepancies, etc.), and I will definitely be adding this tool to my SysAdmin toolkit!
$ read more →Getting notified when new hosts appear on your network
I had to debug an interesting network problem a few weeks back, and wanted to see when new hosts appeared on my network. While debugging the issue, I needed to find a way to get notified when a new host appeared (I didn't want to sit at a terminal reviewing the output from snoop and tcpdump). Enter arpwatch, which can be used to send alerts the first time a client issues an ARP request. This is actually quite handy, and the alerts you get my e-mail are rather useful: There are a slew of options to control who gets the e-mail, whether to use a saved packet capture instead of an active network connection, etc…
$ read more →ARM vs. Intel Atom comparison
Van Smith wrote an awesome articlecomparing current ARM processors and their lower power consuming x86 friends such as the Intel Atom. Here's the conclusion of his performance benchmark tests: "The ARM Cortex-A8 achieves surprisingly competitive performance >across many integer-based benchmarks while consuming power at levels far >below the most energy miserly x86 CPU, the Intel Atom. In fact, the ARM >Cortex-A8 matched or even beat the Intel Atom N450 across a significant >number of our integer-based tests, especially when compensating for the >Atom’s 25 percent clock speed advantage." > > However, the ARM Cortex-A8 sample that we tested in the form of the >Freescale i.MX515 lived in an ecosystem that was not competitive with >the x86 rivals in this comparison. The video subsystem is very limited…
$ read more →Sending alerts to your Linux desktop when things go wrong
I run gnome on my work desktop, and even with our various monitoring solutions I still use some custom notification tools to get alerted when specific issues occur. One of these tools is gnome-notify, which allows you to create a visible notification inside your desktop workspace. This tool has several useful options, which are displayed when you run notify-send with the "-?" option: To use this tool to send an alert when a fault is detected, I typically wrap some conditional logic to parse the output of one or more commands: The code above will run the command embedded inside $(), and capture the output from this command in the variable system_check. If the value of the output is 1, then notify-send will be invoked to send a notification with the string "Problem with server X" to my desktop…
$ read more →