2 msgQuestion about gstreamer
4 msgToday's sync breaks stuff
23 msgIs the mailing list working?
9 msggrub weirdness
6 msgOT: Looking for SATA controller recommendation
55 msgback up gentoo system
4 msgWTF? VMWare server modules blocks :/
2 msgstuck with Mysql --config
4 msgWhere is elog documentation
5 msgto which package scrbook.cls belongs?
2 msgepson printers using avasys drivers. anyone?
4 msgblocking packages when emerge gnome-light
3 msgaufs and gentoo-sources
12 msgWhat version of netscape-flash to use with konq...
2 msgNew b43 driver can't find my AP

Which openoffice
\ econti (5 May 2008)
. \ Justin (5 May 2008)
. \ Wang, Baojun (5 May 2008)
. . \ Rudmer van Dijk (5 May 2008)
. \ Dirk Heinrichs (5 May 2008)
. . \ Philip Webb (5 May 2008)
. \ Philip Webb (5 May 2008)
. . \ Francesco Talamona (5 May 2008)
. . . \ Alan McKinnon (5 May 2008)
. . . . \ Uwe Thiem (5 May 2008)
. . . . . \ Alan McKinnon (5 May 2008)
. \ András Csányi (5 May 2008)
. \ Volker Armin Hemmann (5 May 2008)
. . \ Neil Bothwick (5 May 2008)
. . \ Wolf Canis (5 May 2008)
. . . \ Volker Armin Hemmann (5 May 2008)
. . . . \ Mick (5 May 2008)
. . . . . \ Wolf Canis (5 May 2008)
. . . . \ Wolf Canis (5 May 2008)
. . . . . \ Volker Armin Hemmann (5 May 2008)
. . . . . . \ Wolf Canis (6 May 2008)
. . . . . . . \ Zdenek Travnicek (6 May 2008)
. . . . . . . . \ Wolf Canis (6 May 2008)
. \ Justin (5 May 2008)
. . \ Willie Wong (5 May 2008)
. . . \ Justin (5 May 2008)
. . . . \ Willie Wong (6 May 2008)
. . . \ Alan McKinnon (5 May 2008)
. . . . \ Etaoin Shrdlu (6 May 2008)
. . . . . \ Neil Bothwick (6 May 2008)
. . . . . . \ Etaoin Shrdlu (6 May 2008)
. . . . . . . \ Willie Wong (6 May 2008)
. . . \ Volker Armin Hemmann (5 May 2008)
. . . \ b.n. (5 May 2008)
. . . \ Joe User (6 May 2008)
. . . . \ Etaoin Shrdlu (6 May 2008)
. . . . . \ Neil Bothwick (6 May 2008)
. . . . . . \ Etaoin Shrdlu (7 May 2008)
. . . . . . . \ Neil Bothwick (7 May 2008)
. . . . . . . . \ Etaoin Shrdlu (7 May 2008)
. \ Elric Scott (5 May 2008)

2 msgApache status
6 msgusing a HD with bad sectors
2 msgOnly a '-' in 'top' column WCHAN since downgrad...
5 msgUsing package.use
Subject:Re: [OT] Which openoffice
Group:Gentoo-user
From:Etaoin Shrdlu
Date:6 May 2008


 
On Monday 5 May 2008, 22:12, Alan McKinnon wrote:

> nazgul screenlets-0.0.2 # echo `uptime|grep days|sed 's/.*up
> \([0-9]*\) day.*/\1\/10+/'; cat /proc/cpuinfo|grep '^cpu MHz'|awk
> '{print $4"/30 +";}';free|grep '^Mem'|awk '{print $3"/1024/3+"}'; df
> -P -k -x nfs -x smbfs | grep -v '1024-blocks' | awk '{if ($1 ~
> "/dev/(scsi|sd)"){ s+= $2} s+= $2;} END {print s/1024/50"/15
> +70";}'`|bc|sed 's/\(.$\)/.\1cm/' 67.1cm
>
> Fascinating, most fascinating. I get 67.1cm! Longer than yours!
>
> Now, this command of your. Wazzitdo?

It builds a bc expression, which is then fed to bc and the result is
divided by 10 and has "cm" added to it.

uptime|grep days|sed 's/.*up \([0-9]*\) day.*/\1\/10+/'

This checks the uptime, and outputs "n/10+", where "n" is the uptime in
days. In my case, the expression is "2/10+".


cat /proc/cpuinfo|grep '^cpu MHz'|awk '{print $4"/30 +";}'

This outputs "n/30 +", where "n" is the CPU speed in mhz. In my case
(hyperthreding cpu) it outputs

3000.000/30 +
3000.000/30 +


free|grep '^Mem'|awk '{print $3"/1024/3+"}'

This outputs "n/1024/3+", where "n" is the "used memory" from free's
output. On my desktop, that is "1721716/1024/3+", but obvioulsy it
changes almost every time you run the command. Not sure why the used
memory is used instead of the total.

df -P -k -x nfs -x smbfs | grep -v '1024-blocks' | awk '{if ($1
~ "/dev/(scsi|sd)"){ s+= $2} s+= $2;} END {print s/1024/50"/15
+70";}'

This outputs "n/15 +70", where "n" is the sum of the 1024-blocks as per
df's output (excluding nfs and smbfs file systems), divided by 1024 and
further divided by 50. The block count of /dev/scsi* or /dev/sd* devices
is counted twice (not sure why though). On my system, the output
is "5313.33/15 +70".

So, the final expression fed to bc is

2/10+ 3000.000/30 + 3000.000/30 + 1721716/1024/3+ 5313.33/15 +70

bc does the math, and sed divides the result by 10 and adds "cm" to the
result. For me, that gives 118.4cm.

It would be interesting to know why Willie chose those values, those
scaling factors, and what's the purpose of the constants.

Nice script though! Thanks!
--
gentoo-user mailing list



© 2004-2008 readlist.com