<?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>Rusty Razor Blade &#187; tips</title>
	<atom:link href="http://www.rustyrazorblade.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rustyrazorblade.com</link>
	<description>Tech Thoughts, Mostly on LAMP - by Jon Haddad</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:03:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Open New Terminal Tip</title>
		<link>http://www.rustyrazorblade.com/2011/12/open-new-terminal-tip/</link>
		<comments>http://www.rustyrazorblade.com/2011/12/open-new-terminal-tip/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 23:37:08 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1564</guid>
		<description><![CDATA[<p>I tend to open up several terminals when working on a project, so I usually want them to start in the same directory I&#8217;ve been working with. Stick this in your ~/.bash_profile to have your new terminal windows automatically cd to the directory you last used.</p> <p>export PROMPT_COMMAND='echo `pwd` > ~/.lastpwd'<br /> cd `cat ~/.lastpwd [...]]]></description>
			<content:encoded><![CDATA[<p>I tend to open up several terminals when working on a project, so I usually want them to start in the same directory I&#8217;ve been working with.  Stick this in your ~/.bash_profile to have your new terminal windows automatically cd to the directory you last used.</p>
<p><code>export PROMPT_COMMAND='echo `pwd` > ~/.lastpwd'<br />
cd `cat ~/.lastpwd `</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2011/12/open-new-terminal-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple Filetypes in Vim</title>
		<link>http://www.rustyrazorblade.com/2011/04/multiple-filetypes-in-vim/</link>
		<comments>http://www.rustyrazorblade.com/2011/04/multiple-filetypes-in-vim/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 23:11:36 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[tips]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1459</guid>
		<description><![CDATA[<p>I&#8217;m finding this useful as I work with snipmate and have defined custom snippets for solr config files. I still want to use the XML filetype, but I have no real use for the solr fields outside of editing the schema.xml file.</p> <p>set filetype=xml.solr</p> <p>Booya.</p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m finding this useful as I work with snipmate and have defined custom snippets for solr config files.  I still want to use the XML filetype, but I have no real use for the solr fields outside of editing the schema.xml file.</p>
<p><code>set filetype=xml.solr</code></p>
<p>Booya.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2011/04/multiple-filetypes-in-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH with multiple hops</title>
		<link>http://www.rustyrazorblade.com/2011/04/ssh-with-multiple-hops/</link>
		<comments>http://www.rustyrazorblade.com/2011/04/ssh-with-multiple-hops/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 01:25:28 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1380</guid>
		<description><![CDATA[<p>Excellent question on <a href="http://superuser.com/questions/96489/ssh-tunnel-via-multiple-hops">superuser.com</a> with a fantastic answer. If anyone needs to jump through multiple servers via ssh (or any other protocol) take a look at <a href="http://superuser.com/questions/96489/ssh-tunnel-via-multiple-hops">this answer.</a></p> <p>ssh -L 9999:localhost:9999 host1 ssh -L 9999:localhost:1234 -N host2</p>]]></description>
			<content:encoded><![CDATA[<p>Excellent question on <a href="http://superuser.com/questions/96489/ssh-tunnel-via-multiple-hops">superuser.com</a> with a fantastic answer.  If anyone needs to jump through multiple servers via ssh (or any other protocol) take a look at <a href="http://superuser.com/questions/96489/ssh-tunnel-via-multiple-hops">this answer.</a></p>
<p><code>ssh -L 9999:localhost:9999 host1 ssh -L 9999:localhost:1234 -N host2</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2011/04/ssh-with-multiple-hops/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using iWatch to Automatically Run Unit Tests (Linux)</title>
		<link>http://www.rustyrazorblade.com/2011/02/using-iwatch-to-automatically-run-unit-tests-linux/</link>
		<comments>http://www.rustyrazorblade.com/2011/02/using-iwatch-to-automatically-run-unit-tests-linux/#comments</comments>
		<pubDate>Thu, 24 Feb 2011 02:13:37 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1340</guid>
		<description><![CDATA[<p>iWatch is a perl script that uses inotify to monitor files directories. It&#8217;s similar to the watch tool, which can do all sorts of stuff if the files or directories it&#8217;s watching are modified or affected in pretty much any way at all.</p> <p>Install iWatch</p> <p>apt-get install iwatch</p> <p>I&#8217;ve got this 1 liner in a [...]]]></description>
			<content:encoded><![CDATA[<p>iWatch is a perl script that uses inotify to monitor files directories.  It&#8217;s similar to the watch tool, which can do all sorts of stuff if the files or directories it&#8217;s watching are modified or affected in pretty much any way at all.</p>
<p>Install iWatch</p>
<blockquote><p>apt-get install iwatch</p></blockquote>
<p>I&#8217;ve got this 1 liner in a file to quickly watch my directory and execute a PHP unit test .</p>
<blockquote><p>#!/bin/bash<br />
iwatch -c &quot;phpunit $1&quot; -t &#8216;.*php$&#8217; -r -v -x ./.git -e modify .
</p></blockquote>
<p>I run this with a my argument (a unit test) and then sit there and code away.  When I save, it detects the change and automatically runs my test.  It&#8217;s pretty awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2011/02/using-iwatch-to-automatically-run-unit-tests-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running Erlang Code from the Command Line</title>
		<link>http://www.rustyrazorblade.com/2010/07/running-erlang-code-from-the-command-line/</link>
		<comments>http://www.rustyrazorblade.com/2010/07/running-erlang-code-from-the-command-line/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 18:31:31 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[erlang]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1105</guid>
		<description><![CDATA[<p>This was really useful for me in scripting TextEdit to run my unit tests, as Erlide has been crashing every time I use it.</p> erl -run mymodule myfunc -run init stop -noshell <p><a href='Running Erlang Code From the Command Line'>http://www.trapexit.org/Running_Erlang_Code_From_The_Command_Line</a></p>]]></description>
			<content:encoded><![CDATA[<p>This was really useful for me in scripting TextEdit to run my unit tests, as Erlide has been crashing every time I use it.</p>
<pre>
erl -run mymodule myfunc -run init stop -noshell
</pre>
<p><a href='Running Erlang Code From the Command Line'>http://www.trapexit.org/Running_Erlang_Code_From_The_Command_Line</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/07/running-erlang-code-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textmate &#8211; Stop ._ Backup Files</title>
		<link>http://www.rustyrazorblade.com/2010/02/textmate-stop-_-backup-files/</link>
		<comments>http://www.rustyrazorblade.com/2010/02/textmate-stop-_-backup-files/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 04:08:46 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[textmate]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=1001</guid>
		<description><![CDATA[<p>Pretty sure this stops TextMate from creating the ridiculous backup files in my network shares.</p> <p>defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1</p>]]></description>
			<content:encoded><![CDATA[<p>Pretty sure this stops TextMate from creating the ridiculous backup files in my network shares.</p>
<blockquote><p>defaults write com.macromates.textmate OakDocumentDisableFSMetaData 1</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/02/textmate-stop-_-backup-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux/OSX: find out what network ports are in use</title>
		<link>http://www.rustyrazorblade.com/2010/01/linuxosx-find-out-what-network-ports-are-in-use/</link>
		<comments>http://www.rustyrazorblade.com/2010/01/linuxosx-find-out-what-network-ports-are-in-use/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 19:21:07 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=951</guid>
		<description><![CDATA[<p>To get a quick idea of what ports you have open on your local box, you can use nmap.</p> <p> ~ jhaddad$ nmap localhost<br /> Starting Nmap 5.00 ( http://nmap.org ) at 2010-01-05 11:06 PST<br /> Interesting ports on localhost (127.0.0.1):<br /> Not shown: 499 closed ports, 492 filtered ports<br /> PORT STATE SERVICE<br /> [...]]]></description>
			<content:encoded><![CDATA[<p>To get a quick idea of what ports you have open on your local box, you can use nmap.</p>
<blockquote><p>
~ jhaddad$ nmap localhost<br />
Starting Nmap 5.00 ( http://nmap.org ) at 2010-01-05 11:06 PST<br />
Interesting ports on localhost (127.0.0.1):<br />
Not shown: 499 closed ports, 492 filtered ports<br />
PORT      STATE SERVICE<br />
80/tcp    open  http<br />
88/tcp    open  kerberos-sec<br />
548/tcp   open  afp<br />
631/tcp   open  ipp<br />
3306/tcp  open  mysql<br />
3325/tcp  open  unknown<br />
5900/tcp  open  vnc<br />
9000/tcp  open  cslistener<br />
10000/tcp open  snet-sensor-mgmt
</p></blockquote>
<p>For more detailed information, try netstat:</p>
<blockquote><p>netstat -an</p></blockquote>
<p>You&#8217;ll get a breakdown of every socket open on your machine &#8211; useful for figuring out who&#8217;s connected and from where.</p>
<p>The OSX version of netstat lacks a few options &#8211; such as the useful &#8216;-p&#8217; option to display the process id (PID) &#8211; which can be useful combined with kill to get rid of unwanted connections &#8211; for instance,an SSH tunnel accidentally left open.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2010/01/linuxosx-find-out-what-network-ports-are-in-use/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MacBook Air Battery Drain While Sleeping</title>
		<link>http://www.rustyrazorblade.com/2009/12/macbook-air-battery-drain-while-sleeping/</link>
		<comments>http://www.rustyrazorblade.com/2009/12/macbook-air-battery-drain-while-sleeping/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 19:54:53 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=948</guid>
		<description><![CDATA[<p>I bought a MacBook Air in June this year, refurbished. I didn&#8217;t really use it a lot for day to day work, and when I didn&#8217;t use it I was charging it. It was very convenient &#8211; it weighs practically nothing and has almost no impact on me while traveling. When I cut back on [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.rustyrazorblade.com/wp-content/uploads/2009/12/CCF3038A-5A01-412B-B13C-7F24B836F6DC.jpg" alt="CCF3038A-5A01-412B-B13C-7F24B836F6DC.jpg" border="0" width="127" height="95" align="right" />I bought a MacBook Air in June this year, refurbished.  I didn&#8217;t really use it a lot for day to day work, and when I didn&#8217;t use it I was charging it.  It was very convenient &#8211; it weighs practically nothing and has almost no impact on me while traveling.  When I cut back on using it, I noticed a few things.</p>
<ol>
<li>When I&#8217;d leave it unplugged for a few days, the battery would be dead.  After a bit of testing I noticed I was losing roughly 25% of my battery life overnight if it wasn&#8217;t unplugged.
</li>
<li>It started creaking when I&#8217;d open it.  I was genuinely concerned it would just fall apart when I was trying to open it.</li>
</ol>
<p>Obviously both of these things suck, so after a bit I brought it to the Apple store.  They pretty much replaced everything in it &#8211; battery, logic board, screen bezel, hinges, and gave it back to me.  So problem #2 was solved, but for some reason I kept seeing the battery issue.</p>
<p>I brought it back Monday of this week.  The guy there (Ryan) explained to me that since I wasn&#8217;t up to date w/ my software, the tech guys would basically just give it back and refuse to work on it.  He suggested resetting the PRAM and calibrating the battery.  He also didn&#8217;t seem to think that losing 25% battery overnight was weird, even though I&#8217;ve owned 2 MacBook Pros and 2 iBooks that never had this issue &#8211; I could leave my MacBook Pro unplugged for days and it would only lose a few %.  </p>
<p>I did these things, but it didn&#8217;t make a difference.  It was only after a ton of looking around that someone suggested turning off bluetooth.</p>
<p>After turning off bluetooth, I let the laptop sit overnight in sleep.  I checked it the next morning, and it was only down 4% from the night before.  Huge improvement.  I think I could have accomplished the same thing if I turned off the &#8220;Allow Bluetooth devices to wake this computer&#8221; setting, but since I&#8217;m not using it, I&#8217;d rather just disable it.</p>
<p>Anyway, if anyone knows anything else about this issue, I&#8217;m interested to find out more.  I like the Air as a &#8220;sit on the couch and browse the web&#8221; laptop, hate it for doing any sort of IDE development.  Also not great for playing Scrabble on Facebook &#8211; it can&#8217;t hold the entire board on the screen.  Lame.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/12/macbook-air-battery-drain-while-sleeping/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interesting Programmer Links</title>
		<link>http://www.rustyrazorblade.com/2009/04/interesting-programmer-links/</link>
		<comments>http://www.rustyrazorblade.com/2009/04/interesting-programmer-links/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 19:47:08 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=606</guid>
		<description><![CDATA[<a href="http://blog.evanweaver.com/articles/2009/04/20/peeping-into-memcached/">Peeping into memcached</a>. <p>Really interesting read about how to examine what&#8217;s stored in memcached. </p> <p>Peep uses ptrace to freeze a running memcached server, dump the internal key metadata, and return the server to a running state. If you have a good host ejection mechanism in your client, such as in the Twitter libmemcached [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://blog.evanweaver.com/articles/2009/04/20/peeping-into-memcached/">Peeping into memcached</a>.</li>
<p>Really interesting read about how to examine what&#8217;s stored in memcached.  </p>
<blockquote><p>Peep uses ptrace to freeze a running memcached server, dump the internal key metadata, and return the server to a running state. If you have a good host ejection mechanism in your client, such as in the Twitter libmemcached builds, you won&#8217;t even have to change the production server pool. The instance is not restarted, and no data is lost.</p></blockquote>
<li><a href="http://dev.mysql.com/tech-resources/articles/mysql-54.html">Quick look at MySQL 5.4</a>
</li>
<p>Highlights include scalability improvements, subquery optimizations and join improvements, improved stored procedure management, out parameters in prepared statements, and new information schema additions.</p>
<li><a href="http://www.easyvmx.com/new-easyvmx.shtml">EasyVMX</a></li>
<p>EasyVMX lets you create empty VMWare images.  Very useful when coupled with the <a href="http://www.vmware.com/products/player/">VMWare player</a>.</p>
<li><a href="http://www.atlassian.com/starter/?s_kwcid=HM_Starter">For the next 5 days you can get Jira 5 user license for $5.</a></li>
<p>I used Jira about 3 years ago at Infosearch Media, which I don&#8217;t think exists any more.  Anyway, it trounced bugzilla then and still does.  </p>
<li><a href="http://geektips.patg.net/?p=24">A cool rundown on what you can do with the information schema in MySQL.  </a></li>
<p>I like this post, it makes a few really cool points.  It explains how to get a list of all tables and their engine and how to get a list of foreign keys in your schema.  Very cool.</p>
<li><a href="http://q4m.31tools.com/">Q4M</a>, a Queue storage engine</li>
<p>Q4M looks like a pretty cool storage engine that aims to address twitter-like features.  I&#8217;ll be trying this out for myself in the near future.</p>
<blockquote><p>Q4M (Queue for MySQL) is a message queue licensed under GPL that works as a pluggable storage engine of MySQL 5.1, designed to be robust, fast, flexible. It is already in production quality, and is used by several web services (see Users of Q4M).</p></blockquote>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2009/04/interesting-programmer-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling libjpeg on 64 bit Centos</title>
		<link>http://www.rustyrazorblade.com/2008/07/compiling-libjpeg-on-64-bit-centos/</link>
		<comments>http://www.rustyrazorblade.com/2008/07/compiling-libjpeg-on-64-bit-centos/#comments</comments>
		<pubDate>Mon, 07 Jul 2008 22:14:55 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.rustyrazorblade.com/?p=136</guid>
		<description><![CDATA[<p>I ran into an issue just now compiling libjpeg on 64 bit CentOS. I found <a href="http://www.noah.org/wiki/Jpegsrc_64">this very helpful post</a> that gives a workaround using a config.guess file from libtool. For some reason, I didn&#8217;t have the folder he suggested, but I did have the alternative (automake).</p> <p>cp /usr/share/automake-1.9/config.guess .<br /> cp /usr/share/automake-1.9/config.sub . </p> [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue just now compiling libjpeg on 64 bit CentOS.  I found <a href="http://www.noah.org/wiki/Jpegsrc_64">this very helpful post</a> that gives a workaround using a config.guess file from libtool.  For some reason, I didn&#8217;t have the folder he suggested, but I did have the alternative (automake).</p>
<blockquote><p>cp /usr/share/automake-1.9/config.guess .<br />
cp /usr/share/automake-1.9/config.sub .
</p></blockquote>
<p>I copied the above files into my jpeg-6b directory, and</p>
<blockquote><p>./configure &#8211;enable-shared &#8211;enable-static</p></blockquote>
<p>worked correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rustyrazorblade.com/2008/07/compiling-libjpeg-on-64-bit-centos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

