<?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>

  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-11783069-1’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();</description><title>sandbox</title><generator>Tumblr (3.0; @marktran)</generator><link>http://mark.nirv.net/</link><item><title>run-it</title><description>&lt;p&gt;I deployed a NodeJS &lt;a href="http://expressjs.com/"&gt;Express&lt;/a&gt; app behind an nginx reverse proxy and wanted to have the &lt;em&gt;node&lt;/em&gt; process supervised so it would automatically be restarted after crashes. I learned about a nifty service supervision suite called &lt;a href="http://smarden.org/runit/"&gt;runit&lt;/a&gt; (inspired by D.J. Bernstein’s &lt;a href="http://cr.yp.to/daemontools.html"&gt;daemontools&lt;/a&gt;) from working at &lt;a href="http://cloudkick.com"&gt;Cloudkick&lt;/a&gt; that would be perfect for the job.&lt;/p&gt;

&lt;p&gt;runit has a prgram called &lt;a href="http://smarden.org/runit/runsvdir.8.html"&gt;runsvdir&lt;/a&gt; that monitors a particular directory for subdirectories that represent services. It launches a &lt;a href="http://smarden.org/runit/runsv.8.html"&gt;runsv&lt;/a&gt; process for every subdirectory and runsv executes a &lt;em&gt;run&lt;/em&gt; script that you create to execute your service. In the Debian runit package, runsvdir watches &lt;em&gt;/etc/service&lt;/em&gt; though you should create your service directory under &lt;em&gt;/etc/sv&lt;/em&gt; and symlink it into &lt;em&gt;/etc/service&lt;/em&gt; so you can test your run scripts.&lt;/p&gt;

&lt;p&gt;The catch was, I wanted to run &lt;em&gt;node&lt;/em&gt; with an unprivileged user and have the service directory in my home directory so I didn’t have to bother with sudoing. This is possible by having another runsvdir process &lt;a href="http://smarden.org/runit/faq.html#userservices"&gt;monitor /home/mark/service&lt;/a&gt;. Here’s how I set it up:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/etc/sv/
|-- runsvdir-mark/
      |-- log/
      |    |-- main/
      |    `-- run*
      `-- run*  

/etc/service/
`-- runsvdir-mark@ -&gt; /etc/sv/runsvdir-mark/

/etc/sv/runsvdir-mark/run:  
#!/bin/sh
exec 2&gt;&amp;1
exec chpst -u mark runsvdir /home/mark/service/

/etc/sv/runsvdir-mark/log/run:
#!/bin/sh
exec chpst svlogd -tt ./main/

.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;With that, there’s now a runsvdir process monitoring /home/mark/service. I then created:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/home/mark/service
|-- aubergine-0/
      |-- log/
      |    |-- main/
      |    `-- run*
      `-- run*  

/home/mark/service/aubergine-0/run:
#!/bin/sh
exec 2&gt;&amp;1
exec chpst -e /home/mark/service/aubergine-0/env \
node /home/mark/code/aubergine/aubergine.js

/home/mark/service/aubergine-0/log/run:
#!/bin/sh
exec chpst svlogd -tt ./main/
&lt;/code&gt;&lt;/pre&gt;</description><link>http://mark.nirv.net/post/840821325</link><guid>http://mark.nirv.net/post/840821325</guid><pubDate>Wed, 21 Jul 2010 07:05:00 -0700</pubDate></item><item><title>Slow sudoing</title><description>&lt;p&gt;I’ve been noticing that using &lt;em&gt;sudo&lt;/em&gt; was taking an unusually long time to execute on my &lt;a href="http://prgmr.com"&gt;prgmr&lt;/a&gt; server—commands like &lt;strong&gt;sudo vim /tmp/foo&lt;/strong&gt; would hang for 3-5 seconds before finally opening vim for editing. I assumed it was due to poor I/O in a shared environment, but it persisted for a while so I finally decided to investigate.&lt;/p&gt;

&lt;p&gt;It turns out every time you use sudo, PAM tries to resolve your IP. There’s more detail in Redhat’s Bugzilla, &lt;a href="https://bugzilla.redhat.com/show_bug.cgi?id=479464"&gt;bug #479464&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The solution is to add your hostname to &lt;em&gt;/etc/hosts&lt;/em&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;127.0.0.1 &lt;HOSTNAME&gt;.&lt;DOMAIN&gt; &lt;ALIAS&gt;
&lt;/code&gt;&lt;/pre&gt;</description><link>http://mark.nirv.net/post/840627279</link><guid>http://mark.nirv.net/post/840627279</guid><pubDate>Wed, 21 Jul 2010 05:47:00 -0700</pubDate></item><item><title>"To make it hard to quit they got a dog together. It’s supposed to be the company’s dog,..."</title><description>“To make it hard to quit they got a dog together. It’s supposed to be the company’s dog, not either of theirs individually. The idea being that now the company can’t go away or there’s no one to take care of the dog. Increased the burn rate a little but turned out to be a net win.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://news.ycombinator.com/item?id=1498086"&gt;pg&lt;/a&gt; on the founders of &lt;a href="https://www.wepay.com"&gt;WePay&lt;/a&gt;.&lt;/em&gt;</description><link>http://mark.nirv.net/post/787397879</link><guid>http://mark.nirv.net/post/787397879</guid><pubDate>Thu, 08 Jul 2010 18:23:39 -0700</pubDate><category>startups</category></item><item><title>http://en.wikipedia.org/wiki/Dino-Riders</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_kx8u1jNz6m1qz58p6o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Dino-Riders"&gt;&lt;a href="http://en.wikipedia.org/wiki/Dino-Riders"&gt;http://en.wikipedia.org/wiki/Dino-Riders&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://mark.nirv.net/post/367921976</link><guid>http://mark.nirv.net/post/367921976</guid><pubDate>Tue, 02 Feb 2010 18:10:31 -0800</pubDate></item><item><title>Floyd’s “tortoise and the hare” cycle-finding...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_ktdvybC6UC1qz58p6o1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Cycle_detection#Tortoise_and_hare"&gt;Floyd’s “tortoise and the hare” cycle-finding algorithm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’d like to see &lt;a href="http://www.lisperati.com"&gt;Conrad Barski&lt;/a&gt; illustrate an algorithms book.&lt;/p&gt;</description><link>http://mark.nirv.net/post/250236401</link><guid>http://mark.nirv.net/post/250236401</guid><pubDate>Thu, 19 Nov 2009 17:25:00 -0800</pubDate></item><item><title>delicious Bookmarklet for Opera</title><description>&lt;p&gt;Compatible with the recent &lt;a href="http://blog.delicious.com/blog/2008/07/oh-happy-day.html"&gt;delicious update&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;a href="opera:/button/Go%20to%20page,%22javascript:(function()%7Blocation.href='http://delicious.com/save?url='+encodeURIComponent(window.location.href)+'&amp;title='+encodeURIComponent(document.title)+'&amp;v=5&amp;jump=yes'%7D)();%22,,%22post%20to%20delicious%22,Compose%20mail"&gt;“post to delicious” bookmarklet&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://mark.nirv.net/post/44917130</link><guid>http://mark.nirv.net/post/44917130</guid><pubDate>Wed, 06 Aug 2008 02:48:00 -0700</pubDate></item><item><title>Hung Up on SSH?</title><description>&lt;p&gt;”~.” to disconnect.&lt;/p&gt;</description><link>http://mark.nirv.net/post/36142618</link><guid>http://mark.nirv.net/post/36142618</guid><pubDate>Mon, 26 May 2008 16:40:00 -0700</pubDate></item><item><title>Guilty Pleasures</title><description>&lt;p&gt;I sometimes edit my .emacs file in vim.&lt;/p&gt;</description><link>http://mark.nirv.net/post/6694167</link><guid>http://mark.nirv.net/post/6694167</guid><pubDate>Wed, 25 Jul 2007 01:38:00 -0700</pubDate></item><item><title>Oy! Traffic Cops</title><description>&lt;p&gt;I just discovered a show called &lt;a href="http://uktv.co.uk/people/item/aid/571903"&gt;Traffic Cops&lt;/a&gt; that airs on BBC One/UKTV People. It’s essentially the British version of “Cops” with less trash.&lt;/p&gt;

&lt;p&gt;The British police look pretty spiffy in their &lt;a href="http://www.idruna.com/images/PhojoCustomerPhotos/MaxNash.jpg"&gt;uniforms&lt;/a&gt; and Volvos.&lt;/p&gt;</description><link>http://mark.nirv.net/post/3750668</link><guid>http://mark.nirv.net/post/3750668</guid><pubDate>Mon, 18 Jun 2007 06:32:00 -0700</pubDate></item><item><title>Slim-Vim</title><description>&lt;p&gt;Larry Clapp &lt;a href="http://www.lispniks.com/pipermail/slim-vim/2007-May/000555.html"&gt;announced&lt;/a&gt; that he is abandoning development on Slim-Vim.&lt;/p&gt;

&lt;p&gt;:(&lt;/p&gt;</description><link>http://mark.nirv.net/post/2809709</link><guid>http://mark.nirv.net/post/2809709</guid><pubDate>Fri, 01 Jun 2007 20:56:00 -0700</pubDate></item><item><title>Spork Ion3</title><description>&lt;p&gt;&lt;a href="http://www.mail-archive.com/ion-general@lists.berlios.de/msg01957.html"&gt;Tuomo Valkonen on Ion3&lt;/a&gt;: “I’m not going to make it easy for all the forkers…”&lt;/p&gt;

&lt;p&gt;What a prick. I’m going to give &lt;a href="http://xmonad.org"&gt;xmonad&lt;/a&gt; a shot.&lt;/p&gt;</description><link>http://mark.nirv.net/post/2485175</link><guid>http://mark.nirv.net/post/2485175</guid><pubDate>Sat, 26 May 2007 15:13:00 -0700</pubDate></item><item><title>HTTP Referer</title><description>&lt;p&gt;I was writing a WordPress plugin earlier today and noticed  an inconsistency in spelling while referencing other plugins..&lt;/p&gt;

&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Referrer"&gt;Wikipedia on Referrer&lt;/a&gt;: “Referer is a common misspelling of the word referrer. It is so common, in fact, that it made it into the official specification of HTTP – the communication protocol of the World Wide Web – and has therefore become the standard industry spelling when discussing HTTP referers.”&lt;/p&gt;

&lt;p&gt;Use a spell checker next time, asshole.&lt;/p&gt;</description><link>http://mark.nirv.net/post/2482591</link><guid>http://mark.nirv.net/post/2482591</guid><pubDate>Sat, 26 May 2007 12:43:00 -0700</pubDate></item><item><title>Ellipses</title><description>&lt;p&gt;Ellipses are too long. I prefer to use “..” as a fair middleground between a period and full-blown ellipsis.&lt;/p&gt;</description><link>http://mark.nirv.net/post/2482087</link><guid>http://mark.nirv.net/post/2482087</guid><pubDate>Sat, 26 May 2007 12:30:03 -0700</pubDate></item></channel></rss>

