Date formatting in GAWK: boot time
02 Nov 2004I have one server with apparently an exceptional stability:
I have one server with apparently an exceptional stability:
While working on some bandwidth-related stuff (my bandwidth calculator), I came across an excellent article on “latency vs. bandwidth” by Stuart Cheshire. It was originally written in 1996, so focuses a lot on modems, but Fact 1, 2 and 4 are still valid.
I remember when I saw my first double-neck guitar, I was really impressed. That seemed like a huge thing to have hanging from your neck. They became really popular in the Led Zeppelin, Yes and The Who era. The idea is to have 2 guitars handy, like a 6-string and a 12-string, or a bass and a guitar, a fretted and a fretless bass, or 2 guitars in a different tuning. But obviously it’s also one of those macho “size-matters” things. The guitarist with the double-neck here is Jimmy Page from Led Zeppelin.
There are two main tools to keep track of your CPU usage: top and vmstat.
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
2812824 /var/log/squid/access.log
real 0m43.988s
# (counting is done at 64.000 lines/sec)
You have a huge file that contains one line per request/transaction. Some lines are of one type (e.g. ‘HIT’), some of another (e.g. MISS). Let’s say you want to calculate the hit-rate, but as fast as possible.
We take a Squid log file of about 140MB. How long does it take to count how many lines it has?
$ time wc -l /var/log/squid/access.log
845212 /var/log/squid/access.log
real 0m6.523s
(about 21.4 MB/s or 130.000 lines/s)
If your Squid server logs the referers of its request (i.e.
--enable-referer-log before compiling andreferer_log /var/log/squid/referer.log in your squid.conf file),#!/bin/bashIf 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:

Well there’s a reputation well earned: Casablanca is one of the best films I’ve seen recently. I know it’s been out for a while (it was released in 1942) but I only bought the DVD last weekend. Great cast (Bogart as cool as a three-star freezer), strong script (Bergman torn between the two loves of her life, and then some WWII thrown in), and superb dialogues.

If you’re interested in high level conversations on a wide range of topics, check out edge.org. Their motto: To arrive at the edge of the world’s knowledge, seek out the most complex and sophisticated minds, put them in a room together, and have them ask each other the questions they are asking themselves.
There’s fascinating stuff about quantum computing and black swan dynamics, but a piece in the last publication jumped out, a discussion on ‘A self worth having’: