Archive for the ‘Useful Tools’ Category.

vim modelines

So that Robin and I never again forget what the little bastards are called.. The syntactic sugar in source files requried for vim to be ‘just the way you like it’ isn’t called “magic comments” or “vim source configure” or any other search combination that leads to repeated head-meeting-brick incidents when trying to remember what they are. They’re called modelines (:help modeline)

An example modeline that works for Python would be:

#!/usr/bin/python
# vim: ai sm tw=0 sw=4 ts=4

Procinfo

Just found this useful little tool for summerising machine information read from /proc. I can’t find a home page for it but it can be downloaded from ftp://ftp.cistron.nl/pub/people/svm/. It seems to ship by default with at least SUSE 9.3 and Fedora Core 4.

Example output below

[root@eddie ~]# procinfo
Linux 2.6.11-1.1369_FC4 (bhcompile@decompose.build.redhat.com) \
(gcc 4.0.0 20050525 ) #1 Thu Jun 2 22:55:56 EDT 2005 1CPU [eddie]

Memory:      Total        Used        Free      Shared     Buffers
Mem:        515372      446196       69176           0      113048
Swap:      1048568         912     1047656

Bootup: Sun Jul 17 08:47:22 2005    Load average: 0.43 0.22 0.08 1/138 11716

user  :       3:36:41.09   1.7%  page in :        0
nice  :       1:20:51.42   0.6%  page out:        0
system:       3:40:27.39   1.7%  swap in :        0
idle  :   8d 17:08:50.87  96.0%  swap out:        0
uptime:   9d  1:46:23.08         context : 98642479

irq  0: 784129991 timer                 irq  8:         1 rtc
irq  1:         9 i8042                 irq  9:         0 acpi
irq  2:         0 cascade [4]           irq 10:   6170092 CMI8738-MC6, ehci_hc
irq  3:         5                       irq 11:         0 uhci_hcd:usb2, uhci_
irq  4:         5                       irq 12:      2114 i8042
irq  5:         0 uhci_hcd:usb1, yenta  irq 14:   2132585 ide0
irq  6:         5                       irq 15:   2955294 ide1

[root@eddie ~]#