<?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>Labnotes &#187; Search Results  &#187;  mysql</title>
	<atom:link href="http://labnotes.org/search/mysql/feed/rss2/" rel="self" type="application/rss+xml" />
	<link>http://labnotes.org</link>
	<description></description>
	<lastBuildDate>Mon, 20 May 2013 21:00:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Rounded Corners 417 — A student of how things fall apart</title>
		<link>http://labnotes.org/2013/04/06/rounded-corners-417-a-student-of-how-things-fall-apart/</link>
		<comments>http://labnotes.org/2013/04/06/rounded-corners-417-a-student-of-how-things-fall-apart/#comments</comments>
		<pubDate>Sun, 07 Apr 2013 03:00:27 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1910</guid>
		<description><![CDATA[§ Tidbits of developer best practices from around the web. Stuff you&#8217;ve seen before, collected in one README.md: When I hear &#8220;JUST BANG OUT CODE THAT WORKS&#8221; I think of all the apps I don&#8217;t use anymore because they gradually lost &#8230; <a href="http://labnotes.org/2013/04/06/rounded-corners-417-a-student-of-how-things-fall-apart/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>§</strong> <a title="https://github.com/timoxley/best-practices" href="https://github.com/timoxley/best-practices">Tidbits of developer best practices from around the web</a>. Stuff you&#8217;ve seen before, collected in one README.md:</p>
<blockquote><p>When I hear &#8220;JUST BANG OUT CODE THAT WORKS&#8221; I think of all the apps I don&#8217;t use anymore because they gradually lost the ability to iterate.</p></blockquote>
<blockquote><p>– Avdi Grimm</p></blockquote>
<p><strong>§</strong> <a title="http://blogs.hbr.org/cs/2013/04/the_hidden_biases_in_big_data.html" href="http://blogs.hbr.org/cs/2013/04/the_hidden_biases_in_big_data.html">The Hidden Biases in Big Data</a>. TL;DR there&#8217;s a digital divide, and big data is biased towards one side of that divide.</p>
<p><strong>§</strong> <a title="http://inductionapp.com/" href="http://inductionapp.com/">Induction — a new kind of tool designed for understanding and communicating relationships in data</a>. Supports PostgreSQL, MySQL, SQLite, Redis, and MongoDB out-of-the-box.</p>
<p><strong>§</strong> <a title="http://haiku.nytimes.com/" href="http://haiku.nytimes.com/">Times Haiku, a collection of Haiku found in The New York Times</a>. <a title="http://haiku.nytimes.com/post/46843029333/as-an-engineer-im-sort-of-a-student-of-how-thin" href="http://haiku.nytimes.com/post/46843029333/as-an-engineer-im-sort-of-a-student-of-how-thin">Love this one</a>:</p>
<blockquote><p>As an engineer,<br />
<span style="font-family: Georgia, 'Bitstream Charter', serif; font-style: italic;">I&#8217;m sort of a student of<br />
</span><span style="font-family: Georgia, 'Bitstream Charter', serif; font-style: italic;">how things fall apart.</span></p></blockquote>
<p><strong>§</strong> <a title="https://twitter.com/ericbogs/status/319547456369070080" href="https://twitter.com/ericbogs/status/319547456369070080">Eric Bogs</a>:</p>
<blockquote><p>If Tetris has taught me anything, it is that errors pile up and accomplishments disappear.</p></blockquote>
<p><strong>§</strong> <a title="https://twitter.com/RichRogersHDS/status/319601521081864192" href="https://twitter.com/RichRogersHDS/status/319601521081864192">Rich Rogers</a>:</p>
<blockquote><p>&#8220;A good programmer is someone who looks both ways before crossing a one-way street.&#8221; &#8211; Doug Linder</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2013/04/06/rounded-corners-417-a-student-of-how-things-fall-apart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounded Corners 348 – No manual deployment goes unpunished</title>
		<link>http://labnotes.org/2012/03/31/rounded-corners-348-no-manual-deployment-goes-unpunished/</link>
		<comments>http://labnotes.org/2012/03/31/rounded-corners-348-no-manual-deployment-goes-unpunished/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 00:40:42 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1711</guid>
		<description><![CDATA[Stateless Stop writing classes (or how to avoid unnecessary state) Stored Everything you need to know about Redis persistence and how it compares to Postgresql and MySQL: From a more practical point of view Redis provides both AOF and RDB snapshots, that &#8230; <a href="http://labnotes.org/2012/03/31/rounded-corners-348-no-manual-deployment-goes-unpunished/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.intercom.io/whats-in-a-name/"><img class="alignnone" src="http://blog.intercom.io/wp-content/uploads/2012/03/Android-or-Condom.jpg" alt="" width="390" height="331" /></a></p>
<p><strong>Stateless </strong><a href="http://www.youtube.com/watch?feature=player_embedded&amp;v=o9pEzgHorH0">Stop writing classes</a> (or how to avoid unnecessary state)</p>
<p><strong>Stored</strong> Everything you need to know <a href="http://antirez.com/post/redis-persistence-demystified.html">about Redis persistence</a> and how it compares to Postgresql and MySQL:</p>
<blockquote><p>From a more practical point of view Redis provides both AOF and RDB snapshots, that can be enabled simultaneously (this is the advised setup, when in doubt), offering at the same time easy of operations and data durability.</p></blockquote>
<p><strong>Thinking </strong><a href="http://weblog.therealadam.com/2012/03/24/learn-unix-the-jesse-storimer-way/">Learn Unix the Jesse Storimer way</a>:</p>
<blockquote><p>Read concise programs, cross-reference them with manual pages. Try writing your own stuff. Rinse. Repeat.</p></blockquote>
<p><strong>RCP over TCP </strong>Catch the Replay &#8211; <a href="http://blog.dotcloud.com/catch-the-replay-build-reliable-traceable-dis">Build reliable, traceable, distributed systems with ZeroMQ</a>.</p>
<p><strong>Defaults</strong> Lots of <a href="https://gist.github.com/2260182">useful OS X settings</a> you can enable/disable from the command line.</p>
<p><strong>So true </strong><a href="http://plasmasturm.org/log/6debug/">The six stages of debugging</a>.</p>
<p><strong>The kitchen</strong> <a href="http://www.toolness.com/wp/2012/03/coffee-machines-and-community/">On coffee machines and communities</a>.</p>
<p><strong>QotD</strong> <a href="https://twitter.com/#!/roidrage/status/184329674871144449">Mathias Meyer</a>:</p>
<blockquote><p>No manual deployment goes unpunished.</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2012/03/31/rounded-corners-348-no-manual-deployment-goes-unpunished/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounded Corners 288 — /proc</title>
		<link>http://labnotes.org/2011/09/20/rounded-corners-288-%e2%80%94-proc/</link>
		<comments>http://labnotes.org/2011/09/20/rounded-corners-288-%e2%80%94-proc/#comments</comments>
		<pubDate>Tue, 20 Sep 2011 16:00:11 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1608</guid>
		<description><![CDATA[/proc usp.ruby is a mailing list about Unix system programming in Ruby. Not system level programming, for that you&#8217;ll need some C face time, rather writing Ruby applications and using all the firepower Unix provides (much of which also applies to OS &#8230; <a href="http://labnotes.org/2011/09/20/rounded-corners-288-%e2%80%94-proc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>/proc</strong> usp.ruby is a mailing list about <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/387563">Unix system programming in Ruby</a>. Not system level programming, for that you&#8217;ll need some C face time, rather writing Ruby applications and using all the firepower Unix provides (much of which also applies to OS X). If your platform is Unix, make the most of it. If not, switch. Some good stuff already in the archives.</p>
<p><strong>Queued</strong> There are two things you can do with a relational databases. One, use it as a relational database. Two, try to work around the inconvenience of it being a relational databases. At which point you might be wondering, can I use MySQL as a queue? <a href="http://www.engineyard.com/blog/2011/5-subtle-ways-youre-using-mysql-as-a-queue-and-why-itll-bite-you/">Yes, but don&#8217;t</a>.</p>
<p><strong>Private browsing</strong> not always so private. If you&#8217;re interested in details, here&#8217;s an analysis of <a href="http://crypto.stanford.edu/~dabo/pubs/papers/privatebrowsing.pdf">private browsing modes in different browsers</a> (PDF).</p>
<p><strong>Ensemble</strong> Installing <del>Rails and MySQL</del> Node.js and MongoDB on <a href="http://cloud.ubuntu.com/2011/09/node-js-and-mongodb-on-ubuntu/">Ubuntu using Ensemble</a>. Also my introduction to <a href="https://juju.ubuntu.com/"><del>Ensemble</del> Juju</a>. Also, I can&#8217;t keep track.</p>
<p><strong>gzip bloom</strong> <a href="http://giovanni.bajo.it/2011/09/golomb-coded-sets/">Golomb-coded sets</a> are compressed Bloom filters. Quite useful when you&#8217;ve got spare CPU cycles but short on storage.</p>
<p><strong>Signal</strong> Turns out Lion ships with a <a href="http://subrosasoft.com/blog/2011/09/hidden-wi-fi-diagnostics-tool-in-mac-os-x-10-7-lion/">hidden WiFi diagnostic tool</a> (also not-so hidden WiFi connectivity issues) that&#8217;s quite nifty.</p>
<p><strong>No browser love</strong> Ever wondered why restaurant web sites are so horribly bad? <a href="http://www.slate.com/id/2301228/pagenum/all/#p2">Slate answers</a>.</p>
<p><strong>Pr0n</strong> Just as important, <a href="http://www.forbes.com/sites/julieruvolo/2011/09/07/how-much-of-the-internet-is-actually-for-porn/">how much of the Internet is really porn</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2011/09/20/rounded-corners-288-%e2%80%94-proc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Travis CI</title>
		<link>http://labnotes.org/2011/08/10/travis-ci/</link>
		<comments>http://labnotes.org/2011/08/10/travis-ci/#comments</comments>
		<pubDate>Wed, 10 Aug 2011 08:11:31 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1560</guid>
		<description><![CDATA[José Valim: Travis is like Github for CIs. So easy to setup that everyone does it. It&#8217;s the new awesomesauce. If you need continuous integration for your open source projects than Travis CI is a no brainer. It&#8217;s free. It &#8230; <a href="http://labnotes.org/2011/08/10/travis-ci/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://labnotes.org/wp-content/uploads/2011/08/travis.png" alt="" title="travis" width="600" height="343" class="aligncenter size-full wp-image-1563" /></p>
<p><strong><a href="http://twitter.com/#!/josevalim/status/97338403816873985">José Valim</a><a></a></strong>:</p>
<blockquote><p>Travis is like Github for CIs. So easy to setup that everyone does it.</p></blockquote>
<p>It&#8217;s the <a href="http://travis-ci.org/">new awesomesauce</a>.</p>
<p>If you need continuous integration for your open source projects than Travis CI is a no brainer. It&#8217;s free. It works. It&#8217;s trivial to setup. If you don&#8217;t know you need CI for your open source project … that&#8217;s topic for another post.</p>
<p>It&#8217;s &#8220;an open-source, distributed build system for the Ruby community&#8221;, but if you&#8217;re willing to violate these ToS, you can also use it on Node.js projects. See <a href="https://github.com/assaf/zombie/blob/master/.travis.yml">this little hack</a>.</p>
<p>You might have to fiddle with the <a href="http://about.travis-ci.org/docs/user/build-configuration/">.travis.yml</a> file, but setting up a build matrix in a text file is orders of magnitude easier than using a Web UI.</p>
<p>Need to test on both Ruby 1.8.7 and Ruby 1.9.2? Run the test suite under <a href="https://github.com/flowtown/rack-oauth2-server/blob/master/.travis.yml">both Rails 2 and Rails 3 setups</a>? Test against <a href="https://github.com/assaf/vanity/blob/master/.travis.yml">MongoDB, MySQL, Postgres and Redis</a>? Done, done and done. </p>
<p>The build configuration is checked into source control, that means, anyone can improve it. Right now I can&#8217;t get the <a href="http://travis-ci.org/#!/assaf/vanity">Vanity tests</a> to pass on 1.8.7 against MySQL, but maybe you can <a href="https://github.com/assaf/vanity/blob/master/.travis.yml">take a look</a> and help? </p>
<p>And — this is my favorite part about Travis CI — anytime you branch or fork a project, you get a new build. Just like that. (If you&#8217;re forking, you&#8217;ll need to <a href="http://travis-ci.org/profile">add your fork</a> to Travis, but that&#8217;s only a click away)</p>
<p>That means you can work on patches in your own branch and run them through the entire build matrix. Just like that.</p>
<p>When it&#8217;s time to contribute your patches to the master branch, you know they won&#8217;t break the build. And if there&#8217;s need to change the build, you can merge these changes too.</p>
<p>If you&#8217;re managing an open source project, you ought to be looking at <a href="http://travis-ci.org/">Travis CI</a>.</p>
<p>I hope soon enough we&#8217;ll be able to use it for our internal build system. Until then, my open source projects are in good hands.</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2011/08/10/travis-ci/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>2011 is year of the Server-Side JavaScript</title>
		<link>http://labnotes.org/2010/12/29/2011-is-year-of-the-server-side-javascript/</link>
		<comments>http://labnotes.org/2010/12/29/2011-is-year-of-the-server-side-javascript/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 08:37:02 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1509</guid>
		<description><![CDATA[Uphill, Both Ways I got interested in JavaScript when it arrived to the world as Netscape LiveScript. It came in two distinct flavors: client-side JavaScript running in the browser, and not many people remember, Server-Side JavaScript for writing the back-end &#8230; <a href="http://labnotes.org/2010/12/29/2011-is-year-of-the-server-side-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h3><img class="alignnone size-full wp-image-1511" title="npm package list | (node package manager) 2" src="http://labnotes.org/wp-content/uploads/2010/12/npm-package-list-node-package-manager-2.png" alt="" width="600" height="338" /></h3>
<h3>Uphill, Both Ways</h3>
<p>I got interested in JavaScript when it arrived to the world as Netscape LiveScript. It came in two distinct flavors: client-side JavaScript running in the browser, and not many people remember, Server-Side JavaScript for writing the back-end logic. I believe back then it was called LiveWire.</p>
<p>Next to client-side Java, client-side JavaScript didn&#8217;t look like much. DHTML was nice, but nothing compared to the promise of <a href="http://www.cs.dartmouth.edu/~dfk/papers/kotz:future2/">mobile agents</a> roaming around the Interwebs doing all sort of fancy tasks on your behalf. If you knew how to develop — back then JavaScript was marketed for the more casual programmer — you ought to be looking at Java Applets.</p>
<p>Then we let a big company full of engineers perched atop their X Server workstations to manage the UX for Java. We know how that turned out.</p>
<p>On the server-side, JavaScript was limited by a crappy standard library, a sluggish implementation, and the cost of a Netscape Enterprise license.[1] Contrast with Java, which came with a rich standard library, adequate performance, and you could either get an open-source server or were busy developing one.[2]</p>
<p>It&#8217;s been longer than a decade since I stopped caring about server-side JavaScript. Now I&#8217;m rebooting that passion. So what changed since?</p>
<h3><strong>Stuff Got Better</strong></h3>
<p>JavaScript is still the same ill-designed language, best known for its high density of &#8220;<a href="http://wtfjs.com/">surely this was designed to confuse</a>&#8221; language elements. Then again, nothing interesting happens around pure and perfect languages, at best, they evolve into <a href="http://www.gnu.org/software/emacs/">text editors</a>. Fortunately, we&#8217;ve got <a href="http://coffeescript.org/">CoffeeScript</a>, a dialect that mixes the better part of Python with the better part of Ruby, and compiles into straightforward JavaScript. It&#8217;s incredibly fun to use.</p>
<p>The library situation has improved tremendously. I remember searching for JavaScript code, only to find snippets of badly written DHTML code. Today? Take a look at this incredible list of <a href="http://npm.mape.me/">Node.js modules</a>. Need a <a href="http://expressjs.com/">Web server framework</a>? <a href="https://github.com/evnm/dropbox-node">Dropbox API</a>? <a href="https://github.com/indexzero/forever">More uptime</a>? <a href="http://projects.nuttnet.net/hummingbird/">Real-time monitoring</a>? <a href="http://vowsjs.org/">Asynchronous BDD</a>? <a href="http://node.io/">Web scraping</a>?</p>
<p>I went looking for database drivers and found one for <a href="https://github.com/masuidrive/node-mysql">MySQL</a>, one for <a href="http://github.com/christkv/node-mongodb-native">MongoDB</a> and three for <a href="https://github.com/mranney/node_redis">Redis</a>. Oh, and a JavaScript implementation of Redis called <a href="https://github.com/janl/awesome">Awesome</a>.[3]</p>
<p>We&#8217;ve got three runtime platforms for choose from: the insanely fast <a href="http://nodejs.org/">Node.js</a>, the JVM-based <a href="http://www.mozilla.org/rhino/">Rhino</a> and it&#8217;s C-based sibling <a href="http://www.mozilla.org/js/spidermonkey/">SpiderMonkey</a>. Competition is healthy. Then again, I&#8217;m betting on Node.js. It&#8217;s brilliantly fast, fun to use, got a story to tell (everything is asynchronous), but mostly, you can choose from a <a href="http://blog.heroku.com/archives/2010/4/28/node_js_support_experimental/">variety</a> of <a href="https://no.de/">hosting</a> <a href="http://www.nodejscloud.com/">solutions</a>.[4]</p>
<p>Yeah, we also got push-button hosting for JavaScript.</p>
<p>Looking for a chance to exercise your JavaScript-fu and prove you understand why 0 == []? You can start by writing a Web application using one of <a href="http://www.sproutcore.com/">many </a><a href="http://code.quirkey.com/sammy/">cool</a> <a href="http://www.sencha.com/">frameworks</a>. Or you can package your HTML-based UI into a <a href="http://www.appcelerator.com/products/titanium-mobile-application-development/">standalone</a> or <a href="http://www.phonegap.com/">mobile</a> application (thanks, Webkit). You could be writing server-side code, or scripting your database: <a href="http://couchdb.apache.org/">CouchDB</a> and <a href="http://www.mongodb.org/">MongoDB</a> both use JavaScript for user code. You can run cronjobs in JavaScript, <a href="http://jashkenas.github.com/coffee-script/documentation/docs/cake.html">replace make</a> or managed your <a href="http://bigeasy.github.com/node-ec2/">EC2 instances</a>.</p>
<p>Better libraries, better performance, and more places to run your code.</p>
<h3>It&#8217;s A Start</h3>
<p>It&#8217;s not all peaches and roses though.[5] Most of the libraries out there are young, buggy and incomplete. I got Node.js to segfault a few times. There&#8217;s no killer framework on the same caliber as Rails, nor anything that comes close to ActiveSupport and a decent standard runtime library (hmm &#8230; that gives me an idea). But then, it&#8217;s not much different than what Ruby was five years ago, or Java back in the late 90&#8242;s. We&#8217;ve all got to start somewhere.</p>
<p>I know I&#8217;m going to be doing a lot more JavaScript in 2011. And much of it will come at the expense of what I currently use Ruby for. I already shifted the balance <a href="http://timely.flowtown.com/">towards applications</a> that use more client-side JavaScript and less server-side Rails. How did it work out? better <a href="http://labnotes.org/2010/11/16/i-love-how-fast-it-is-oauth-2-0-with-sammy-js-sinatra-and-mongodb/">performance</a> and just as easy to maintain. Next, I&#8217;m moving the test suite over to JavaScript thanks to <a href="http://zombie.labnotes.org/">Zombie.js</a>.</p>
<p>So that&#8217;s my plan for 2011, and you should follow me on <a href="https://github.com/assaf">Github</a> and <a href="http://twitter.com/#!/assaf">Twitter</a> to find out what happens.</p>
<p>[1] Netscape actually compiled server-side JavaScript into bytecode, so it wasn&#8217;t all slow. Back on &#8217;95 hardware it felt slow for what little it did. Java Servlets weren&#8217;t speed demons either, but on &#8217;97 hardware and with much more promise, they felt fast enough.</p>
<p>[2] Remember when Java was 10x slower than C, but the language of choice for productive developers? Good times.</p>
<p>[3] I didn&#8217;t mention jQuery since this post is about server-side JavaScript. But jQuery did show the world JavaScript code can be clean, simple and productive. I think it deserves credit in changing people&#8217;s opinion, including of JavaScript as a server-side language.</p>
<p>[4] Node.js is not the first platform to have a good asynchronous story, it&#8217;s just the first platform that many people care to use that has a good asynchronous story. And it&#8217;s not so much about the asynchronous part as it is about a good, compelling story. Rhino&#8217;s story is &#8220;we&#8217;re JavaScript only in Java&#8221; and SpiderMonkey&#8217;s story is &#8220;we&#8217;re not Rhino&#8221;.</p>
<p>[5] Bet you didn&#8217;t know JavaScript™ is now <a href="http://en.wikipedia.org/wiki/JavaScript#Trademark">trademark of Oracle Corp</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2010/12/29/2011-is-year-of-the-server-side-javascript/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Rounded Corners 258 — Taco bell</title>
		<link>http://labnotes.org/2010/10/30/rounded-corners-258-%e2%80%94-taco-bell/</link>
		<comments>http://labnotes.org/2010/10/30/rounded-corners-258-%e2%80%94-taco-bell/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 02:13:57 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1481</guid>
		<description><![CDATA[Bees with machine guns! Low-cost, distributed load-testing using EC2. Using MySQL as a NoSQL &#8211; A story for exceeding 750,000 qps on a commodity server. Brought to you by the NoMySQL movement. Miner finds the hottest upcoming Rubygems jQuery 1.4.3 &#8230; <a href="http://labnotes.org/2010/10/30/rounded-corners-258-%e2%80%94-taco-bell/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://blog.apps.chicagotribune.com/2010/07/08/bees-with-machine-guns/">Bees with machine guns!</a> Low-cost, distributed load-testing using EC2.</p>
<p><a href="http://yoshinorimatsunobu.blogspot.com/2010/10/using-mysql-as-nosql-story-for.html">Using MySQL as a NoSQL</a> &#8211; A story for exceeding 750,000 qps on a commodity server. Brought to you by the NoMySQL movement.</p>
<p><a href="http://minerapp.com/">Miner</a> finds the hottest upcoming Rubygems</p>
<p><a href="http://addyosmani.com/blog/jq143offlinelearningkit/">jQuery 1.4.3 Offline Learning Kit</a></p>
<p><a href="http://teddziuba.com/2010/10/taco-bell-programming.html">Taco Bell Programming</a> — more gets the point across than link bait.</p>
<p>Awesome stuff I never knew <a href="http://playground.deaxon.com/css/">CSS could do</a></p>
<p><a href="http://www.verticalforest.com/2010/10/27/youtube5-version-2/">YouTube5</a> replaces the Flash player on YouTube, Vimeo and Facebook</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2010/10/30/rounded-corners-258-%e2%80%94-taco-bell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My development stack</title>
		<link>http://labnotes.org/2010/06/06/my-development-stack/</link>
		<comments>http://labnotes.org/2010/06/06/my-development-stack/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 02:45:01 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://labnotes.org/?p=1439</guid>
		<description><![CDATA[The best part about working with frameworks and libraries is that you don&#8217;t have to reinvent the wheel.  Someone else did the hard work, and there&#8217;s usually more hard work than meets the eye. The downside is that they&#8217;re never &#8230; <a href="http://labnotes.org/2010/06/06/my-development-stack/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The best part about working with frameworks and libraries is that you don&#8217;t have to reinvent the wheel.  Someone else did the hard work, and there&#8217;s usually more hard work than meets the eye.</p>
<p>The downside is that they&#8217;re never perfect. Other people&#8217;s code may be less buggy than mine, but I still run into bugs that I need to patch.  Then there are incompatibility issues, behavior changes from one release to another, and features I have to extend to meet my specific needs.</p>
<p>Some frameworks and libraries are good for that.  Some, whatever you gained from using them is quickly lost when you have to debug their complex code, get surprised by changing behavior, or struggle to extend them. More than once, I wasted more time using a library than it would take to write it myself.</p>
<p>Over time I settled on a few choice frameworks and libraries where the balance was in favor of saving time and building from other people&#8217;s expertise. Those may not be the most popular choices out there in Ruby land, but they proved to have the best return-on-investment for me. Here&#8217;s a list of my current development stack.</p>
<p><a href="http://gembundler.com/">Bundler</a> — I work on several projects at once, maintaining a single environment for all of them is impossible. Bundler makes the Gem management pain go away. Switch to a different project, or even branch within that project, run <em>bundle exec bash</em> and you&#8217;re done. Also works great when deploying and getting the right environment in production.</p>
<p><a href="http://www.capify.org/index.php/Capistrano">Capistrano</a> — Speaking of deploying, I have some misgivings about Capistrano, but overall it&#8217;s great.</p>
<p><a href="http://rake.rubyforge.org/">Rake</a> — Great for breaking complex jobs into smaller tasks. It&#8217;s easier to develop and test when working one task at a time, it also allows complex jobs to pick up they left off, for example, when you bump into a bug or the unexpected.</p>
<p><a href="http://unicorn.bogomips.org/">Unicorn</a> — My production Web server of choice. I also use it for development. The fact that you can run two or more processes at once makes it faster than Webrick, and when you&#8217;re doing UI work, waiting for Webrick is cycles.</p>
<p><a href="http://github.com/defunkt/resque">Resque</a> — If it doesn&#8217;t have to be done synchronously, I push it off to a Resque worker.</p>
<p><a href="http://github.com/assaf/pipemaster">Pipemaster</a> — Pre-forking server for commands. Think Unicorn (and much of the same code base) but for requests that don&#8217;t come through the Web: cron jobs, command line, inbound emails, etc. I also use it to manage my Resque workers, since it&#8217;s able to hot-deploy new code with a <em>kill -USR2</em>.</p>
<p><a href="http://www.padrinorb.com/">Padrino</a> — A Web framework based on Sinatra. If you like fast, simple and less layers of abstraction between you and HTTP, you ought to check it out.</p>
<p>JSON/JQT — More and more of the UI I&#8217;m working on is going down the path of static HTML pages, JSON data and jQuery templates. Static HTML is easy to cache (on server or client), and JSON data means less load and higher latency. It also doubles as an API.</p>
<p><a href="http://vanity.labnotes.org/">Vanity</a> – I use it for A/B testing and as a metrics dashboard. Some of the metrics come from Google Analytics, some from database queries, or collected by Vanity. Having them all in one place is the easiest way to stay on top of things.</p>
<p><a href="http://mongomapper.com/">MongoMapper</a> — I recently moved away from MySQL to MongoDB. Lots of reasons. MongoMapper is similar in spirit to ActiveRecord, and the API is similar in many ways, but it&#8217;s not a drop-in replacement. I&#8217;d say it&#8217;s re-imagining what an ORM should be for MongoDB. Love it so far.</p>
<p><a href="http://github.com/cpowell/sysloglogger">SyslogLogger</a> — All the logs from all the processes and up in syslog.</p>
<p><a href="http://github.com/thoughtbot/shoulda">Shoulda</a> — The best ideas of BDD with the bullet-proof simplicity of asserts. I use it for unit, functional and integration tests (the later in combination with <a href="http://github.com/brynary/webrat">Webrat</a>).</p>
<p><a href="http://oauth.rubyforge.org/">OAuth</a>/<a href="http://github.com/intridea/oauth2">OAuth2</a> — You already have a Twitter/Facebook/Google account, why not use it to log on?</p>
<p><a href="http://jquery.com/">jQuery</a> — D&#8217;oh.</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2010/06/06/my-development-stack/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Necktie: dress to impress</title>
		<link>http://labnotes.org/2009/11/04/necktie-dress-to-impress/</link>
		<comments>http://labnotes.org/2009/11/04/necktie-dress-to-impress/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 03:59:27 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[880river]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.labnotes.org/?p=1374</guid>
		<description><![CDATA[How Necktie Happened Necktie came about when I needed to automate server configuration for Apartly. We run on EC2, which means instances for production, for staging, and for short-lived tasks like testing out new configuration or performance benchmarking. To get &#8230; <a href="http://labnotes.org/2009/11/04/necktie-dress-to-impress/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h2>How Necktie Happened</h2>
<p><img src="http://blog.labnotes.org/wp-content/uploads/2009/11/3043224232_f11fe25457_m.jpg" alt="3043224232_f11fe25457_m" title="3043224232_f11fe25457_m" width="176" height="240" class="alignleft size-full wp-image-1376" /></p>
<p><a href="http://github.com/assaf/necktie">Necktie</a> came about when I needed to automate server configuration for <a href="http://apartly.com/">Apartly</a>. We run on EC2, which means instances for production, for staging, and for short-lived tasks like testing out new configuration or performance benchmarking.</p>
<p>To get the all instances configured the same way, I wrote a <a href="http://www.capify.org/">Capistrano</a> recipe. I quickly hit the limits of that approach: it would take too long to copy individual files (configs, scripts, etc) from the local box. And I would have to maintain, in addition to the local recipe, a Ruby script to orchestrate everything on the remote machine.</p>
<p>So the next logical step was to pre-package everything — the scripts, configurations, binaries — into a Git repository and have Capistrano clone it on the remote server and run a main script there. It’s similar to cap deploy, except the code you’re deploying and running does things like reloading Nginx with a new configuration, mounting an <a href="http://blog.labnotes.org/2009/10/13/mysql-backups-with-ebs-snapshots/">EBS volume for MySQL</a>, installing cron jobs, stuff like that.</p>
<p>It worked extremely well, but quickly developed into a mishmash of common features and application-specific tasks, part in the application’s own recipe directory, part in a separate Git repository I named necktie. It was begging for extraction.</p>
<p>A few iterations later, and Necktie was born. Necktie is basically a common line tool based on Rake and Git, and a Capistrano task for running it remotely.</p>
<h2>Necktie In 15 Seconds</h2>
<p>To manage a server configuration, you create a Git repository with a Necktie file in it. You use the same repository to hold other files used for setting up a server: config files, cronjobs, scripts, Ruby gems, etc.</p>
<p>If you have more than a handful of tasks you can split them into individual files and place these in the tasks directory.</p>
<p><span id="more-1374"></span>A Necktie repository will look something like this:</p>
<pre>$ tree .necktie
.necktie/
|-- Necktie
|-- etc
|   |-- cron
|   |   `-- snapshot
|   |-- god.rb
|   |-- init.d
|   |   `-- unicorn
|   `-- nginx
|       `-- unicorn.conf
|-- gems
|   |-- memcache-client-1.7.5.gem
|   |-- mysql-2.8.1.gem
|   `-- unicorn-0.93.3.gem
`-- tasks
 |-- app.rb
 |-- deploy.rb
 `-- db.rb</pre>
<p>Separately, I have a Capistrano recipe which contains the following two lines:</p>
<pre>require "necktie/capistrano"
set :necktie_url, "git@example.com:necktie"</pre>
<p>The first line adds the cap necktie task, the second line tells it where to find the necktie repository. Of course, you should be using your own Git repository.</p>
<p>To configure new servers and upgrade existing ones:</p>
<pre>$ git push &amp;&amp; cap necktie</pre>
<p>Life couldn’t be simpler.</p>
<h2>Tasks 101</h2>
<p>The heart of your Necktie repository consists of tasks that configure and setup a server instance. You can mix Ruby and shell commands to write tasks like:</p>
<pre># Create /etc/init.d/unicorn so you can sudo service unicorn restart
cp "etc/init.d/unicorn", "/etc/init.d/"
update "/etc/init.d/unicorn", /^ENV=.*$/, "ENV=#{Necktie.env}"
chmod 0755, "/etc/init.d/unicorn"
services.restart "unicorn"</pre>
<p>In addition to good old Ruby you’ve got direct access to all the <a href="http://ruby-doc.org/core/classes/FileUtils.html">FileUtils</a> methods (cp, mv, chmod, etc), <a href="http://rake.rubyforge.org/">Rake</a>’s sh method and FileList, all of <a href="http://rush.heroku.com/">Rush</a>, and a bunch of niceties like read/write/append/update for processing <a href="http://github.com/assaf/necktie/blob/master/lib/necktie/files.rb">files</a>, <a href="http://github.com/assaf/necktie/blob/master/lib/necktie/gems.rb">install_gem</a> and a thin API around the Linux <a href="http://github.com/assaf/necktie/blob/master/lib/necktie/services.rb">service</a> command.</p>
<p>Besides bringing fresh servers up to speed, you’ll also want to use Necktie to upgrade production server with least amount of down time. To make that easier (and users happier), write tasks that only execute when necessary.</p>
<p>For example, here’s a task that changes the default memcached configuration to listen on all IPs (I’m running this behind a firewall). It’s designed to work if memcached is not running (and in doing so start it), or if memcached is running with the wrong IP address:</p>
<pre>task :memcached do
  # Out of the box, memcached listens to local requests only.
  # Allow access from all servers (in the same security group).
  unless processes.find { |p| p.cmdline[/memcached\s.*-l\s0.0.0.0/] }
    update "/etc/memcached.conf", /^-l 127.0.0.1/, "-l 0.0.0.0"
    services.restart "memcached"
  end
end</pre>
<p>The next task updates an Nginx configuration file and reloads its whenever the configuration file from the Necktie repository (that would be “etc/nginx”) is newer than the configuration file installed on the server (that would be “/etc/nginx”):</p>
<pre>file "/etc/nginx/sites-available/unicorn.conf"=&gt;"etc/nginx/unicorn.conf" do
  cp "etc/nginx/unicorn.conf", "/etc/nginx/sites-available/"
  ln_sf "/etc/nginx/sites-available/unicorn.conf", "/etc/nginx/sites-enabled/"
  sh "service nginx reload"
end</pre>
<p>Here’s another example that will only mount a volume once:</p>
<pre>task "/vol" do
  sh "mount /vol"
end</pre>
<p>And you can easily express dependencies and use smaller tasks to compose larger tasks:</p>
<pre>task :unicorn=&gt;:memcached # unicorn runs our app, so needs memcached
task :nginx=&gt;:unicorn # nginx is front-end to unicorn
task :app=&gt;[:environment, :nginx, :postfix]</pre>
<h2>Role play</h2>
<p>You probably have servers configured for more than one role, at least app server and db server. I recommend using the same set of roles for both Capistrano and Necktie, then you can run commands like this:</p>
<pre>$ cap necktie ROLES=app</pre>
<p>This instructs Capistrano to run the necktie task against all servers in the role app, and only these servers. Capistrano will invoke the necktie command with the single argument app, telling Necktie to only execute that one task. You just need an aggregate task for each role name.</p>
<p>I have one task called app that orchestrates all the tasks necessary to configure a server for hosting the Web application, and another task called db that sets up MySQL server and EBS snapshots. For convenience I placed them in tasks/app.rb and tasks/db.rb, respectively, and because app is the default role, also defined:</p>
<pre>task :default=&gt;:app.</pre>
<h2>Why Necktie, why not …?</h2>
<p>I looked at Puppet, but it speaks some language I don’t understand. I am very well versed in Ruby, Bash and Rake, and that combination works well in so many places, so why not here?</p>
<p>The complexity of your configuration system should be proportional to the complexity of they system you’re configuring. I have to manage a handful of EC2 instances, all running Ubuntu, in three different roles. Chef demanded too much of my time in the kitchen.</p>
<p>Necktie is minimalist, straight Ruby, and uses Git for storage and distribution. Just right.</p>
<p><em>Image by <a title="Link to 2bib.de's photostream" rel="dc:creator cc:attributionURL" href="http://www.flickr.com/photos/32554822@N03/">2bib.de</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2009/11/04/necktie-dress-to-impress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MySQL backups with EBS snapshots</title>
		<link>http://labnotes.org/2009/10/13/mysql-backups-with-ebs-snapshots/</link>
		<comments>http://labnotes.org/2009/10/13/mysql-backups-with-ebs-snapshots/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 07:49:59 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.labnotes.org/?p=1363</guid>
		<description><![CDATA[.@csharpfritz, @jptoto If you are using EC2 EBS volumes and not taking regular snapshots, you are not being backed up&#8230; ShlomoSwidler Amazon EBS snapshots are awesome. You can take snapshots to backup your database, quickly move data between staging and &#8230; <a href="http://labnotes.org/2009/10/13/mysql-backups-with-ebs-snapshots/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<blockquote><p>.@csharpfritz, @jptoto If you are using EC2 EBS volumes and not taking regular snapshots, you are not being backed up&#8230;</p>
<p><a href="http://twitter.com/ShlomoSwidler/status/4820437681">ShlomoSwidler</a></p></blockquote>
<p>Amazon EBS snapshots are awesome. You can take snapshots to backup your database, quickly move data between staging and production, run analytics on the latest data, resize volumes and <a href="http://clouddevelopertips.blogspot.com/2009/09/cool-things-you-can-do-with-shared-ebs.html">much more</a>.</p>
<p>For <a href="http://apartly.com/">Apartly</a>, I&#8217;m using MySQL, storing data and log files on a mounted EBS volume. EBS offers persistent, reliable storage (with <a href="http://aws.amazon.com/ebs/">replication for fault tolerance</a>). Still, nothing can prevent data from disappearing, hence backups.</p>
<p>The current setup uses a cron task that runs hourly and creates a snapshot of the EBS volume. It&#8217;s a simple procedure involving flushing, locking, and synching, and you can <a href="http://developer.amazonwebservices.com/connect/entry.jspa?categoryID=100&amp;externalID=1663">read all about it here</a>. If the database goes catastrophical, I can always go back in history.</p>
<p>Since you don&#8217;t want to accumulate snapshots until the end of time (storage is not free), the script keeps hourly snapshots from the past 24 hours and daily snapshots from the past week, and discards the rest.</p>
<p>It&#8217;s <a href="http://gist.github.com/205689">a very simple script</a>, based on <span><a style="text-decoration: underline !important; outline-style: none; outline-width: initial; outline-color: initial; color: #000099;" href="http://www.anvilon.com/">Eric Hammond</a>&#8216;s excellent </span><a href="http://alestic.com/2009/09/ec2-consistent-snapshot">ec2-consistent-snapshot</a>.<span> Notable differences:</span></p>
<ul>
<li><span>Using Ruby (tested for 1.9.1 only) instead of Perl. (Mind you, </span><a href="http://www.linux-mag.com/cache/7569/1.html">they&#8217;re </a><a href="http://www.linux-mag.com/cache/7569/1.html">both Unix</a>)</li>
<li>Discards old snapshots, only keep hourly from last 24 hours and daily for past 7 days.</li>
<li>Get it: <em>wget http://bit.ly/PTR9K</em></li>
<li>Edit settings, then drop into <em>/etc/cron.hourly</em></li>
</ul>
<p><span>Enjoy.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2009/10/13/mysql-backups-with-ebs-snapshots/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Rounded Corners 243 — Cheese or font?</title>
		<link>http://labnotes.org/2009/09/21/rounded-corners-243-%e2%80%94-cheese-or-font/</link>
		<comments>http://labnotes.org/2009/09/21/rounded-corners-243-%e2%80%94-cheese-or-font/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 06:14:41 +0000</pubDate>
		<dc:creator>Assaf</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://blog.labnotes.org/?p=1354</guid>
		<description><![CDATA[Seek and you shall &#8230;  How the brain hard-wires us to love Google, Twitter, and texting: &#8220;The dopamine system does not have satiety built into it,&#8221; Berridge explains. &#8220;And under certain conditions it can lead us to irrational wants, excessive &#8230; <a href="http://labnotes.org/2009/09/21/rounded-corners-243-%e2%80%94-cheese-or-font/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a title="harder than you'd think" href="http://cheeseorfont.com/play"><img class="aligncenter size-full wp-image-1355" title="cheese or font" src="http://blog.labnotes.org/wp-content/uploads/2009/09/cheese-or-font.png" alt="cheese or font" width="500" height="324" /></a></p>
<p><strong>Seek and you shall &#8230;  <span style="font-weight: normal;"><a href="http://slate.com/id/2224932">How the brain hard-wires us to love Google, Twitter, and texting</a>:</span></strong></p>
<blockquote><p>&#8220;The dopamine system does not have satiety built into it,&#8221; Berridge explains. &#8220;And under certain conditions it can lead us to irrational wants, excessive wants we&#8217;d be better off without.&#8221; So we find ourselves letting one Google search lead to another, while often feeling the information is not vital and knowing we should stop. &#8220;As long as you sit there, the consumption renews the appetite,&#8221; he explains.</p></blockquote>
<p><strong>New in cuke.</strong> <a href="http://robots.thoughtbot.com/post/189412598/five-ridiculously-awesome-cucumber-and-webrat">Five Cucumber/Webrat features</a> you may not know, and the <a href="http://www.engineyard.com/blog/2009/cucumber-step-argument-transforms/">new arguments transform</a>.</p>
<p><strong>The buddy system. </strong>Interesting look into how <a href="http://www.wired.com/medtech/health/magazine/17-10/ff_christakis?currentPage=1">our network affects our health and happiness</a>.</p>
<p><strong>Snapshots. <span style="font-weight: normal;"><a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1663">Running MySQL on Amazon EBS</a>. Love being able to backup the database with a snapshot.</span></strong></p>
<p><strong>Exposé + space.</strong> Must have been asleep at class when they <a href="http://caiustheory.com/mac-tips-you-may-not-know">covered these Mac keyboard shortcuts</a>. Useful stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://labnotes.org/2009/09/21/rounded-corners-243-%e2%80%94-cheese-or-font/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
