<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>in all things code</description><title>no cruft</title><generator>Tumblr (3.0; @nocruft)</generator><link>http://nocruft.com/</link><item><title>Creating a LocalTunnel on dotCloud</title><description>&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to install LocalTunnel on &lt;a href="http://dotcloud.com"&gt;dotCloud&lt;/a&gt;, use this repo: &lt;a href="https://github.com/cyounkins/tunnel-on-dotcloud"&gt;https://github.com/cyounkins/tunnel-on-dotcloud&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you participate in a lot of hackathons or just want to expose a certain port on a development box to theInterwebs™, there&amp;#8217;s a really useful app that performs all the ssh magic from one of the &lt;a href="http://twilio.com"&gt;Twilio&lt;/a&gt; engineers, &lt;a href="http://progrium.com/localtunnel/"&gt;http://progrium.com/localtunnel/&lt;/a&gt; .  Installing this rubygem magically assigns an unused proxied subdomain from localtunnel.com so you can show off your wares.&lt;/p&gt;

&lt;p&gt;While &lt;strong&gt;extremely&lt;/strong&gt; useful in the one-off hackathon world, it&amp;#8217;s a bit problematic if your app connects to a number of external services.  Each time you&amp;#8217;re assigned a different proxied subdomain from localtunnel, you&amp;#8217;ll have to log into aforementioned services and change the callback urls or update a mystical dns redirect entry - both undesirable behaviors&amp;#8230; especially having done this several umpteen times. :)&lt;/p&gt;

&lt;p&gt;Having stumbled upon this dotCloud blog entry, &lt;a href="http://blog.dotcloud.com/open-your-local-webapp-to-the-web-with-dotclo"&gt;http://blog.dotcloud.com/open-your-local-webapp-to-the-web-with-dotclo&lt;/a&gt; and walked the tutorial, the repo referenced didn&amp;#8217;t actually have a working nginx.conf file to do the proxying - looks to be commented out and missing a few other directives.  In any case, thank you Interwebs, here&amp;#8217;s a working repo: &lt;a href="https://github.com/cyounkins/tunnel-on-dotcloud"&gt;https://github.com/cyounkins/tunnel-on-dotcloud&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a note, make sure you kill any open ssh sessions in dotCloud.  If you&amp;#8217;re careless like me with a lot of tmux sessions open, you&amp;#8217;ll often get &amp;#8220;Warning: remote port forwarding failed for listen port 8042&amp;#8221; which generally translates to &amp;#8220;Close your other open ssh sessions&amp;#8221;&lt;/p&gt;</description><link>http://nocruft.com/post/34101870958</link><guid>http://nocruft.com/post/34101870958</guid><pubDate>Mon, 22 Oct 2012 11:26:46 -0400</pubDate><category>dotcloud</category><category>localtunnel</category><category>devops</category></item><item><title>Ignoring changes in git submodules</title><description>&lt;p&gt;For those Vimmers using &lt;a href="https://github.com/tpope/vim-pathogen"&gt;Pathogen&lt;/a&gt; to manage your runtime path, you&amp;#8217;ll find that Pathogen creates tags files in the bundle&amp;#8217;s doc folder.&lt;/p&gt;

&lt;p&gt;Thanks to this &lt;a href="http://stackoverflow.com/questions/4343544/generating-tags-to-different-location-by-pathogen#4346300"&gt;Stack Overflow post&lt;/a&gt;, all you need is Git 1.7.2 and the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt; for s in `git submodule  --quiet foreach 'echo $name'`; 
      do git config submodule.$s.ignore untracked; 
 done
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Happy Vimming!&lt;/p&gt;</description><link>http://nocruft.com/post/23415665986</link><guid>http://nocruft.com/post/23415665986</guid><pubDate>Sun, 20 May 2012 11:08:00 -0400</pubDate><category>git</category><category>vim</category></item><item><title>Avoiding the ESC key in Vim (and Readline)</title><description>&lt;p&gt;It&amp;#8217;s probably safe to say that I should&amp;#8217;ve changed this (ugh) habit years ago, but I just never got around to it. Thanks to &lt;a href="https://twitter.com/#!/stephenliu"&gt;Stephen&lt;/a&gt;, I&amp;#8217;ve finally updated my &lt;a href="https://github.com/ryankanno/vim-config"&gt;.vimrc&lt;/a&gt; to exit insert mode using:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;inoremap jk &amp;lt;ESC&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Yay!&lt;/p&gt;

&lt;p&gt;More importantly, if you tend to set vi editing mode in readline, you definitely want to change its bindings as well. I found this &lt;a href="http://vim.wikia.com/wiki/Avoid_the_escape_key"&gt;gem&lt;/a&gt; hidden deep in the &lt;a href="http://vim.wikia.com/wiki/Vim_Tips_Wiki"&gt;Vim Tips Wiki&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All you have to do is edit your .inputrc file with the following:
    set editing-mode vi
    set keymap vi&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$if mode=vi
    set keymap vi-command
    "ii": vi-insertion-mode
    set keymap vi-insert
    "jk": vi-movement-mode
$endif
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;As a note:&lt;/strong&gt; Readline will pick these settings up for every readline enabled app (IPython, etc)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Happy Vimming&lt;/strong&gt;! :D&lt;/p&gt;</description><link>http://nocruft.com/post/22528784313</link><guid>http://nocruft.com/post/22528784313</guid><pubDate>Sun, 06 May 2012 14:01:18 -0400</pubDate><category>vim</category><category>vimrc</category><category>readline</category><category>configuration</category></item><item><title>Where did all my disk space go?</title><description>&lt;h4&gt;&amp;#8212; Update&lt;/h4&gt;

&lt;p&gt;Thanks to @pgr0ss for the tip, you can use -k instead of &amp;#8212;block-size!&lt;/p&gt;

&lt;p&gt;On my cloud servers, I&amp;#8217;m always asking myself:&lt;/p&gt;



&lt;blockquote&gt;&#13;
&lt;p&gt;Where the&amp;#160;!@#$% did all my disk space go?&lt;/p&gt;&#13;
&lt;/blockquote&gt;



&lt;p&gt;And I know somewhere, sometime down the road, future self will be thanking present self for blogging this as a reminder.&lt;/p&gt;



&lt;p&gt;&lt;strong&gt;To get the top &amp;lt;n&amp;gt; offending directories on your filesystem (replace &amp;lt;n&amp;gt; with a number)&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&#13;
&lt;script src="https://gist.github.com/2403558.js" type="text/javascript"&gt;&lt;![CDATA[// &lt;![CDATA[
// &lt;![CDATA[
// &lt;![CDATA[
// &lt;![CDATA[
 
// ]]]]]]]]]]&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;
// ]]]]]]]]&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;
// ]]]]]]&gt;&lt;![CDATA[&gt;&lt;![CDATA[&gt;
// ]]]]&gt;&lt;![CDATA[&gt;]]&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;via &lt;a href="http://linuxreviews.org/quicktips/chkdirsizes/"&gt;&lt;a href="http://linuxreviews.org/quicktips/chkdirsizes/"&gt;http://linuxreviews.org/quicktips/chkdirsizes/&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://nocruft.com/post/21255169523</link><guid>http://nocruft.com/post/21255169523</guid><pubDate>Tue, 17 Apr 2012 00:41:00 -0400</pubDate><category>linux</category></item><item><title>Access to OS X pasteboard in tmux/screen</title><description>&lt;p&gt;If you&amp;#8217;re having trouble accessing pbcopy/pbpaste from tmux and/or an unpatched screen, check out &lt;a href="https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git"&gt;&lt;a href="https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git"&gt;https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;Clone repo&lt;/li&gt;
&lt;li&gt;Run makefile&lt;/li&gt;
&lt;li&gt;Add to path (or add symlink on path)&lt;/li&gt;
&lt;li&gt;Add &lt;span&gt;&lt;strong&gt;set-option -g default-command &amp;#8220;reattach-to-user-namespace -l zsh&amp;#8221;&lt;/strong&gt; or whatever your favorite shell is in your .tmux.conf&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;code!&lt;/strong&gt;&lt;/p&gt;</description><link>http://nocruft.com/post/17319005177</link><guid>http://nocruft.com/post/17319005177</guid><pubDate>Thu, 09 Feb 2012 10:00:05 -0500</pubDate><category>tmux</category><category>screen</category><category>mac os x</category></item><item><title>Getting uWSGI + init.d playing nicely on Ubuntu 11.10</title><description>&lt;div&gt;
&lt;p&gt;A few weeks ago, I wanted to install uWSGI on my Ubuntu 11.10 box for &lt;a href="http://allb.us"&gt;&lt;a href="http://allb.us"&gt;http://allb.us&lt;/a&gt;&lt;/a&gt;.  After having gone through the standard aptitude/pip installs to get uwsgi installed, I noticed after running the init.d scripts, absolutely nothing would happen. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;zip. nada. zilch.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;No log file + no uwsgi process == a lot of sad pandas.&lt;/p&gt;
&lt;p&gt;After having searched &lt;a href="http://stackoverflow.com"&gt;stackoverflow&lt;/a&gt;, it was quite apparent that I wasn&amp;#8217;t the only &lt;a href="http://serverfault.com/questions/208079/cant-start-uwsgi-in-ubuntu-10-10"&gt;unlucky&lt;/a&gt; soul to encounter this error.  To debug the uwsgi init.d script, I used the trusty &lt;a href="http://linux.101hacks.com/bash-scripting/debug-a-shell-script/"&gt;set -xv trick&lt;/a&gt; atop to see the omgwtfbbqs.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a few things I realized:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;The configuration file in /etc/uwsgi/apps-enabled must contain one of the recognized uwsgi configuration file extensions.  Initially, I symlinked my configuration file from the apps-available directory as allbus.  &lt;strong&gt;It didn&amp;#8217;t like that at all&lt;/strong&gt;.  I renamed the symlink to allbus.xml.&lt;/li&gt;
&lt;li&gt;The start-stop-daemon in the init.d script is being passed the location to the pid file via &amp;#8212;pid-file instead of being told to create the pid file via the &amp;#8212;make-pid-file option.  Thus, you need to make sure your uwsgi configuration file contains a directive to create the file at the same location the init.d script is looking for it.  &lt;strong&gt;*Note*&lt;/strong&gt;: Take a look at the &amp;lt;pidfile&amp;gt; configuration.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Here&amp;#8217;s a gist I created of the xml uwsgi configuration I used for my Django application. Hopefully it helps save someone from the hour I spent in startup script hell. Enjoy! :D&lt;/p&gt;
&lt;p&gt;
&lt;script src="https://gist.github.com/1721819.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;/div&gt;</description><link>http://nocruft.com/post/17196363313</link><guid>http://nocruft.com/post/17196363313</guid><pubDate>Mon, 06 Feb 2012 23:46:00 -0500</pubDate><category>init.d</category><category>ubuntu</category><category>uwsgi</category><category>devops</category></item><item><title>Passing in a custom port to ssh-copy-id</title><description>&lt;div&gt;
&lt;p&gt;Thank you, #lazyweb.&lt;/p&gt;
&lt;p&gt;After years of using ssh-copy-id to drop public keys into a remote machine&amp;#8217;s authorized keys, I finally found a post showing how to use the script to connect to a remote machine running on a custom port.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://it-ride.blogspot.com/2009/11/use-ssh-copy-id-on-different-port.html"&gt;&lt;a href="http://it-ride.blogspot.com/2009/11/use-ssh-copy-id-on-different-port.html"&gt;http://it-ride.blogspot.com/2009/11/use-ssh-copy-id-on-different-port.html&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note: &lt;/strong&gt;This would&amp;#8217;ve been apparent if I had just cat the script&amp;#8230; but man, am I lazy. :D&lt;/p&gt;
&lt;/div&gt;</description><link>http://nocruft.com/post/17196245080</link><guid>http://nocruft.com/post/17196245080</guid><pubDate>Mon, 30 Jan 2012 00:00:00 -0500</pubDate><category>ssh</category><category>ssh-copy-id</category></item></channel></rss>
