<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tony Brizuela &#187; GeekTool</title>
	<atom:link href="http://tonybrizuela.com/tag/geektool/feed/" rel="self" type="application/rss+xml" />
	<link>http://tonybrizuela.com</link>
	<description>Here I share thoughts, ideas, &#38; random things I find online</description>
	<lastBuildDate>Sun, 03 Oct 2010 20:11:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GeekTool Commands</title>
		<link>http://tonybrizuela.com/2009/07/31/geektool-commands/</link>
		<comments>http://tonybrizuela.com/2009/07/31/geektool-commands/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 19:22:46 +0000</pubDate>
		<dc:creator>Tony Brizuela</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[GeekTool]]></category>
		<category><![CDATA[UNIX Commands]]></category>

		<guid isPermaLink="false">http://tonybrizuela.com/?p=448</guid>
		<description><![CDATA[Here are some of my favorite UNIX commands for GeekTool. &#8211;CPU Utilization&#8211; echo CPU top -l 1&#124; awk &#8216;/CPU usage/ {print $8, $9}&#8217; top -l 1&#124; awk &#8216;/CPU usage/ {print $10, $11}&#8217; top -l 1&#124; awk &#8216;/CPU usage/ {print $12, $13}&#8217; &#8211;Top CPU&#8211; top -FR -l2 -o cpu &#124; grep -v 0.0% &#124; cut -c [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some of my favorite UNIX commands for <a href="http://projects.tynsoe.org/en/geektool/" target="_blank">GeekTool</a>.</p>
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px;">
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, fantasy; font-size: 13px; line-height: 19px;">&#8211;CPU Utilization&#8211;</span></p>
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px;"><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, fantasy; font-size: 13px; line-height: 19px;"><br />
</span></p>
<p style="font: normal normal normal 12px/normal Helvetica; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">echo CPU</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">top -l 1| awk &#8216;/CPU usage/ {print $8, $9}&#8217;</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">top -l 1| awk &#8216;/CPU usage/ {print $10, $11}&#8217;</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">top -l 1| awk &#8216;/CPU usage/ {print $12, $13}&#8217;</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier;">
<p><img class="alignnone size-full wp-image-451" title="CPU" src="http://tonybrizuela.com/wp-content/uploads/2009/07/CPU.png" alt="CPU" width="75" height="59" /></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier;"><span style="letter-spacing: 0.0px;"><br />
</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">&#8211;Top CPU&#8211;</p>
<p style="font: normal normal normal 13px/normal Courier; min-height: 16px; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; min-height: 16px; margin: 0px;">top -FR -l2 -o cpu | grep -v 0.0% | cut -c 7-24| sed -n &#8217;15, $p&#8217;</p>
<p style="font: normal normal normal 13px/normal Courier; min-height: 16px; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; min-height: 16px; margin: 0px;"><img class="alignnone size-full wp-image-454" title="Top CPU" src="http://tonybrizuela.com/wp-content/uploads/2009/07/Top-CPU.png" alt="Top CPU" width="111" height="151" /></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">&#8211;Memory&#8211;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">top -orsize -FR -l1 | grep % | grep -v Load | grep -v COMMAND | cut -c 7-19,64-69</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;"><img class="alignnone size-full wp-image-452" title="Memory" src="http://tonybrizuela.com/wp-content/uploads/2009/07/Memory.png" alt="Memory" width="79" height="51" /></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="font: normal normal normal 13px/normal Courier; min-height: 16px; margin: 0px;">–Top Memory–</p>
<p style="font: normal normal normal 13px/normal Courier; min-height: 16px; margin: 0px;"><span style="letter-spacing: 0px;"> </span></p>
<p style="font: normal normal normal 13px/normal Helvetica; margin: 0px;"><span style="letter-spacing: 0px;">echo Memory</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">top -l 1 | awk ‘/PhysMem/ {print “Used: ” $8}’</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">top -l 1 | awk ‘/PhysMem/ {print “Free:  ” $6+$10″M”}’</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;">top -l 1 | awk ‘/PhysMem/ {print “Used: ” $8 ” Free: ” $10}’</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;"><br />
</span></p>
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;">
<p style="font: normal normal normal 13px/normal Courier; margin: 0px;"><span style="letter-spacing: 0px;"><img class="alignnone size-full wp-image-455" title="Top Memory" src="http://tonybrizuela.com/wp-content/uploads/2009/07/Top-Memory.png" alt="Top Memory" width="108" height="139" /></span></p>
<p>&#8211;Bandwidth Monitor&#8211;</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;"><span style="font-weight: bold;">T</span><span style="font-weight: bold;">his requires you to have Perl</span> on your computer.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Courier; min-height: 16.0px;">Most OSX machines already have it.</p>
<p><span style="color: #993300;"><span style="text-decoration: none;"><span style="color: #ffffff;"><a href="http://tonybrizuela.com/wp-content/uploads/2009/07/BandwidthMonitor.perl.zip" target="_blank"><span style="color: #000000;">You can download the Perl Script here</span></a></span></span></span></p>
<p>After downloading, open <span style="font-weight: bold;">Terminal</span> and type the following:</p>
<p><span style="font-weight: bold;">open /usr/bin</span></p>
<p>It should open up a new Finder window for you and you can just drag and drop<br />
the &#8220;BandwidthMonitor.perl&#8221; file into the folder.<br />
It may require some authentication so it&#8217;ll ask for your password.</p>
<p>Now all you need to do is go back to Geek Tool</p>
<p>Select: <span style="font-weight: bold;">Shell</span><br />
Type on Command:</p>
<p><span style="font-weight: bold;">perl /usr/bin/BandwidthMonitor.perl</span></p>
<p><span style="font-weight: bold;">Remember to set the refresh rate.</span></p>
<p><span style="font-weight: bold;"><img class="alignnone size-full wp-image-458" title="Network" src="http://tonybrizuela.com/wp-content/uploads/2009/07/Network.png" alt="Network" width="140" height="79" /></span></p>
<p>To display your public IP Address use:</p>
<p style="margin: 0.0px 0.0px 13.0px 0.0px; line-height: 19.0px; font: 13.0px Georgia;">curl -s www.whatismyip.com/automation/n09230945.asp | awk {&#8216;print &#8220;Public IP : &#8221; $1&#8242;}<span style="line-height: 19px;"> </span></p>
<p>&#8211;Network Activity&#8211;</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#!/bin/sh</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># get the current number of bytes in and bytes out</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">myvar1=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $7}&#8217;` #  bytes in</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">myvar3=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $10}&#8217;` # bytes out</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">#wait one second</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">sleep 1</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># get the number of bytes in and out one second later</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">myvar2=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $7}&#8217;` # bytes in again</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">myvar4=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $10}&#8217;` # bytes out again</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># find the difference between bytes in and out during that one second</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">subin=$(($myvar2 &#8211; $myvar1))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">subout=$(($myvar4 &#8211; $myvar3))</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># convert bytes to kilobytes</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">kbin=`echo &#8220;scale=2; $subin/1024;&#8221; | bc`</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">kbout=`echo &#8220;scale=2; $subout/1024;&#8221; | bc`</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"># print the results</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">echo Network</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">echo &#8220;In: $kbin Kb/sec&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 1086px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">echo &#8220;Out: $kbout Kb/sec&#8221;</div>
<p>#!/bin/sh</p>
<p># get the current number of bytes in and bytes out</p>
<p>myvar1=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $7}&#8217;` #  bytes in</p>
<p>myvar3=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $10}&#8217;` # bytes out</p>
<p>#wait one second</p>
<p>sleep 1</p>
<p># get the number of bytes in and out one second later</p>
<p>myvar2=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $7}&#8217;` # bytes in again</p>
<p>myvar4=`netstat -ib | grep -e &#8220;en1&#8243; -m 1 | awk &#8216;{print $10}&#8217;` # bytes out again</p>
<p># find the difference between bytes in and out during that one second</p>
<p>subin=$(($myvar2 &#8211; $myvar1))</p>
<p>subout=$(($myvar4 &#8211; $myvar3))</p>
<p># convert bytes to kilobytes</p>
<p>kbin=`echo &#8220;scale=2; $subin/1024;&#8221; | bc`</p>
<p>kbout=`echo &#8220;scale=2; $subout/1024;&#8221; | bc`</p>
<p># print the results</p>
<p>echo Network</p>
<p>echo &#8220;In: $kbin Kb/sec&#8221;</p>
<p>echo &#8220;Out: $kbout Kb/sec&#8221;</p>
<p><span style="font-weight: bold;"><img class="alignnone size-full wp-image-520" title="inout" src="http://tonybrizuela.com/wp-content/uploads/2009/08/inout.png" alt="inout" width="92" height="46" /></span></p>
<p><span style="font-weight: bold;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://tonybrizuela.com/2009/07/31/geektool-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

