The Lounge  •  GeekTool commands

GeekTool commands

from the Kremlin
2546 posts

I thought it would be a nice gesture to share GeekTool commands with the forum in an effort to discover new ones that others might contribute. I'll start by showing some of mine, and hopefully others will join in on the fun.

First up, the packet loss detector (set refresh to 60):
http://img.skitch.com/20090306-c3ge9ur7344pb2jtutnwhb6uyn.pnghttp://img.skitch.com/20090306-kn4h79e254j7pyk7q2nknejwu4.png

Don't forget to use the icon gems on this one.

LOSS=`ping -q -A -c 15 www.google.com | grep "packet loss" | cut -d " " -f 7 | cut -d "%" -f1`

if [ $? -ne 0 ]; then
echo "WARNING: Ping failed!"
exit 1
fi

if [ $LOSS -gt 0 ]; then
echo "WARNING: Packet loss detected!"
exit 1
else
echo "No packet loss detected."
exit 0
fi

I use this to monitor my server rather than my internet connection. You can do the same by replacing www.google.com with your server/webhost if you have one.

netstat (set refresh to 15)
This monitors connections that are open. Expect lots of lines if you're running a torrent or Skype:
http://img.skitch.com/20090306-k53u3tfbh76di6xfdq7w69dx95.png

netstat -nl | grep tcp4

top (set refresh at 5, 10, or 15 depending on how okay with load you are)
http://img.skitch.com/20090306-g3rkagf391c9cm6f1ygy9sxsxt.png

top -n57 -l2 -o-CPU | tail -n66

I'll also accept requests for scripts if people want them. I'll see what I can do. Let me know if this helps.


I'm overcapacity on my dropbox, so it would be superb if you helped me get more space by signing up with my link :3
䷩䷼䷨ — Six in the second place, Nine in the Fifth.
1
Pickpocket
33 posts

thanks! smile


▛▞▞▟ Proud Member of the BLUE Team™ ▙▚▚▜
2
Jewel Thief
from British Isles
385 posts

I'd like to see something that would display the weather and the shipping forecast (english versions too please)


There's bullet holes where my compassion used to be
▛▞▞▟ Proud Member of the BLUE Team™ ▙▚▚▜
3
Bank Robber
from California
554 posts

For weather and conditions you can use lynx (of course you have to install that first)

lynx -dump http://printer.wunderground.com/cgi-bin … IPCODE|awk ‘/Temp/{printf $2, “: “; for (i=3; i<=3; i++) printf $i ” ” }’

lynx -dump http://printer.wunderground.com/cgi-bin … IPCODE|awk ‘/Cond/ && !/Fore/ {for (i=2; i<=10; i++) printf $i ” ” }’

Replace ZIPCODE with the proper zip for your area.

If you would like to know other ways just let me know...


Get Great Web Hosting!

▛▞▞▟ Proud Member of the BLUE Team™ ▙▚▚▜
4
Jewel Thief
from Tennessee
254 posts

Thanks a lot! I tried GeekTool a while ago, before I was familiar with my Mac's inner workings. This is very helpful!


"Never lick a gifthorse in the mouth" -Timi
|| MacBook Pro 17" 2.5 GHz Core 2 Duo, 4 GB RAM, Late 2008 ||          [TWITTER/BLOG]
5
Jewel Thief
from Connecticut
157 posts

It would be nice if Geektool got a minor update. I tried downloading the source to see if I could just play with it. And the source contains Project Builder files. Poor Geek tool, its development never got to see xCode.

6
Bank Robber
from Houston, TX
540 posts

kalel wrote:

For weather and conditions you can use lynx (of course you have to install that first)

. . .

Replace ZIPCODE with the proper zip for your area.

If you would like to know other ways just let me know...

What about for those of us not living in the US?

7
Jewel Thief
from British Isles
385 posts

abeckstrom wrote:

kalel wrote:

For weather and conditions you can use lynx (of course you have to install that first)

. . .

Replace ZIPCODE with the proper zip for your area.

If you would like to know other ways just let me know...

What about for those of us not living in the US?

i'd like to second this, i find the wunderground doesn't like english postcodes so much


anything for english shipping forecasts?


There's bullet holes where my compassion used to be
▛▞▞▟ Proud Member of the BLUE Team™ ▙▚▚▜
8
Jewel Thief
from Minn
327 posts

Hey yall, for those of you who love the points race here is a little script to show you the points total per team on macheist!

lynx -source http://macheist.seems.nl/access/csv.php?num=4 | awk '{split($0,a,","); print "(" a[2] ") " a[3] }'

Remember you need to install Lynx. Instructions are linked below...

Other scripts are on my blog (A bazillion of them!) http://thememymac.com/?p=12


Proudly Orange
http://thememymac.com/
9
Jewel Thief
280 posts

Shadedjon wrote:

lynx -source http://macheist.seems.nl/access/csv.php?num=4 | awk '{split($0,a,","); print "(" a[2] ") " a[3] }'

Remember you need to install Lynx. Instructions are linked below...

You could do this with curl too.

curl -s http://macheist.seems.nl/access/csv.php?num=4 | awk '{split($0,a,","); print "(" a[2] ") " a[3] }'


A few others:
Your points total
curl -s http://rdic.mmnow.nl/api/txt/bot.php?user=craftyheist | grep Points | tr -d \<\>[a-zA-Z:\ ]
Your leaderboard position
curl -s http://rdic.mmnow.nl/api/txt/bot.php?user=craftyheist | grep Rank | tr -d \<\>[a-zA-Z:\ ]

Change 'craftyheist' to your own username.

The above 2 commands use the RDIC's feed data so please set the refresh to a high value to avoid hammering igodelaputa's server.

[edit: you can also get your points totals from the screen saver in my signature smile]

Last edited by CraftyHeist (March 8, 2009 2:51 pm)

10
Jewel Thief
280 posts

Here's a nice one to display the SMART status of your hard drive.

The command used is from here

First you need the name of the drives. Open terminal and type: diskutil list

http://img220.imageshack.us/img220/9921/terminal1.jpg

Second add the command: 'diskutil info * | grep Verified > /dev/null'  to GeekTool (replace the asterisk with your drive name

http://img89.imageshack.us/img89/9615/geektool2.jpg

Third select the icon tab and click the default button.

http://img144.imageshack.us/img144/9615/geektool2.jpg

Place the display next to the appropriate hard drive icon and you should get a nice green icon telling you that your hard drive's in order. If a SMART error is detected the icon should go red.

http://img217.imageshack.us/img217/9661/desktop1.jpg

Last edited by CraftyHeist (March 10, 2009 8:52 am)

11

Board footer