Today's Sweetmorn, the 68th day of Discord in the YOLD 3178.

Virtual Penis

2007-06-09 by xpheas
This funky Shell-Script calculates the penis length of your computer.

BASH-Code:
1
2
3
4
5
6
7
#!/bin/sh
LC_ALL=C
echo `uptime|grep days|sed 's/.*up \([0-9]*\) day.*/\1\/10+/'; \
cat /proc/cpuinfo|grep MHz|awk '{print $4"/30 +";}'; free|grep '^Mem' \
|awk '{print $3"/1024/3+"}'; df -P -k -x nfs | grep -v 1k \
| awk '{if ($1 ~ "/dev/(scsi|sd)"){ s+= $2} s+= $2;} END \
{print s/1024/50"/15+70";}'`|bc|sed 's/\(.$\)/.\1cm/'

Usage:
Save as vpenis.sh and make it executable (> chmod a+x vpenis.sh)
> ./vpenis.sh

Have fun!

PS: My computers length: 86.2cm *gg*

UPDATE
Thanks to black07 for the bug report!
There was a problem with the code-highlight function, which is fixed now.

  « back

2007-06-09 by black07
Hm...ich bekomme da einen Fehler...

awk: {if ( ~ "/dev/(scsi|sd)"){ s+= } s+= ;} END {print s/1024/50"/15+70";}
awk: ^ syntax error
awk: {if ( ~ "/dev/(scsi|sd)"){ s+= } s+= ;} END {print s/1024/50"/15+70";}
awk: ^ syntax error
awk: {if ( ~ "/dev/(scsi|sd)"){ s+= } s+= ;} END {print s/1024/50"/15+70";}
awk: ^ syntax error
(standard_in) 1: parse error
(standard_in) 2: parse error


2007-07-17 by poison
423.6cm =P


2007-10-15 by saataan
4258.2cm :-P
That would be like... 42 meters...
The answer to life!


2007-10-15 by saataan
Me again :)
Ok, lets call that a bug. I had BC_ENV_ARGS set to "-l"
Which causes it to display more decimals, and your "divide by ten by adding a decimal-dot before the last number" doesn't work :P

So, getting it right, it is
425.7cm

+ 10cm for finding a bug *scnr*


Feel Free to Leave a Comment

Name:*


Email: (not visible)


Website:


Comment:*