GeekTool Commands

Posted by Tony Brizuela | Posted in Computers | Posted on 31-07-2009

Tagged Under : ,

Here are some of my favorite UNIX commands for GeekTool.

–CPU Utilization–


echo CPU

top -l 1| awk ‘/CPU usage/ {print $8, $9}’

top -l 1| awk ‘/CPU usage/ {print $10, $11}’

top -l 1| awk ‘/CPU usage/ {print $12, $13}’

CPU


–Top CPU–

top -FR -l2 -o cpu | grep -v 0.0% | cut -c 7-24| sed -n ’15, $p’

Top CPU

–Memory–

top -orsize -FR -l1 | grep % | grep -v Load | grep -v COMMAND | cut -c 7-19,64-69

Memory

–Top Memory–

echo Memory

top -l 1 | awk ‘/PhysMem/ {print “Used: ” $8}’

top -l 1 | awk ‘/PhysMem/ {print “Free:  ” $6+$10″M”}’

top -l 1 | awk ‘/PhysMem/ {print “Used: ” $8 ” Free: ” $10}’


Top Memory

–Bandwidth Monitor–

This requires you to have Perl on your computer.

Most OSX machines already have it.

You can download the Perl Script here

After downloading, open Terminal and type the following:

open /usr/bin

It should open up a new Finder window for you and you can just drag and drop
the “BandwidthMonitor.perl” file into the folder.
It may require some authentication so it’ll ask for your password.

Now all you need to do is go back to Geek Tool

Select: Shell
Type on Command:

perl /usr/bin/BandwidthMonitor.perl

Remember to set the refresh rate.

Network

To display your public IP Address use:

curl -s www.whatismyip.com/automation/n09230945.asp | awk {‘print “Public IP : ” $1′}

–Network Activity–

#!/bin/sh
# get the current number of bytes in and bytes out
myvar1=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $7}’` #  bytes in
myvar3=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $10}’` # bytes out
#wait one second
sleep 1
# get the number of bytes in and out one second later
myvar2=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $7}’` # bytes in again
myvar4=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $10}’` # bytes out again
# find the difference between bytes in and out during that one second
subin=$(($myvar2 – $myvar1))
subout=$(($myvar4 – $myvar3))
# convert bytes to kilobytes
kbin=`echo “scale=2; $subin/1024;” | bc`
kbout=`echo “scale=2; $subout/1024;” | bc`
# print the results
echo Network
echo “In: $kbin Kb/sec”
echo “Out: $kbout Kb/sec”

#!/bin/sh

# get the current number of bytes in and bytes out

myvar1=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $7}’` #  bytes in

myvar3=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $10}’` # bytes out

#wait one second

sleep 1

# get the number of bytes in and out one second later

myvar2=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $7}’` # bytes in again

myvar4=`netstat -ib | grep -e “en1″ -m 1 | awk ‘{print $10}’` # bytes out again

# find the difference between bytes in and out during that one second

subin=$(($myvar2 – $myvar1))

subout=$(($myvar4 – $myvar3))

# convert bytes to kilobytes

kbin=`echo “scale=2; $subin/1024;” | bc`

kbout=`echo “scale=2; $subout/1024;” | bc`

# print the results

echo Network

echo “In: $kbin Kb/sec”

echo “Out: $kbout Kb/sec”

inout


Tony’s Twitter Updates for 2009-07-30

Posted by Tony Brizuela | Posted in Twitter | Posted on 30-07-2009

Tony’s Twitter Updates for 2009-07-29

Posted by Tony Brizuela | Posted in Twitter | Posted on 29-07-2009

Tony’s Twitter Updates for 2009-07-29

Posted by Tony Brizuela | Posted in Twitter | Posted on 29-07-2009

Tony’s Twitter Updates for 2009-07-28

Posted by Tony Brizuela | Posted in Twitter | Posted on 28-07-2009

  • Mophie will release a belt clip that fits the the juice pack air.I have been lookng/waitng for somethng like this http://tinyurl.com/n3rxa6 #

Mophie Juice Pack Air

Posted by Tony Brizuela | Posted in iPhone | Posted on 27-07-2009

I have been using the Mophie Juice Pack Air for over two weeks now and have to say this thing great. I am now able to get through the entire day without having to charge my iPhone. It syncs and charges via a microUSB cable so you don’t have to take your iPhone out of the case to charge or sync with iTunes. Also Mophie will be releasing a hip holster that fits with the Mophie Juice pack Air. I have been looking everywhere for a hip case that would fit the Mophie, and now my search is over.

juice pack air™ – iPhone 3G & 3G S

hip holster 6000 for juice pack

New Speakers

Posted by Tony Brizuela | Posted in Gadgets | Posted on 26-07-2009

I bought some new Altec Lancing speakers the other day, and I have to say I would highly recomend theese to anyone. What I like about them is that they have a built in subwoofer in each speaker thereby saving space on your desktop. The audio is exceptioanl as well.

Integrated circuits with no standby power

Posted by Tony Brizuela | Posted in Tech News | Posted on 26-07-2009

Integrated circuits with no standby power could be in use by year’s end originally appeared on Engadget on Sun, 19 Jul 2009 20:56:00 EST.