Showing posts with label unix. Show all posts
Showing posts with label unix. Show all posts

2009-05-04

Shell History Stats

Inspired by reading an old thread on my local Linux user group mailing list:

$ history | awk '{a[$2]++ } END{for(i in a){print a[i] " " i}}' | sort -rn | head

94 povray
58 source
55 ./wacdump
32 l
31 cd
25 dcraw
22 cp
21 gimp
20 less
19 gvim

:) I should run that more often. Maybe feed to Twitter. Or not.

2007-09-30

New Zealand Daylight Savings Time changes

From 2007, daylight savings time in New Zealand starts one week earlier and finishes two weeks later. My Gentoo system still had the old timezone information, and so wasn't going to switch over on Sunday September 30 as it should:

$ zdump -v /etc/localtime | grep 2007
/etc/localtime  Sat Mar 17 13:59:59 2007 UTC = Sun Mar 18 02:59:59 2007 NZDT isdst=1
/etc/localtime  Sat Mar 17 14:00:00 2007 UTC = Sun Mar 18 02:00:00 2007 NZST isdst=0
/etc/localtime  Sat Oct  6 13:59:59 2007 UTC = Sun Oct  7 01:59:59 2007 NZST isdst=0
/etc/localtime  Sat Oct  6 14:00:00 2007 UTC = Sun Oct  7 03:00:00 2007 NZDT isdst=1

Solution: update the timezone-data package:

$ emerge -av sys-libs/timezone-data

(Alternatively, download the timezone data source directly from ftp://elsie.nci.nih.gov/pub/tzdata2007g.tar.gz and compile using zic.)

And restart the Network Time Protocol server, for good measure:

$ /etc/init.d/ntpd stop
$ ntpd -qgx
$ /etc/init.d/ntpd start
$ # wait a few minutes, then check the time...
$ ntptime

Once NTP’s timekeeping has settled down, you might also want to set the hardware clock.

$ hwclock --systohc
$ hwclock --show