<?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>Popcornfarmer.com &#187; gibberish</title>
	<atom:link href="http://www.popcornfarmer.com/category/gibberish/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.popcornfarmer.com</link>
	<description>an unlikely place for a CS grad student.</description>
	<lastBuildDate>Wed, 21 Jul 2010 02:33:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>SSH Tunneling Tutorial</title>
		<link>http://www.popcornfarmer.com/2009/01/ssh-tunneling-tutorial/</link>
		<comments>http://www.popcornfarmer.com/2009/01/ssh-tunneling-tutorial/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 22:57:41 +0000</pubDate>
		<dc:creator>twood</dc:creator>
				<category><![CDATA[gibberish]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://www.popcornfarmer.com/?p=225</guid>
		<description><![CDATA[Note: this post is another technical one, so if you are a member of my immediate family, you probably won&#8217;t find it of much interest.  If &#8220;ports&#8221; make you think of boats (rather than the numbers 80 and 22), then why don&#8217;t you mosey on over to my christmas photos? I frequently have trouble communicating [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note: this post is another technical one, so if you are a member of my immediate family, you probably won&#8217;t find it of much interest.  If &#8220;ports&#8221; make you think of boats (rather than the numbers 80 and 22), then why don&#8217;t you mosey on over to my <a href="http://picasaweb.google.com/twwood/Christmas08#">christmas photos</a>? </em></p>
<p>I frequently have trouble communicating between systems which are separated by different private LANs. This often happens when you have your computer on a home wireless network which is separated from the rest of the internet via a router and firewall.  Fortunately, SSH tunnels can be used to link these machines together, provided you know which ports need to be interfaced and you have a common server which both machines can reach. Here is how.<span id="more-225"></span></p>
<h4>Remote Access with SSH</h4>
<p>Normally SSH is used to remotely log into servers in order to run commands or copy files. However, SSH can also be used to create &#8220;tunnels&#8221; between two servers. These tunnels are particularly useful for two reasons: they are encrypted and you can make network traffic going to one system magically appear at the end of the tunnel.</p>
<p>There are two basic kinds of SSH tunnels: remote and local. In all cases you create a tunnel that connects one port number on a remote server to a port on the local machine where you run the command.</p>
<p>Note: The commands here are primarily geared towards computers running linux or mac os x, although widows users can do the same if they install cygwin.</p>
<p><strong>Remote Tunnels</strong> are used to forward all traffic from some remote port back to your own system. You would do this if you want to run a web server or some other service on your own machine, but the remote server can&#8217;t reach it because of your router. In effect, you are creating a listener on the remote machine which will accept the webpage requests, and forward them to your own computer.</p>
<p style="text-align: center;"><img class="size-full wp-image-237 aligncenter" title="remote" src="http://www.popcornfarmer.com/log/wp-content/uploads/2009/01/remote.png" alt="remote" width="306" height="105" /></p>
<p>You can create a remote tunnel with the following command:</p>
<pre>ssh -R *:8080:localhost:80 user@remoteserver.com -N ## run this on home
## -R   = remote tunnel
## 8080 = port on remote machine that will accept traffic
## 80   = port on local machine to forward traffic to
## -N   = creates the ssh connection without opening an interactive shell
## -f   = (optional) use this to make the command create the tunnel
##         and return immediately.</pre>
<p>This will make it so that all requests on the remoteserver.com to port 8080 are redirected to <em>home</em> port 80 (the default web server port). However, the remote tunnel only makes it so users on remoteserver.com itself are able to utilize the port forward. Thus localhost:8080 tunnels correctly from that server, but remoteserver.com:8080 will not go through the tunnel. To let a third user access the website, we need to also create a local tunnel.</p>
<p style="text-align: center;"><img class="size-full wp-image-236 aligncenter" title="nolocal" src="http://www.popcornfarmer.com/log/wp-content/uploads/2009/01/nolocal.png" alt="nolocal" width="518" height="105" /></p>
<p><strong>Local Tunnels</strong> let you make a port on your own machine actually send traffic to a port on a remote machine. Often you need to combine a remote and a local tunnel if you want a user within a second private LAN to reach your machine.</p>
<pre>ssh -L 8888:localhost:8080 remoteserver.com -N ## run this on work
## -L   = create a local tunnel
## 8888 = the port on the local machine for the tunnel entrance
## 8080 = the port on the remote machine</pre>
<p>This will make it so that from the perspective of users on <em>work</em>, requests to localhost:8888 are forwarded to remoteserver.com:8080.  This in turn is connected to the original tunnel, creating the full tunnel back to <em>home</em>.</p>
<p style="text-align: center;"><img class="size-full wp-image-235 aligncenter" title="local" src="http://www.popcornfarmer.com/log/wp-content/uploads/2009/01/local.png" alt="local" width="494" height="105" /></p>
<p>These kinds of tunnels can be very useful for connecting systems separated by routers and firewalls. Depending on the application you are trying to reach, you will need to use a different port number. Here is a <a href="http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers">good list</a> of commonly used port numbers.</p>
<p>Of course there are some security implications here and your company IT people may not like these tunnels much. In effect, this lets you connect any two machines, even if they are supposed to be separated by secure VPNs. Of course, since only one port is being opened, and the commands generally aren&#8217;t left running for a long time, it shouldn&#8217;t be an issue.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.popcornfarmer.com/2009/01/ssh-tunneling-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Easy as&#8230;cake</title>
		<link>http://www.popcornfarmer.com/2008/10/easy-ascake/</link>
		<comments>http://www.popcornfarmer.com/2008/10/easy-ascake/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 02:30:40 +0000</pubDate>
		<dc:creator>twood</dc:creator>
				<category><![CDATA[gibberish]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.popcornfarmer.com/?p=144</guid>
		<description><![CDATA[I&#8217;ve been trying out CakePHP, a framework for creating DB driven PHP based websites using the MVC design pattern. Warning: In case the above sentence didn&#8217;t make this clear, this post is largely technical gibberish. If that&#8217;s not your thing, then you can move along and look at the pretty pictures from a hiking trip [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.cakephp.org"><img class="alignright size-full wp-image-149" style="border:none" title="cake-logo" src="http://www.popcornfarmer.com/log/wp-content/uploads/2008/10/cake-logo.png" alt="" width="180" height="180" /></a>I&#8217;ve been trying out <a href="http://cakephp.org/">CakePHP</a>, a framework for creating DB driven PHP based websites using the MVC design pattern.</p>
<p><em>Warning: In case the above sentence didn&#8217;t make this clear, this post is largely technical gibberish. If that&#8217;s not your thing, then you can move along and look at the pretty pictures from a hiking trip up <a href="http://picasaweb.google.com/twwood/MtMonadnock#">Mt. Monadnock</a> from back in September. </em></p>
<p>My feelings with CakePHP so far are mixed. As with many open source projects, the documentation for getting started is a little rough.  To help with that, here is the list of resources I&#8217;ve found most useful so far.</p>
<p><span id="more-144"></span></p>
<h4>CakePHP Tutorials</h4>
<p><a href="http://www.ibm.com/developerworks/edu/os-dw-os-php-cake1.html">IBM&#8217;s Cake Tutorial</a> &#8211; 5 parts, including scaffolding and baking (topics not included in the Cake Book tutorial). Also has section on user authentication. In some ways the blog demo below is a better place to start since it gives you a more complete application quicker, but once you have the basic idea down this is full of good information, and I&#8217;ve only gone through part 1 so far&#8230;</p>
<p><a href="http://book.cakephp.org/view/219/Blog">The Cake Book Blog Tutorial</a> &#8211; provides a good step by step guide for making a simple blog, but does not discuss the &#8220;bake&#8221; command or anything about personalizing the appearance of the site.</p>
<p><a href="http://www.pseudocoder.com/archives/2008/02/10/cakephp-tutorials/">List of Cake Tutorials</a> &#8211; links to lots of good information, although a lot of it is beyond my level right now. Hopefully I&#8217;ll get to the AJAX tutorials and do some nifty stuff.</p>
<h4>General Documentation</h4>
<p><a href="http://book.cakephp.org/">The Cake Book</a> &#8211; seems like it has a lot of useful information, including a guide to the MVC principles.  Some intro material is too basic, and other parts are too advanced, so it is a little hard to find the right pieces.</p>
<p><a href="http://www.avatarfinancial.com/pages/cake/">21 Things</a> &#8211; some good tidbits not covered in the docs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.popcornfarmer.com/2008/10/easy-ascake/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac Home and End Keys</title>
		<link>http://www.popcornfarmer.com/2008/04/mac-home-and-end-keys/</link>
		<comments>http://www.popcornfarmer.com/2008/04/mac-home-and-end-keys/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 03:55:39 +0000</pubDate>
		<dc:creator>twood</dc:creator>
				<category><![CDATA[gibberish]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[keys]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.popcornfarmer.com/?p=64</guid>
		<description><![CDATA[Sorry this is not a very exciting post, but it will probably be useful for somebody&#8230; For some reason the people at Apple think that the Home and End keys should scroll you to the top or bottom of a document rather than the start or end of a line. After searching far and wide, [...]]]></description>
			<content:encoded><![CDATA[<p><em>Sorry this is not a very exciting post, but it will probably be useful for somebody&#8230;</em></p>
<p>For some reason the people at Apple think that the Home and End keys should scroll you to the top or bottom of a document rather than the start or end of a line. After searching far and wide, I have finally found how to get back what I consider the normal functionality in a bunch of applications I regularly use: the terminal, Firefox, Emacs, and Eclipse.<span id="more-64"></span></p>
<h4>Firefox 3</h4>
<p><em>Update: The authors have made a <a href="http://mavaball.net/wiki/index.php/Keyfixer">GREAT firefox extension</a> which will handle fixing your key bindings automatically.</em></p>
<p>I have been using the Firefox 3 beta on my Mac and it has a bunch of new nice features. Unfortunately, it is a bit confused about home/end keys. To fix it, download the tookit.jar file <a href="http://blog.qelix.com/2008/02/14/homeend-keyfixer-for-firefox-3-beta3/" target="_blank">from this blog</a> and follow the <a href="http://blog.qelix.com/2007/12/23/homeend-keyfixer-for-firefox-3/" target="_blank">directions on this page</a>. It says it is designed for Firefox 3 beta 4, but it seems to work fine on beta 5 as well.</p>
<h4>Terminal</h4>
<p>In fact, I&#8217;ve given up on the default Mac terminal &#8211; the default hot keys were inconvenient (ctrl+} to switch tabs?!) and the home/end keys didn&#8217;t work as I&#8217;d like.  Now I use <a href="http://iterm.sourceforge.net/" target="_blank">iTerm</a>, which is a very nice replacement. It easily lets you set up all of the keyboard shortcuts you want for common actions and lets you bookmark a server so that when you hit a shortcut it automatically opens a new terminal with an ssh connection to the server you want. It has some other handy features like being able to &#8220;Send input to all tabs&#8221; &#8211; I often have five or six tabs open and need to run the same command on all of them.  Just enable this mode and anything you type gets sent to all of your open tabs.  Very handy.</p>
<h4>Aquamacs (Fancy Emacs)</h4>
<p>I&#8217;m not a complete fanatic about either of the emacs or vim editors, but there is a pretty good mac port of emacs called <a href="http://aquamacs.org/" target="_blank">Aquamacs</a> which I have been using. The main thing I like (which others might dislike) is that it lets you use a combination of traditional emacs key bindings, plus all of the regular Mac OS shortcuts (ie to save a file, either press apple+s or ctrl-x-s).  Unfortunately it starts out with some bad keybindings for home/end.  Luckily, I found this fix from <a href="http://harold.hotelling.net/blog/?p=29" target="_blank">Stuff &amp; Things</a>.</p>
<p>Create a <em>.emacs</em> file in your home directory with this text in it:<br />
<code>;;; for Aquamacs Emacs, they set some keys in<br />
;;; the osx-key-mode-map, and make it a more<br />
;;; default keymap than global-map.<br />
(if (boundp 'osx-key-mode-map)<br />
(setq hah-key-map osx-key-mode-map)<br />
(setq hah-key-map global-map))(define-key hah-key-map [home]   'beginning-of-line)<br />
(define-key hah-key-map [end]    'end-of-line)<br />
(define-key hah-key-map [C-home] 'beginning-of-buffer)<br />
(define-key hah-key-map [C-end]  'end-of-buffer)<br />
</code><br />
<a href="http://harold.hotelling.net/blog/?p=29" target="_blank"></a></p>
<h4>Eclipse</h4>
<p>Eclipse is an IDE primarily for the Java programming language, but has plugin support for C/C++ and others. It is a pretty nice development environment, but once again the mac version comes with some ridiculous key bindings.  Here is how to reset them to something reasonable.</p>
<ul>
<li>Eclipse Menu-&gt;Preferences</li>
<li>Select General-&gt;Keys</li>
<li>Change bindings for:
<ul>
<li>Next/Previous Word</li>
<li>Select Next/Previous Word</li>
<li>Text End/Start</li>
<li>Select Text End/Start</li>
<li>Line Start/End</li>
<li>Select Line Start/End</li>
</ul>
</li>
</ul>
<p>Find each command using the filter/search box, then click &#8220;Remove Binding&#8221; and press the desired key sequence you would like.</p>
<p><strong>Note:</strong> For some reason these preferences are specific to each workspace, so you will have to do this for every project!  Anyone know a better way?</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-4292156418072848";
/* 468x60, created 5/18/09 (popcorn) */
google_ad_slot = "1285617214";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.popcornfarmer.com/2008/04/mac-home-and-end-keys/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Adapting to a Macbook</title>
		<link>http://www.popcornfarmer.com/2008/03/adapting-to-a-macbook/</link>
		<comments>http://www.popcornfarmer.com/2008/03/adapting-to-a-macbook/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 20:05:14 +0000</pubDate>
		<dc:creator>twood</dc:creator>
				<category><![CDATA[gibberish]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.popcornfarmer.com/2008/03/adapting-to-a-macbook/</guid>
		<description><![CDATA[I recently got a shiny new Macbook from my advisor. While I&#8217;ve briefly used a Mac a few times in the past, this is the first time that I&#8217;ve ever really worked on one. I can appreciate that it is a very attractive laptop, but I&#8217;m less convinced that this machine is supposed to provide [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.popcornfarmer.com/log/wp-content/uploads/2008/03/macbook.jpg" alt="macbook" align="left" />I recently got a shiny new Macbook from my advisor. While I&#8217;ve briefly used a Mac a few times in the past, this is the first time that I&#8217;ve ever really <em>worked</em> on one. I can appreciate that it is a very attractive laptop, but I&#8217;m less convinced that this machine is supposed to provide the ultimate user friendly experience, particularly for users who like flexibility in how they work on their system. I make an effort not to complain about things here since that is what 90% of blogs are, but unfortunately I need to relax that rule for this post&#8230;<span id="more-50"></span></p>
<h4>Design and Layout</h4>
<p>Of course it is very pretty. It is smooth and shiny with some great curves (for a laptop). The trackpad has a nice feel, and scrolling up and down in documents is <em>great</em> &#8211; you just use two fingers and move them up or down and somehow it figures everything out for you. On the other hand, it only has one button. I have never understood why apple only puts one button on its mice since being able to right click to get a menu is an extremely handy thing. This really represents the basic apple design philosophy to me &#8211; cut out the extras to make things simple for someone just learning, often at the expensive of power and flexibility for more advanced users. While you can get around this by either holding special keys or tapping with two fingers, there remains now way to do things like drag the cursor while the right mouse button is clicked, something I use regularly for shortcuts in Firefox.</p>
<h4>Shortcut Keys</h4>
<p><img src="http://www.popcornfarmer.com/log/wp-content/uploads/2008/03/key-symbols.gif" alt="mac-keys" align="left" />The result of the Mac being so simplified is that it becomes increasingly important to know complicated shortcut keys in order to get anything done. Sometimes this is quite confusing, for example on the Macbook keyboard the arrow keys also work as the page up/down and home/end keys. I&#8217;m fine with them reducing the number of keys on the keyboard by doubling these up, but it doesn&#8217;t make any sense at all that to use home and end you need to press the &#8220;apple&#8221; key and an arrow, while to use page up and page down you need to hold the &#8220;fn&#8221; key and an arrow.  Why not be consistent?</p>
<p>The symbol representation of keys on the apple keyboard and within applications adds even more confusion. In windows, a shortcut will typically be labeled as &#8220;ctrl-z&#8221; or &#8220;alt-n&#8221;, while on the mac they insist on using bizarre symbols to represent the ctrl or alt keys as shown to the left. It would be fine if those symbols were also printed on the keyboard, but they are not.  How am I supposed to guess that a weird picture of a stair case with a minus sign on it corresponds to &#8220;alt&#8221; (oops, I guess it is technically called &#8220;option&#8221;). Even their special apple key (already a symbol) requires a second symbol to be represented on screen. No key should require two graphical symbols (an apple with a bite out of it and the crazy indescribable shape at left), a full text name (command), and an abbreviation (cmd).</p>
<h4>The Menu Bar and Windows</h4>
<p>In Windows and Linux, every window has its own menu bar with things like &#8220;File&#8221;, &#8220;Edit&#8221;, etc. On the Mac, there is only one such menu bar, and it always resides at the very top of the screen. For a windows/linux user, this is a bit confusing at first, but isn&#8217;t too bad to get used to, although it becomes more of a problem if you hook a second monitor to your laptop, since you only get a menu bar on one screen.</p>
<p>What is a problem though, is how the buttons to start programs on the Apple &#8220;dock&#8221; tie in to these windows. The dock is similar to the start bar in Windows, and the first time you click on a button for, say, Firefox, it will open up a new window for that program. But then suppose you decide you want to open a second Firefox window.  You&#8217;d think you could just click that handy Firefox button again, but sadly no. Since Apple has eliminated any sort of task bar listing what programs are currently open, the dock must function as both a place to start apps and to see what is running.  Thus  clicking that Firefox button merely highlights your previously opened window, it doesn&#8217;t open a new one. To actually open a new window, you must navigate through the  menus, or learn some keyboard shortcuts (and memorize the figure above).</p>
<h4>In the End</h4>
<p>Clearly some of my issues with a Mac originate from me being a long time Windows/Linux user, but even so, it is not clear to me why the Mac needs to be different in so many cases. Life for everyone would just be so much simpler if there was a little communication between these manufacturers so that in all of the operating systems &#8220;ctrl-c&#8221; would be copy, rather than having to switch between that and &#8220;apple-c&#8221; when I change machines.</p>
<p>The Macbook also clearly has some benefits over previous machines I&#8217;ve used. The fact that there is a very limited set of supported hardware does mean that things are more stable (although clearly that comes at a cost). As someone used to the power of a Linux terminal, I greatly appreciate that OS X is based on BSD (essentially Linux), providing me at least one familiar interface. This also makes it relatively easy to run a lot of open source software originally designed for Linux, which is great since otherwise Mac software choices can be limited.</p>
<p>The design is very pretty, and the small power adapter and magnetic plug are nice touches. In the end, the Mac&#8217;s simplicity does make it beautiful and makes some things very easy, but it also can make some trivial tasks seem complicated and prevents the power and flexibility which many people have gotten used to from more general purpose operating systems like Windows and Linux.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.popcornfarmer.com/2008/03/adapting-to-a-macbook/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Winter View</title>
		<link>http://www.popcornfarmer.com/2008/01/winter-view/</link>
		<comments>http://www.popcornfarmer.com/2008/01/winter-view/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 17:59:13 +0000</pubDate>
		<dc:creator>twood</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[gibberish]]></category>
		<category><![CDATA[outdoors]]></category>
		<category><![CDATA[blue house]]></category>
		<category><![CDATA[winter]]></category>

		<guid isPermaLink="false">http://www.popcornfarmer.com/?p=41</guid>
		<description><![CDATA[We&#8217;ve had a very snowy winter this year in Massachusetts. This animated image shows the view from my bedroom window looking out down our driveway. The pictures were taken sporadically since we had a big snow in early December. Click the picture for a full version (a large 2MB file). Since I&#8217;m sure to forget [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.popcornfarmer.com/log/wp-content/uploads/2008/01/blueview.gif" title="winter view small"><img src="http://www.popcornfarmer.com/log/wp-content/uploads/2008/01/bluesmall.gif" alt="winter view small" align="left" /></a>We&#8217;ve had a very snowy winter this year in Massachusetts. This animated image shows the view from my bedroom window looking out down our driveway. The pictures were taken sporadically since we had a big snow in early December. Click the picture for a full version (a large 2MB file).</p>
<p>Since I&#8217;m sure to forget how I made this, here is what I did using the <a href="http://www.imagemagick.org/script/index.php">Imagemagick </a>program:</p>
<ul>
<li><font color="#339966">convert -delay 100 -loop 0 IMG*.jpg output.gif</font>   &#8212;&#8211; 1 second delay between fames, loops forever, uses all files like IMG_XXX.jpg to make the image</li>
<li><font color="#339966">convert output.gif -resize 20% small.gif</font> &#8212;&#8211; resizes the image to 20%</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.popcornfarmer.com/2008/01/winter-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.409 seconds -->
