<?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>nerdnotes.org &#187; osx</title>
	<atom:link href="http://nerdnotes.org/category/nerdnotes/mac-os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdnotes.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 08 Apr 2010 20:17:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>cmdline screenshots in OSX</title>
		<link>http://nerdnotes.org/2009/02/cmdline-screenshots-in-osx/</link>
		<comments>http://nerdnotes.org/2009/02/cmdline-screenshots-in-osx/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 13:25:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/02/18/cmdline-screenshots-in-osx/</guid>
		<description><![CDATA[Geekology describes a nice osx builtin command to create screen captures: screencapture. I wanted to create a screenshot of a mouse interaction. That requires some sort of a delay after initiating the capture. The &#8220;-T&#8221; option described facilitates this. It looks like the -T option is missing in the tiger version of this utility. Of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.geekology.co.za">Geekology</a> describes a nice osx builtin command to create screen captures: screencapture. I wanted to create a screenshot of a mouse interaction. That requires some sort of a delay after initiating the capture. The &#8220;-T&#8221; option <a href="http://www.geekology.co.za/blog/2009/02/mac-os-x-quick-tip-taking-screenshots-from-the-command-line/">described</a> facilitates this. It looks like the -T option is missing in the tiger version of this utility. Of course you can use &#8217;sleep&#8217; to wait a couple of seconds:</p>
<pre class="brush: css;">
$ sleep 5;screencapture -C ~/Desktop/screenshot.png
</pre>
<p>See also my previous post on <a href="http://nerdnotes.org/2005/03/27/screenshots/">screenshots</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/02/cmdline-screenshots-in-osx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8216;Compact&#8217; bash prompt</title>
		<link>http://nerdnotes.org/2007/07/compact-bash-prompt/</link>
		<comments>http://nerdnotes.org/2007/07/compact-bash-prompt/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 20:47:25 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">86</guid>
		<description><![CDATA[Especially when working with cakephp, the following line in your .bash_profile script might come in handy:

HOSTCOLOR=&#34;31m&#34;
PS1=&#34;\u@\[\e[${HOSTCOLOR}\]\h\[\e[0m\]:\w\n\[\e[33m\]\!\[\e[0m\] \$ &#34;

It will print out the current working directory on the first line and the actual bash prompt on the second line. Making it less likely that your command will wrap lines after the first few typed characters.
It changes [...]]]></description>
			<content:encoded><![CDATA[<p>Especially when working with cakephp, the following line in your .bash_profile script might come in handy:</p>
<pre class="brush: css;">
HOSTCOLOR=&quot;31m&quot;
PS1=&quot;\u@\[\e[${HOSTCOLOR}\]\h\[\e[0m\]:\w\n\[\e[33m\]\!\[\e[0m\] \$ &quot;
</pre>
<p>It will print out the current working directory on the first line and the actual bash prompt on the second line. Making it less likely that your command will wrap lines after the first few typed characters.<br />
It changes the command prompt from:</p>
<p><img id="image112" src="http://nerdnotes.org/wp-content/uploads/2007/07/cmdline-long.png" alt="command line long" /></p>
<p>&#8230;.into:</p>
<p><img id="image110" src="http://nerdnotes.org/wp-content/uploads/2007/07/cmdline-short.png" alt="command line 'short'" /></p>
<p>The login prompt now shows the following info:</p>
<ul>
<li>username</li>
<li>hostname in red (in my bash script, it will print red for one group of servers and blue for other servers)</li>
<li>current working directory</li>
<li>command history number, ie: use !520 to execute the previous command</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/07/compact-bash-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Source Mac Apps</title>
		<link>http://nerdnotes.org/2006/12/open-source-mac-apps/</link>
		<comments>http://nerdnotes.org/2006/12/open-source-mac-apps/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 15:16:38 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">78</guid>
		<description><![CDATA[Just names and links:
Adium X, Chicken of the VNC, Colloquy, Cyberduck, Chmox, Fink, Firefox, macam, Smultron, Tomato Torrent, Virtuedesktop
]]></description>
			<content:encoded><![CDATA[<p>Just names and links:<br />
<a href="http://www.adiumx.com/index.php">Adium X</a>, <a href="http://sourceforge.net/projects/cotvnc/">Chicken of the VNC</a>, <a href="http://colloquy.info/">Colloquy</a>, <a href="http://cyberduck.ch/">Cyberduck</a>, <a href="http://chmox.sourceforge.net/">Chmox</a>, <a href="http://fink.sourceforge.net/">Fink</a>, <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a>, <a href="http://webcam-osx.sourceforge.net/">macam</a>, <a href="http://smultron.sourceforge.net/">Smultron</a>, <a href="http://sarwat.net/bittorrent/">Tomato Torrent</a>, <a href="http://virtuedesktops.info/">Virtuedesktop</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/12/open-source-mac-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Until it&#8217;s posssible to mount ssh filesystems&#8230;</title>
		<link>http://nerdnotes.org/2006/12/until-its-posssible-to-mouns-ssh-filesystems/</link>
		<comments>http://nerdnotes.org/2006/12/until-its-posssible-to-mouns-ssh-filesystems/#comments</comments>
		<pubDate>Sat, 30 Dec 2006 12:16:01 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">77</guid>
		<description><![CDATA[Forget about cyberduck, the real thing is made possible by Amit Singh!! Two visitors dropped comments about about the release of this project. I&#8217;ve updated the post that I made back in September.

Until then&#8230; I will use cyberduck!!!
Cyberduck is an FTP / SFTP client that let&#8217;s you browse filesystems on systems you have ssh access [...]]]></description>
			<content:encoded><![CDATA[<p>Forget about cyberduck, the real thing is made possible by <a href="http://googlemac.blogspot.com/2007/01/taming-mac-os-x-file-systems.html">Amit Singh</a>!! Two visitors dropped comments about about the release of this project. I&#8217;ve updated the post that I made back in <a href="http://nerdnotes.org/index.php/2006/09/28/does-mac-os-x-sshfs-exist/">September</a>.</p>
<p><del datetime="2007-01-14T17:55:47+00:00"><br />
Until then&#8230; I will use cyberduck!!!<br />
<a href="http://cyberduck.ch/">Cyberduck</a> is an FTP / SFTP client that let&#8217;s you browse filesystems on systems you have ssh access to. It not only lets you upload and download files, it also file edit support. After connecting to a server, select a file and right click it. Select &#8216;Edit with > Smultron&#8217;.<br />
Cyberduck monitors the file that you just opened in <a href="http://smultron.sourceforge.net/">Smultron</a>. If you save it, it will be automatically uploaded to the server, just like you where editing a local file.</p>
<p>And, of course, both <a href="http://cyberduck.ch/">Cyberduck</a> and <a href="http://smultron.sourceforge.net/">Smultron</a> are Free and Open Souce <img src='http://nerdnotes.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> <br />
Neat!!</p>
</p>
<p></del></p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/12/until-its-posssible-to-mouns-ssh-filesystems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch conversion of images</title>
		<link>http://nerdnotes.org/2006/12/batch-conversion-of-images/</link>
		<comments>http://nerdnotes.org/2006/12/batch-conversion-of-images/#comments</comments>
		<pubDate>Fri, 15 Dec 2006 10:27:03 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">73</guid>
		<description><![CDATA[For batch image conversion, file renaming, etc, I usually use these kind of one-liners:

$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done
convert screendump_01.bmp screendump_01.png
convert screendump_02.bmp screendump_02.png
convert screendump_03.bmp screendump_03.png

When you&#8217;re satisfied with the result, have it executed by the shell:

$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done [...]]]></description>
			<content:encoded><![CDATA[<p>For batch image conversion, file renaming, etc, I usually use these kind of one-liners:</p>
<pre class="brush: css;">
$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done
convert screendump_01.bmp screendump_01.png
convert screendump_02.bmp screendump_02.png
convert screendump_03.bmp screendump_03.png
</pre>
<p>When you&#8217;re satisfied with the result, have it executed by the shell:</p>
<pre class="brush: css;">
$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done | sh
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/12/batch-conversion-of-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combine PDFs</title>
		<link>http://nerdnotes.org/2006/06/combine-pdfs/</link>
		<comments>http://nerdnotes.org/2006/06/combine-pdfs/#comments</comments>
		<pubDate>Tue, 27 Jun 2006 14:07:04 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">59</guid>
		<description><![CDATA[Try the following Gostscript one-liner:

$ gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=combined.pdf article1.pdf article2.pdf notes.pdf

]]></description>
			<content:encoded><![CDATA[<p>Try the following Gostscript one-liner:</p>
<pre class="brush: css;">
$ gs -q -sPAPERSIZE=a4 -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=combined.pdf article1.pdf article2.pdf notes.pdf
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/06/combine-pdfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redirecting stdout &amp; stderr notes</title>
		<link>http://nerdnotes.org/2006/06/redirecting-stdout-stderr-notes/</link>
		<comments>http://nerdnotes.org/2006/06/redirecting-stdout-stderr-notes/#comments</comments>
		<pubDate>Sun, 25 Jun 2006 15:48:15 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">57</guid>
		<description><![CDATA[Redirect stdout to stderr:

$ echo Oops, something went wrong &#62;&#38;2

Redirect stderr to /dev/null:

$ ls /home /qwerty 2&#62; /dev/null
home:joe  john

To get rid off all output:

$ ls /home /qwerty &#62;/dev/null 2&#62;/dev/null
# or
$ ls /home /qwerty &#62;/dev/null 2&#62;&#38;1

]]></description>
			<content:encoded><![CDATA[<p>Redirect stdout to stderr:<br />
<code lang="bash"><br />
$ echo Oops, something went wrong &gt;&amp;2<br />
</code><br />
Redirect stderr to /dev/null:<br />
<code lang="bash"><br />
$ ls /home /qwerty 2&gt; /dev/null<br />
home:joe  john<br />
</code><br />
To get rid off all output:<br />
<code lang="bash"><br />
$ ls /home /qwerty &gt;/dev/null 2&gt;/dev/null<br />
# or<br />
$ ls /home /qwerty &gt;/dev/null 2&gt;&amp;1<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/06/redirecting-stdout-stderr-notes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tar over ssh</title>
		<link>http://nerdnotes.org/2006/06/tar-over-ssh/</link>
		<comments>http://nerdnotes.org/2006/06/tar-over-ssh/#comments</comments>
		<pubDate>Fri, 23 Jun 2006 22:05:37 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">56</guid>
		<description><![CDATA[Just a very short note. It&#8217;s not so difficult, but I keep on forgetting the syntax. Here it is:

me@localhost$ tar cf - . &#124; \
    ssh user@otherhost 'cd dir; tar xf -'

]]></description>
			<content:encoded><![CDATA[<p>Just a very short note. It&#8217;s not so difficult, but I keep on forgetting the syntax. Here it is:</p>
<pre class="brush: css;">
me@localhost$ tar cf - . | \
    ssh user@otherhost 'cd dir; tar xf -'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/06/tar-over-ssh/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Alienscan</title>
		<link>http://nerdnotes.org/2006/06/alienscan/</link>
		<comments>http://nerdnotes.org/2006/06/alienscan/#comments</comments>
		<pubDate>Wed, 14 Jun 2006 19:45:15 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">54</guid>
		<description><![CDATA[Today, I wrote a little bash scripts that scans the network for computers that are not registered in DNS. Reverse DNS to be more precise. It uses nmap to do a reverse DNS lookup for each computer it pings:
$ nmap -sPR -oG - 192.168.0.*
The result is filtered for failed DNS lookups:
$ nmap -sPR -oG - [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I wrote a little bash scripts that scans the network for computers that are not registered in DNS. Reverse DNS to be more precise. It uses nmap to do a reverse DNS lookup for each computer it pings:</p>
<pre class="brush: bash;">$ nmap -sPR -oG - 192.168.0.*</pre>
<p>The result is filtered for failed DNS lookups:</p>
<pre class="brush: bash;">$ nmap -sPR -oG - 192.168.0.* | grep &quot;()&quot;</pre>
<p>Since all computers are contacted their mac address is known in the ARP (Address Resolution Protocol) table:</p>
<pre class="brush: bash;">$ /sbin/arp | grep -w 192.168.0.35 | awk '{ print $3 }'</pre>
<p>After looking up the MAC address, a table is presented with ip addresses and their mac addresses. <a href="http://nerdnotes.org/scripts/alien-scan.sh.php">This is the complete script.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/06/alienscan/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using bash variables in awk</title>
		<link>http://nerdnotes.org/2006/04/using-bash-variables-in-awk/</link>
		<comments>http://nerdnotes.org/2006/04/using-bash-variables-in-awk/#comments</comments>
		<pubDate>Fri, 21 Apr 2006 08:59:17 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">49</guid>
		<description><![CDATA[While there seems nothing wrong with this:

sign=&#34;--&#34;
awk '{if ($1 == $sign ) print $1 }'

..it doesn&#8217;t give the intended result. To be able to use bash variables in awk, you first need to assign the variables with the -v option:

sign=&#34;--&#34;
awk -v sign=&#34;$sign&#34; '{if ($1 == sign ) print $1 }'

From the awk man page:

The option [...]]]></description>
			<content:encoded><![CDATA[<p>While there seems nothing wrong with this:</p>
<pre class="brush: bash;">
sign=&quot;--&quot;
awk '{if ($1 == $sign ) print $1 }'
</pre>
<p>..it doesn&#8217;t give the intended result. To be able to use bash variables in awk, you first need to assign the variables with the -v option:</p>
<pre class="brush: bash;">
sign=&quot;--&quot;
awk -v sign=&quot;$sign&quot; '{if ($1 == sign ) print $1 }'
</pre>
<p>From the awk man page:</p>
<pre class="brush: plain;">
The option -v followed by var=value is an assignment to be done before (the awk) prog is  executed;  any  number  of  -v  options  may be present.
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/04/using-bash-variables-in-awk/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
