<?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>Note to Self</title>
	<atom:link href="http://notetoself.vrensk.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://notetoself.vrensk.com</link>
	<description>lest I forget</description>
	<lastBuildDate>Fri, 23 Feb 2018 12:54:38 +0000</lastBuildDate>
	<language>sv-SE</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Catching up on JS and CSS</title>
		<link>http://notetoself.vrensk.com/2018/02/catching-up-on-js-and-css/</link>
		<comments>http://notetoself.vrensk.com/2018/02/catching-up-on-js-and-css/#comments</comments>
		<pubDate>Fri, 23 Feb 2018 12:54:38 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=106</guid>
		<description><![CDATA[I haven&#8217;t used JavaScript and CSS seriously for many years now. These dinosaur-riddled posts provided good catch-up material for both: https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs https://medium.com/actualize-network/modern-css-explained-for-dinosaurs]]></description>
				<content:encoded><![CDATA[<p>I haven&#8217;t used JavaScript and CSS seriously for many years now. These dinosaur-riddled posts provided good catch-up material for both:</p>
<ul>
<li><a href="https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs" onclick="pageTracker._trackPageview('/outgoing/medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">https://medium.com/the-node-js-collection/modern-javascript-explained-for-dinosaurs</a></li>
<li><a href="https://medium.com/actualize-network/modern-css-explained-for-dinosaurs" onclick="pageTracker._trackPageview('/outgoing/medium.com/actualize-network/modern-css-explained-for-dinosaurs?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">https://medium.com/actualize-network/modern-css-explained-for-dinosaurs</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2018/02/catching-up-on-js-and-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TED talk on procrastination and creativity</title>
		<link>http://notetoself.vrensk.com/2018/02/ted-talk-on-procrastination-and-creativity/</link>
		<comments>http://notetoself.vrensk.com/2018/02/ted-talk-on-procrastination-and-creativity/#comments</comments>
		<pubDate>Mon, 19 Feb 2018 18:04:27 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=105</guid>
		<description><![CDATA[https://www.ted.com/talks/adam_grant_the_surprising_habits_of_original_thinkers]]></description>
				<content:encoded><![CDATA[<p>https://www.ted.com/talks/adam_grant_the_surprising_habits_of_original_thinkers</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2018/02/ted-talk-on-procrastination-and-creativity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UX challenge: Sending a letter to Sweden from Spain with Tarifa A</title>
		<link>http://notetoself.vrensk.com/2016/02/ux-challenge-sending-a-letter-to-sweden-from-spain-with-tarifa-a/</link>
		<comments>http://notetoself.vrensk.com/2016/02/ux-challenge-sending-a-letter-to-sweden-from-spain-with-tarifa-a/#comments</comments>
		<pubDate>Thu, 25 Feb 2016 17:59:37 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Life outside work]]></category>
		<category><![CDATA[User experience]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=99</guid>
		<description><![CDATA[I&#8217;d better put it in Spanish too: Como enviar una carta desde España a Suecia usando sellos &#8220;Tarifa A&#8221;. Spanish &#8220;Tarifa A&#8221; stamps don&#8217;t have a printed value. Instead their value is whatever the cost is to send a normal 20g letter within the Iberian peninsula. So in order to send a letter, one has [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;d better put it in Spanish too: Como enviar una carta desde España a Suecia usando sellos &#8220;Tarifa A&#8221;.<br />
Spanish &#8220;Tarifa A&#8221; stamps don&#8217;t have a printed value. Instead their value is whatever the cost is to send a normal 20g letter within the Iberian peninsula. So in order to send a letter, one has to perform a three-step process at <a href="http://www.correos.es/" onclick="pageTracker._trackPageview('/outgoing/www.correos.es/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">www.correos.es</a>:</p>
<ul>
<li><span style="line-height: 13px;">Click &#8220;Enviar Documentos&#8221; and then &#8220;Calculador de tarifas&#8221; and select &#8220;Enviar Documentos&#8221;.  In the form that loads,</span>
<ul>
<li><span style="line-height: 13px;">select &#8220;Carta y tarjeta postal internacional&#8221;, enter the weight (10g in my case),</span></li>
<li><span style="line-height: 13px;">do NOT tick &#8220;Normalizado&#8221; after doing some math: a C5 envelope is made for an A4 sheet (which I happen to know is 210&#215;297 mm) folded in half, which should give 210&#215;149, which does not fit in either &#8220;14&#215;9 cm. y 23,5&#215;12 cm&#8221;</span></li>
<li>select Destino: Suecia</li>
<li>wonder why there are two places where you pick origin, and leave both on &#8220;Península y Baleares&#8221;</li>
<li>click &#8220;Obtenga su tarifa&#8221;</li>
<li>write down &#8220;1,55&#8243; somewhere and assume that it is Euros.</li>
</ul>
</li>
<li><span style="line-height: 13px;">Enter &#8220;cuanto vale un sello tarifa A&#8221; in the search box.  This gives the helpful answer &#8220;El valor de un sello con la tarifa A, es el de la tarifa de una carta con origen y destino dentro de España, cuyo peso sea igual o inferior a 20 gramos de peso y sus dimensiones sean normalizadas&#8221;.</span></li>
<li>Find your way back to the calculator, and this time pick
<ul>
<li>Carta y tarjeta postal nacional</li>
<li>20 g</li>
<li>&#8220;Normalizado&#8221;</li>
<li>Click, tadaa: 0,45.</li>
</ul>
</li>
</ul>
<p>Now we have all the data and all that is left is the calculation: 1,55/0,45 = 3,444444444, so no less than 4 stamps.  OK.</p>
<p>Redoing the calculation for a &#8220;normal&#8221; (C65?) envelope gives a price of 1.15 which is 2,555555556 stamps.</p>
<p><strong>Update 2016-03-11:</strong> Finding the value of an <em>A2</em> stamp is nigh impossible, but my best guess is that it&#8217;s worth 0,57€.  The guess is based on an <a href="http://www.elcorreogallego.es/tendencias/ecg/nuevos-sellos-felipe-vi-muestran-su-valor-letras-vez-euros/idEdicion-2016-01-05/idNoticia-973016/" onclick="pageTracker._trackPageview('/outgoing/www.elcorreogallego.es/tendencias/ecg/nuevos-sellos-felipe-vi-muestran-su-valor-letras-vez-euros/idEdicion-2016-01-05/idNoticia-973016/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">article published by Correos Gallego</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2016/02/ux-challenge-sending-a-letter-to-sweden-from-spain-with-tarifa-a/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Triple-entry accounting</title>
		<link>http://notetoself.vrensk.com/2012/08/triple-entry-accounting/</link>
		<comments>http://notetoself.vrensk.com/2012/08/triple-entry-accounting/#comments</comments>
		<pubDate>Fri, 03 Aug 2012 21:36:39 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=92</guid>
		<description><![CDATA[Really interesting article by Ian Grigg (from 2005) on how digital signatures (and third-party signatories) can take bookkeeping to the next level.]]></description>
				<content:encoded><![CDATA[<p>Really <a href="http://iang.org/papers/triple_entry.html" onclick="pageTracker._trackPageview('/outgoing/iang.org/papers/triple_entry.html?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">interesting article by Ian Grigg</a> (from 2005) on how digital signatures (and third-party signatories) can take bookkeeping to the next level.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2012/08/triple-entry-accounting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iTunes resumed a failed restore and deleted images</title>
		<link>http://notetoself.vrensk.com/2011/10/itunes-resumed-a-failed-restore-and-deleted-images/</link>
		<comments>http://notetoself.vrensk.com/2011/10/itunes-resumed-a-failed-restore-and-deleted-images/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 16:59:04 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=87</guid>
		<description><![CDATA[[This is the error report I sent to Apple at radar.apple.com] Summary: While upgrading to iOS 5, the final restore of the backup taken at the beginning failed. A few days later, iTunes offered to try again, which I accepted. Unfortunately, the pictures I had taken during those days were deleted by the restore. Steps [...]]]></description>
				<content:encoded><![CDATA[<p><em>[This is the error report I sent to Apple at radar.apple.com]</em></p>
<h2>Summary:</h2>
<p>While upgrading to iOS 5, the final restore of the backup taken at the beginning failed.  A few days later, iTunes offered to try again, which I accepted.  Unfortunately, the pictures I had taken during those days were deleted by the restore.</p>
<h2>Steps to Reproduce:</h2>
<ol>
<li>Connect an iPhone with iOS 4.3.5 to the computer.</li>
<li>Answer “Yes” to iTunes question “There is a new version of the OS for your phone available. Do you want to upgrade?”</li>
<li>Wait for iTunes to download iOS 5.</li>
<li>Wait for iTunes to backup the phone.</li>
<li>Wait for iTunes to upgrade the phone.</li>
<li>Answer “Yes, I want to restore the phone to its previous state”</li>
<li>See the restore mysteriously fail with an error (-35) [IIRC]</li>
<li>Shrug and sync the phone the normal way and see all your apps end up on lots of pages instead of in the folders which apparently couldn’t be restored.</li>
<li>Travel to Barcelona with a girl of your choice.</li>
<li>Go on a lot of sightseeing, taking lots of pictures of each other and of La Sagrada Família, Parc Güell, and various other spectacular things.</li>
<li>Remember to go by the house where you lived 17 years ago of which you don’t have any pictures and take a few nice shots.</li>
<li>Come back home and plug in the phone in order to sync the photos to iPhoto.</li>
<li>When iTunes pops up a window asking “The previous attempt to restore iPhone failed. Do you want to try again?”, answer yes.</li>
<li>Wait for the restore to complete.</li>
<li>Go through the “welcome to iOS 5” setup.  Answer in the affirmative to everything.</li>
<li>Start iPhoto.  There should be no pictures to import.</li>
<li>Curse.  Ask friends for more cuss words.  Repeat.</li>
<li>Chat with the girl and agree that going back to Barcelona some other time sounds like a nice plan.</li>
</ol>
<h2>Expected Results:</h2>
<p>In step 13, it would have been really nice if iTunes would have pointed out<br />
a) that the backup to be restored was five days old<br />
b) that anything added to the phone in the interim would be lost,<br />
c) including those 100 or so photos you seem to have taken</p>
<p>Yeah, that would have been really nice.  Barring that, it would have been really nice if in step 16, there had actually been a lot of pictures to import.</p>
<h2>Actual Results:</h2>
<p>I have no photos of my stay in Barcelona.</p>
<h2>Regression:</h2>
<p>N/A</p>
<h2>Notes:</h2>
<p>I blame myself more than anyone else.  I know what a backup and restore means.  I even thought about the few text messages that would be deleted and decided that was not a problem.  But still: a little extra logic would have prevented this.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2011/10/itunes-resumed-a-failed-restore-and-deleted-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FedEx needs help</title>
		<link>http://notetoself.vrensk.com/2011/01/fedex-needs-help/</link>
		<comments>http://notetoself.vrensk.com/2011/01/fedex-needs-help/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 18:19:37 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Life outside work]]></category>
		<category><![CDATA[User experience]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[FedEx]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=81</guid>
		<description><![CDATA[I can&#8217;t pass up an opportunity like this, it&#8217;s just too bad.  I just got an SMS from FedEx.  The message says that they have a parcel for me and that I should call for delivery.  The message starts with something I can only assume is a parcel number, or whatever they prefer to call [...]]]></description>
				<content:encoded><![CDATA[<p>I can&#8217;t pass up an opportunity like this, it&#8217;s just too bad.  I just got an SMS from FedEx.  The message says that they have a parcel for me and that I should call for delivery.  The message starts with something I can only assume is a parcel number, or whatever they prefer to call it, consisting of three letters and twelve digits.  Here&#8217;s what happens:</p>
<ol>
<li>I press the phone number in the message and my phone dials it.  The machine in the other end asks me to pick a language.  I pick the first one, which is Swedish.  TMITOE says that the office is closed, and that I can press 1 to arrange a pick-up or get tracking information.  No other alternatives, no opening hours, the message just repeats.  #FAIL</li>
<li>I enter fedex.com in my web browser.  I get a big honking box with the word &#8220;Flash&#8221; in it (I run ClickToFlash).  There is nothing to interact with outside the flash box.  #FAIL</li>
<li>I go to fedex.se which redirects to fedex.com/se.  The menus read (in translation) Send, Track, Account Mgt, Customs Tools.  I suppose that Track is the option that is least remotely connected to Deliver, which is what I want them to do.  I pull down the menu only to discover that there are two tracking options: Track with tracking number, and Track with reference number.  What&#8217;s the difference?  What do I have?  I pick the first one and enter the long string of letters and numbers from the SMS and press &#8220;Track&#8221;.  The site tells me the number is invalid and tells me to check it (it is exactly as in the SMS).  No clues are provided. #FAIL</li>
<li>I pick the second option, Track with reference number.  I enter the same number (copy, paste) and my country and postal code.  No hits.  #FAIL</li>
<li>I redial the number in the SMS but this time I pick English.  TMITOE tells me that the office is closed, and that the opening hours are 8 am to 7 pm.  It&#8217;s 6.30 pm.  #FAIL</li>
<li>On a whim I go back to the web site and enter <em>just the digits</em> from the tracking number. Ta-daa!  Detailed information about my parcel, which apparently is in Paris.  There is a form that I can use to add email addresses.  One is labeled &#8220;From&#8221;, one &#8220;To&#8221; and there are three more without labels.  Reading the help texts (by hovering over little question marks) I get the impression that I can register email addresses to get automatic delivery notification, or an email if something gets stuck in customs.  There is nothing to even hint that I should get in touch with them about my delivery.  #FAIL</li>
<li>I call back to TMITOE and press 1 for Swedish, 1 (the only option) for pickup-or-tracking, and 2 to &#8220;display (!) tracking information&#8221;.  I enter the tracking number.  TMITOE thinks a bit and then tells me that the parcel has been picked up by a courier, and to press if I want more information.  There&#8217;s no typo there; it didn&#8217;t tell me what to press, just to press.  #FAIL</li>
<li>I redial and redo it in English.  &#8221;The package has been picked up by a courier.&#8221;  Oh, press *0 for assistance!  All their lines are busy.  I wait.  I wonder if I keep my position in the queue.  I wonder how many clerks are working hard to get down to my call.  Actually, I don&#8217;t need to know the exact number, I&#8217;d just like to know that there will be someone there eventually, especially considering that their office might be closed.  After just six minutes, I get a ring tone.  And then I&#8217;m disconnected. #FAIL</li>
<li>I&#8217;m going to use the form for registering email addresses and see if I can get a message through.  I&#8217;ll send them a link to this note.  I&#8217;ll keep you posted. #JURYSTILLOUT</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2011/01/fedex-needs-help/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t use Loopia for free email forwarding</title>
		<link>http://notetoself.vrensk.com/2010/10/dont-use-loopia-for-free-email-forwarding/</link>
		<comments>http://notetoself.vrensk.com/2010/10/dont-use-loopia-for-free-email-forwarding/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 09:13:59 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Server Configuration]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[email forwarding]]></category>
		<category><![CDATA[Loopia]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=79</guid>
		<description><![CDATA[Swedish ISP Loopia offers free email forwarding for any domain for which they handle DNS.  Unfortunately, this includes a spam filter that the customer cannot turn off, unless they pay, which means it&#8217;s not free anymore. So what&#8217;s wrong with some free spam filtering?  Well, this is what happened: A prospective client sent an email with [...]]]></description>
				<content:encoded><![CDATA[<p>Swedish ISP <a href="http://www.loopia.se/" onclick="pageTracker._trackPageview('/outgoing/www.loopia.se/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Loopia</a> offers free email forwarding for any domain for which they handle DNS.  Unfortunately, this includes a spam filter that the customer cannot turn off, unless they pay, which means it&#8217;s not free anymore.</p>
<p>So what&#8217;s wrong with some free spam filtering?  Well, this is what happened:</p>
<ol>
<li>A prospective client sent an email with a proposition.</li>
<li>Loopia&#8217;s spam filter found the proposition suspect <em>and bounced it</em>.</li>
<li>The client saw a bounce and thought that they had the wrong email address and gave up.</li>
</ol>
<p>This probably lead to lost business.  I can&#8217;t blame Loopia, but I can stop using them.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2010/10/dont-use-loopia-for-free-email-forwarding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>php.ini file upload limits</title>
		<link>http://notetoself.vrensk.com/2010/09/php-ini-file-upload-limits/</link>
		<comments>http://notetoself.vrensk.com/2010/09/php-ini-file-upload-limits/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 12:59:24 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=77</guid>
		<description><![CDATA[To raise the max size for file uploads, it&#8217;s not enough to set upload_max_filesize to 50M.  One also has to set post_max_size to something that is at least as big.  I don&#8217;t think that&#8217;s how it used to be, or I wouldn&#8217;t have spent an hour looking for the solution. I&#8217;m running Ubuntu now, so I [...]]]></description>
				<content:encoded><![CDATA[<p>To raise the max size for file uploads, it&#8217;s not enough to set <code>upload_max_filesize</code> to 50M.  One also has to set <code>post_max_size</code> to something that is at least as big.  I don&#8217;t think that&#8217;s how it used to be, or I wouldn&#8217;t have spent an hour looking for the solution.</p>
<p>I&#8217;m running Ubuntu now, so I put the extra settings in a separate file that I upload to <code>/etc/php5/conf.d/</code> using <a href="http://opscode.com/chef/" onclick="pageTracker._trackPageview('/outgoing/opscode.com/chef/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">chef</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2010/09/php-ini-file-upload-limits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What I brought home from Scottish Ruby Conference</title>
		<link>http://notetoself.vrensk.com/2010/03/what-i-brought-home-from-scottish-ruby-conference/</link>
		<comments>http://notetoself.vrensk.com/2010/03/what-i-brought-home-from-scottish-ruby-conference/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 19:21:24 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mock]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=65</guid>
		<description><![CDATA[[A note for casual readers: These notes are not meant to be objective representations of what different speakers said at Scottish Ruby Conference. They are my interpretations in my context.] [Update 2010-03-29, morning: added more links. 2010-03-29, evening: re-phrased note on gender distribution and separated it from note on sexism, since I don't think of them [...]]]></description>
				<content:encoded><![CDATA[<p><em>[A note for casual readers: These notes are not meant to be objective representations of what different speakers said at <a href="http://scottishrubyconference.com/posts" onclick="pageTracker._trackPageview('/outgoing/scottishrubyconference.com/posts?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Scottish Ruby Conference</a>.  They are my interpretations in my context.]</em></p>
<p><strong>[Update 2010-03-29, morning: added more links. 2010-03-29, evening: re-phrased note on gender distribution and separated it from note on sexism, since I don't think of them as related and don't want others to think so. 2010-04-01: links to other summaries.] </strong></p>
<p><strong>Concurrency and real time</strong> are great to have and quite attainable if we step outside the comfort zone that Rails gives us. Thanks to <a title="@jimweirich" href="http://twitter.com/jimweirich" onclick="pageTracker._trackPageview('/outgoing/twitter.com/jimweirich?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Jim Weirich</a> for the reminders and to <a title="@makoto_inoue" href="http://twitter.com/makoto_inoue" onclick="pageTracker._trackPageview('/outgoing/twitter.com/makoto_inoue?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Makoto Inoue</a> and <a title="@mloughran" href="http://twitter.com/mloughran" onclick="pageTracker._trackPageview('/outgoing/twitter.com/mloughran?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Martyn Loughran</a> for valuable tips and tools: <a href="http://github.com/benpickles/js-model" onclick="pageTracker._trackPageview('/outgoing/github.com/benpickles/js-model?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">js-model</a>, <a href="http://dragban.heroku.com/" onclick="pageTracker._trackPageview('/outgoing/dragban.heroku.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">dragban</a>, <a href="http://pusherdemo.heroku.com/" onclick="pageTracker._trackPageview('/outgoing/pusherdemo.heroku.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">pusher demo</a>, . <a href="http://www.slideshare.net/mloughran/real-time-web-whats-that-for" onclick="pageTracker._trackPageview('/outgoing/www.slideshare.net/mloughran/real-time-web-whats-that-for?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Presentation here</a>, and <a href="http://blog.new-bamboo.co.uk/2010/3/23/adding-the-rtw-to-our-existing-internets" onclick="pageTracker._trackPageview('/outgoing/blog.new-bamboo.co.uk/2010/3/23/adding-the-rtw-to-our-existing-internets?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">some background</a>. And I really want to do some Erlang.</p>
<p>What we do is <strong>an art that is based on science</strong> and while the artistery has received a lot of attention lately, we can benefit from revisiting the science. <a title="@jimweirich" href="http://twitter.com/jimweirich" onclick="pageTracker._trackPageview('/outgoing/twitter.com/jimweirich?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Jim Weirich</a> told us about <a href="http://mitpress.mit.edu/sicp/" onclick="pageTracker._trackPageview('/outgoing/mitpress.mit.edu/sicp/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Structure and Interpretation of Computer Programs</a>. It’s available online and there is a mailing list to discuss the content and/or the exercises. I think Jim would have been able to sell 50 copies of the book on the spot if he had brought any.</p>
<p><strong>Lifecycle management</strong> should be done with proper tools, not timestamps with funny names (<code>approved_at</code>, <code>published_at</code>, etc). And lifecycle is more than state machines, it’s also workflow and permissions. <a title="@bokmann" href="http://twitter.com/bokmann" onclick="pageTracker._trackPageview('/outgoing/twitter.com/bokmann?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">David Bock</a> showed off <a href="http://github.com/bokmann/stonepath" onclick="pageTracker._trackPageview('/outgoing/github.com/bokmann/stonepath?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Stonepath</a> and hinted at <a href="http://github.com/bokmann/stonewall" onclick="pageTracker._trackPageview('/outgoing/github.com/bokmann/stonewall?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Stonewall</a>. He uses <code>acts_as_state_machine</code> but says that it should probably be really easy to use <a href="http://github.com/pluginaweek/state_machine" onclick="pageTracker._trackPageview('/outgoing/github.com/pluginaweek/state_machine?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');"><code>state_machine</code></a> instead. (NB: A <a href="http://www.pluginaweek.org/2010/03/15/state_machine-0-8-1-the-ocho/" onclick="pageTracker._trackPageview('/outgoing/www.pluginaweek.org/2010/03/15/state_machine-0-8-1-the-ocho/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">new version of state machine</a> was released two weeks ago with a lot of important fixes!)</p>
<p>Ever since I read about <a href="http://github.com/schacon/ticgit" onclick="pageTracker._trackPageview('/outgoing/github.com/schacon/ticgit?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">ticgit</a> in <a title="@chacon" href="http://twitter.com/chacon" onclick="pageTracker._trackPageview('/outgoing/twitter.com/chacon?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Scott Chacon</a>’s <a href="http://peepcode.com/products/git-internals-pdf" onclick="pageTracker._trackPageview('/outgoing/peepcode.com/products/git-internals-pdf?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Git Internals</a> I have wanted to do something with <strong>git besides source code control</strong> but I always thought I’d need to learn 100 git plumbing commands. <a href="http://github.com/schacon/git-plumbing-preso" onclick="pageTracker._trackPageview('/outgoing/github.com/schacon/git-plumbing-preso?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Scott demonstrated</a> how to do very useful things with just four or five commands, so that’s something I’ll put in my toolbox.</p>
<p><a title="@gwynmorfey" href="http://twitter.com/gwynmorfey" onclick="pageTracker._trackPageview('/outgoing/twitter.com/gwynmorfey?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Gwyn Morfey</a> introduced a very useful image in his talk “<a href="http://speakerrate.com/talks/2884-write-bad-code" onclick="pageTracker._trackPageview('/outgoing/speakerrate.com/talks/2884-write-bad-code?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Write Bad Code</a>”. We may need to get into technical debt in order to <strong>avoid the area of death</strong>, just like we may need to get into financial debt in real life to avoid starving or bankruptcy. He also gave a good number of rules for classifying the situations where it is applicable and how to act in those situations.</p>
<p>Lots of people retweeted <a title="@timbray" href="http://twitter.com/timbray" onclick="pageTracker._trackPageview('/outgoing/twitter.com/timbray?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Tim Bray</a>’s sentiment that “<strong>if your webapp doesn’t work on a mobile device</strong> nowadays then it doesn’t work”. I definitely think that is true in most cases, but I’m worried that it will be wielded like the Sword Of Truth in the future. It’s not black or white, and while most webapps should be written to work on a mobile device, I think there are loads of valid exceptions.</p>
<p>I read about <a href="http://en.wikipedia.org/wiki/Class-Responsibility-Collaboration_card" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/Class-Responsibility-Collaboration_card?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">CRC Cards</a> (<strong>Class, Responsibility, Collaboration</strong>) many years ago and threw off the idea as a tool for people who needed something to hold in their hands while they learned about object oriented design and analysis. <a title="@samwessel" href="http://twitter.com/samwessel" onclick="pageTracker._trackPageview('/outgoing/twitter.com/samwessel?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Sam Wessel</a> ran a BoF workshop with <a title="@kevinrutherford" href="http://twitter.com/kevinrutherford" onclick="pageTracker._trackPageview('/outgoing/twitter.com/kevinrutherford?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Kevin Rutherford</a> where we got to work through a simple analysis exercise. It was a real eye opener and the most valuable session of the conference. I learned two things:</p>
<ol>
<li>it is useful to have a class for the whole of the system and not just the parts, and</li>
<li>I should learn about CRC.  (I shall try to avoid the temptation to think that I can actually use it on my own just because I’ve sat at the feet of masters.)</li>
</ol>
<p>I’m not a big friend of mocking and thus went to a BoF where <a title="@bgswan" href="http://twitter.com/bgswan" onclick="pageTracker._trackPageview('/outgoing/twitter.com/bgswan?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Brian Swan</a> and <a title="@kevinrutherford" href="http://twitter.com/kevinrutherford" onclick="pageTracker._trackPageview('/outgoing/twitter.com/kevinrutherford?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Kevin Rutherford</a> debated mocks. Interesting debate, but according to show of hands at the end, I was the only person who changed their position to whatever slight extent. Apparently there is now a nicer syntax for setting expectations so that you can do the stubbing in the setup and the expectation checks in the actual it-clauses. And Kevin says that (contrary to Brian’s experience, and mine), he feels that he can refactor quite freely without breaking loads of mocks. <strong>I need to learn more about mocks or modelling, or both.</strong></p>
<p><a href="http://github.com/bblimke/webmock" onclick="pageTracker._trackPageview('/outgoing/github.com/bblimke/webmock?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">WebMock</a> by <a title="@bartoszblimke" href="http://twitter.com/bartoszblimke" onclick="pageTracker._trackPageview('/outgoing/twitter.com/bartoszblimke?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Bartosz Blimke</a> does the same thing FakeWeb, but better.  It has support for regexp matching of urls, checks for POST data, and nice assertions.  Worth checking out.</p>
<p><a href="http://github.com/danlucraft/redcar" onclick="pageTracker._trackPageview('/outgoing/github.com/danlucraft/redcar?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Redcar</a> by Daniel Lucraft aims to be “a cross-platform programmer’s editor written in Ruby”. I couldn’t install it, probably because I have installed gems and rubies in too many ways on my laptop. Will need to clean up and try again.</p>
<p>Things I should check out: <a href="http://www.slideshare.net/ehuard/12-hours-to-rate-a-rails-application" onclick="pageTracker._trackPageview('/outgoing/www.slideshare.net/ehuard/12-hours-to-rate-a-rails-application?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">12 hours to rate a rails application</a>, <a href="http://www.trackerstorymaps.com/" onclick="pageTracker._trackPageview('/outgoing/www.trackerstorymaps.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Story mapper</a> (big picture planning for Pivotal Tracker), Distributed Architectures with Rack (mentioned in <a href="http://www.tbray.org/ongoing/When/201x/2010/03/28/Scottish-Ruby-Conference" onclick="pageTracker._trackPageview('/outgoing/www.tbray.org/ongoing/When/201x/2010/03/28/Scottish-Ruby-Conference?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Tim Bray&#8217;s blog</a>).</p>
<h2 id="non_coding_observations">Non-coding observations</h2>
<ul>
<li>When going to a country where it is hideously expensive to use my phone for data, I should bring an old phone that can run my normal sim card and buy a pay-as-you-go card for my iphone at the destination.  Doubly so since there is really no reason to believe that anyone can ever create a wireless network that can support 300 developers at the same time, all the time.</li>
<li>RubyConf India had <a href="http://twitter.com/obie/status/10817759467" onclick="pageTracker._trackPageview('/outgoing/twitter.com/obie/status/10817759467?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">28 female attendees out of 400 total</a>; Scottish Ruby Conference had slightly less, I think.  I wonder what we can do as a community to raise that percentage.  I wonder what we can do as a society.  I wonder what I can do.</li>
<li>I also noted that a few presenters thought it appropriate to portray Ruby developers as geeky manboys and women as some kind of more or less attainable prize or decoration.  That is so not cool.</li>
<li>Quality of presentations vary from marvellous and eyeopening to YOU HAVE ROBBED ME OF 45 MINUTES OF MY LIFE AND MADE ME LOSE FAITH IN HUMANITY.  Unless the presenters are well known, I should <em>always</em> find someone who can vouch for the presenter beforehand, or at least talk to the presenter to find out what I can expect.  In the choice between an interesting presentation and an interesting presenter, prefer the latter.</li>
<li>If I don’t manage to do the above, I should make sure to find a seat where I can sneak out of the room without looking rude.</li>
<li>Considering that the lack of equal opportunities for men and women is a far greater problem than my having 45 minutes ripped from my day, I’m forced to make the observation that I have grown slightly numb to male chauvinism.  I don’t like that.</li>
</ul>
<p>Links to others&#8217; summaries:</p>
<ul>
<li><a href="http://gautamrege.wordpress.com/2010/03/29/scottish-ruby-conference-2010-roundup-1/" onclick="pageTracker._trackPageview('/outgoing/gautamrege.wordpress.com/2010/03/29/scottish-ruby-conference-2010-roundup-1/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Gautam Rege</a></li>
<li><a href="http://devblog.xing.com/ruby/notes-from-the-scottish-ruby-conference-2010/" onclick="pageTracker._trackPageview('/outgoing/devblog.xing.com/ruby/notes-from-the-scottish-ruby-conference-2010/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Sebastian Röbke</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2010/03/what-i-brought-home-from-scottish-ruby-conference/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>SQLite is dynamically typed</title>
		<link>http://notetoself.vrensk.com/2009/08/sqlite-is-dynamically-typed/</link>
		<comments>http://notetoself.vrensk.com/2009/08/sqlite-is-dynamically-typed/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 12:54:08 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=59</guid>
		<description><![CDATA[SQLite3 is truly dynamically typed. To a fault: sqlite&#62; select count(*) from posts where external_id = 199252; 0 sqlite&#62; select count(*) from posts where external_id = '199252'; 1 sqlite&#62; select count(*) from posts where external_id = 199793; 1 sqlite&#62; select count(*) from posts where external_id = '199793'; 0 One day I suppose I will find [...]]]></description>
				<content:encoded><![CDATA[<p>SQLite3 is truly dynamically typed.  To a fault:</p>
<pre><code>sqlite&gt; select count(*) from posts where external_id = 199252;
0
sqlite&gt; select count(*) from posts where external_id = '199252';
1
sqlite&gt; select count(*) from posts where external_id = 199793;
1
sqlite&gt; select count(*) from posts where external_id = '199793';
0
</code></pre>
<p>One day I suppose I will find it useful to store different data types in the same column, and without implicit conversion.  I look forward to that day.  Right now, I will have to spend a few hours cleaning up the mess that this caused.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2009/08/sqlite-is-dynamically-typed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gueuze Fond Tradition</title>
		<link>http://notetoself.vrensk.com/2009/08/gueuze-fond-tradition/</link>
		<comments>http://notetoself.vrensk.com/2009/08/gueuze-fond-tradition/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 15:34:39 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Life outside work]]></category>
		<category><![CDATA[beer]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=56</guid>
		<description><![CDATA[After last week&#8217;s got.rb meeting we went out to grab a beer and continue our geeky discussions.  I just want to make a note to myself that the wonderful beer I had (after CJ refused it) was a Gueuze Fond Tradition from Belgium.  It&#8217;s not available at Systembolaget, much like this summer&#8217;s first favourite, Gjutarns [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://beeradvocate.com/beer/profile/212/5212" onclick="pageTracker._trackPageview('/outgoing/beeradvocate.com/beer/profile/212/5212?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');"><img class="alignleft size-full wp-image-57" title="picture-3" src="http://notetoself.vrensk.com/wp-content/uploads/2009/08/picture-3.png" alt="" width="95" height="277" /></a>After last week&#8217;s <a href="http://gotrb.org/calendar/10914739/" onclick="pageTracker._trackPageview('/outgoing/gotrb.org/calendar/10914739/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">got.rb meeting</a> we went out to <a href="http://www.restaurangguiden.com/gbg/centrum/delirium/omossRG.aspx" onclick="pageTracker._trackPageview('/outgoing/www.restaurangguiden.com/gbg/centrum/delirium/omossRG.aspx?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">grab a beer</a> and continue our geeky discussions.  I just want to make a note to myself that the wonderful beer I had (after CJ refused it) was a <a href="http://beeradvocate.com/beer/profile/212/5212" onclick="pageTracker._trackPageview('/outgoing/beeradvocate.com/beer/profile/212/5212?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Gueuze Fond Tradition</a> from Belgium.  It&#8217;s not available at Systembolaget, much like this summer&#8217;s first favourite, <a href="http://skebobruksbryggeri.blogspot.com/search?updated-min=1971-03-14T00%3A00%3A00%2B01%3A00&amp;updated-max=1971-03-18T00%3A00%3A00%2B01%3A00&amp;max-results=1" onclick="pageTracker._trackPageview('/outgoing/skebobruksbryggeri.blogspot.com/search?updated-min=1971-03-14T00_3A00_3A00_2B01_3A00_amp_updated-max=1971-03-18T00_3A00_3A00_2B01_3A00_amp_max-results=1&amp;referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Gjutarns Bästa Bitter</a> (et al.) from Skebo Bruksbryggeri.  Note within note: according to the <a href="http://skebobruksbryggeri.blogspot.com/1971_06_01_archive.html" onclick="pageTracker._trackPageview('/outgoing/skebobruksbryggeri.blogspot.com/1971_06_01_archive.html?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">homepage</a>, Skebo&#8217;s beers should be available at Delirium and <a href="http://www.bishopsarms.com/" onclick="pageTracker._trackPageview('/outgoing/www.bishopsarms.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">three</a> <a href="http://www.hitta.se/ViewDetailsPink.aspx?vkiid=zVaMLGX1RdJeoW63V%20r9gw==&amp;vad=Plain+Kitchen+and+Sports+Bar" onclick="pageTracker._trackPageview('/outgoing/www.hitta.se/ViewDetailsPink.aspx?vkiid=zVaMLGX1RdJeoW63V_20r9gw==_amp_vad=Plain+Kitchen+and+Sports+Bar&amp;referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">more</a> <a href="http://www.therover.se/" onclick="pageTracker._trackPageview('/outgoing/www.therover.se/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">venues</a> in Gothenburg!</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2009/08/gueuze-fond-tradition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keeping Fedora 6 going after end-of-life</title>
		<link>http://notetoself.vrensk.com/2009/06/keeping-fedora-6-going-after-end-of-life/</link>
		<comments>http://notetoself.vrensk.com/2009/06/keeping-fedora-6-going-after-end-of-life/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 16:38:21 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Server Configuration]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[yum]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=53</guid>
		<description><![CDATA[All hackers want to live on the edge. What we rarely reflect on is the fact that most things have more than one edge. Adaptation curves have two: one where the early adopters build up their reputation for cool and one where I found myself this afternoon. Apparently I should have let go of Fedora [...]]]></description>
				<content:encoded><![CDATA[<p>All hackers want to live on the edge.  What we rarely reflect on is the fact that most things have more than one edge.  Adaptation curves have two: one where the early adopters build up their reputation for cool and one where I found myself this afternoon.</p>
<p>Apparently I should have let go of Fedora 6 some time ago.  I installed this particular server in December 2006 when FC6 was the cool new girl on the block, and it has been running smoothly since then.  But today when I tried to (<code>yum</code>) install a package, there were no servers to be found:</p>
<pre><code># yum search libxslt-devel
Loading "installonlyn" plugin
Setting up repositories

http://archive.kernel.org/fedora-archive/fedora/linux/core/6/i386/os/repodata/repomd.xml:

  [Errno 14] HTTP Error 404: Server: nginx/0.5.0
...
Trying other mirror.
core                      100% |=========================| 1.1 kB    00:00
Error: Cannot find a valid baseurl for repo: extras
</code></pre>
<p>Oops.  I looked in <code>/etc/yum.repos.d/fedora-extras.repo</code> which is provides the base URL:</p>
<pre><code>[extras]
name=Fedora Extras $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=extras-$releasever&amp;arch=$basearch
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1
</code></pre>
<p>In earlier experience, the problem has been that the DNS service for the repo that <code>mirrorlist</code> recommends is down, and this is what some googling suggested too.  So I went to <a href="http://mirrors.fedoraproject.org/mirrorlist?repo=extras-6&amp;arch=i386" onclick="pageTracker._trackPageview('/outgoing/mirrors.fedoraproject.org/mirrorlist?repo=extras-6_amp_arch=i386&amp;referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">mirrors.fedoraproject.org</a> to see what it said.  The answer surprised me:</p>
<pre><code># repo = extras-6 arch = i386 error: invalid repo or arch
# following repositories are available:
# repo=core-2, arch=i386
# repo=core-2, arch=x86_64
# ...
# repo=core-6, arch=x86_64
# ...
</code></pre>
<p>So <code>core-6</code> is in the list but <code>extras-6</code> is not.  I tried some different combinations thinking I had got it wrong, but to no avail.  Instead, on a whim, I checked out the <a href="http://mirrors.fedoraproject.org/" onclick="pageTracker._trackPageview('/outgoing/mirrors.fedoraproject.org/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">site’s root</a> where I could navigate to a human-readable <a href="http://mirrors.fedoraproject.org/publiclist/Fedora/6/i386/" onclick="pageTracker._trackPageview('/outgoing/mirrors.fedoraproject.org/publiclist/Fedora/6/i386/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">list of mirrors</a> and I started checking them out one by one.  Uni-Bayreuth seemed to have what I wanted, so I edited <code>fedora-extras.repo</code> like this:</p>
<pre><code>[extras]
name=Fedora Extras $releasever - $basearch
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/extras/$releasever/$basearch/
#mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=extras-$releasever&amp;arch=$basearch
baseurl=http://ftp.uni-bayreuth.de/linux/fedora/linux/extras/$releasever/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-extras
gpgcheck=1
</code></pre>
<p>and ran <code>yum search libxslt-devel</code> again.  This time it complained about <code>updates</code> instead (<code>Error: Cannot find a valid baseurl for repo: updates</code>).  Unfortunately Bayreuth didn’t have the updates catalog which sent me searching in a few other places until I finally decided to try to make do without it by setting <code>enabled=0</code> in <code>fedora-updates.repo</code>:</p>
<pre><code>[updates]
name=Fedora Core $releasever - $basearch - Updates
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-fc$releasever&amp;arch=$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora
</code></pre>
<p>It worked, and I was able to install the packages I wanted, but I really need to get myself a newer OS.  I’ll combine that with a move to another host; FS-data have let me down once too many, and I’ve never fancied upgrading the OS on a production server anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2009/06/keeping-fedora-6-going-after-end-of-life/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Git bisect saves the day!</title>
		<link>http://notetoself.vrensk.com/2009/04/git-bisect-saves-the-day/</link>
		<comments>http://notetoself.vrensk.com/2009/04/git-bisect-saves-the-day/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 21:01:59 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[git bisect]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=51</guid>
		<description><![CDATA[Git bisect is the hero of the week! It turned out that some time between now and three weeks ago, the login functionality broke in the Rails app we’re developing. It didn’t break completely, of course, just in certain environments. And looking at the logs, I had no idea what the error could be, so [...]]]></description>
				<content:encoded><![CDATA[<p>Git bisect is the hero of the week!  It turned out that some time between now and three weeks ago, the login functionality broke in the Rails app we’re developing.  It didn’t break completely, of course, just in certain environments.  And looking at the logs, I had no idea what the error could be, so I just had to work it out from the diff between the last working commit and next.  Well, between three developers, there can be quite a few commits during three weeks and with a lesser version control system I would have had to</p>
<ol>
<li>checkout the previous revision,</li>
<li>restart the server (because plugins, gems and even Rails can change between versions),</li>
<li>try to log in,</li>
<li>see if works and stop if it does,</li>
<li>repeat from 1.</li>
</ol>
<p>With git, I can ask git itself to perform a binary search among all the revisions between now and three weeks ago.  It would go like this:</p>
<ol>
<li><code>git bisect start HEAD 57c3aaa</code>,</li>
<li>restart the server,</li>
<li>try to log in,</li>
<li>see it fail or succeed,</li>
<li>say <code>git bisect bad</code> or <code>git bisect good</code> to make Git checkout the next node in the binary search tree</li>
<li>repeat from 1 until Git says that it found the culprit.</li>
</ol>
<p>It doesn’t look a lot better, but it is if you have 300 commits.  Of course there is nothing to stop you from doing a manual binary search with Subversion, or even to step back one day at a time to narrow it down, and we didn’t actually have 300 commits.  But where Git really shines is in the fact that if I can write a program that can tell if a version is good or bad, all I have to do is</p>
<ol>
<li><code>git bisect start HEAD 57c3aaa</code>,</li>
<li><code>git run ../my-test-probe.rb</code></li>
</ol>
<p>and sit back and wait.  Provided of course that the program also knew how to start and stop the server.  Well, here is that program, for your debugging pleasure, and mine:</p>
<p><script src="http://pastie.org/437749.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2009/04/git-bisect-saves-the-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pretty-printing PeepCode PDFs</title>
		<link>http://notetoself.vrensk.com/2009/04/pretty-printing-peepcode-pdfs/</link>
		<comments>http://notetoself.vrensk.com/2009/04/pretty-printing-peepcode-pdfs/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 16:23:26 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[The daily grind]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[pdf]]></category>
		<category><![CDATA[peepcode]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=47</guid>
		<description><![CDATA[PeepCode publishes wonderful screencasts and pdf books on subjects that should be of interest to any Rails developer. The pdfs seem to be adapted for screen reading – they are in landscape mode, not in standard paper sizes (as far as I can tell) and they have big print. So far so good, but I [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://peepcode.com/" onclick="pageTracker._trackPageview('/outgoing/peepcode.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">PeepCode</a> publishes wonderful screencasts and pdf books on subjects that should be of interest to any Rails developer.  The pdfs seem to be adapted for screen reading – they are in landscape mode, not in standard paper sizes (as far as I can tell) and they have big print.  So far so good, but I spend enough time in front of computer screens and like reading paper.  I have tried various pdf rendering options combined with cropping, but the solution that worked best for printing <a href="http://jointheconversation.org/" onclick="pageTracker._trackPageview('/outgoing/jointheconversation.org/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Scott Chacon</a>’s <a href="http://peepcode.com/products/git-internals-pdf" onclick="pageTracker._trackPageview('/outgoing/peepcode.com/products/git-internals-pdf?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Git Internals PDF</a> on A4 paper was as simple as printing it 2up at 118%.</p>
<p><a href="http://notetoself.vrensk.com/wp-content/uploads/2009/04/picture-8.png"><img class="alignnone size-full wp-image-48" title="print settings" src="http://notetoself.vrensk.com/wp-content/uploads/2009/04/picture-8.png" alt="" width="500" height="391" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2009/04/pretty-printing-peepcode-pdfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Really killing rails processes at FS-data</title>
		<link>http://notetoself.vrensk.com/2009/04/really-killing-rails-processes-at-fs-data/</link>
		<comments>http://notetoself.vrensk.com/2009/04/really-killing-rails-processes-at-fs-data/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 11:51:38 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=44</guid>
		<description><![CDATA[FS-data was the first web hotel in Sweden to support Ruby on Rails (in August 2006, I think) and I’m glad they did. Unfortunately they haven’t touched their setup since, so patrons are still limited to (a) apps in subdirectories only and (b) FastCGI (FCGI). I have seen many complaints about FCGI, but I have [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.fsdata.se/" onclick="pageTracker._trackPageview('/outgoing/www.fsdata.se/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">FS-data</a> was the first web hotel in Sweden to support Ruby on Rails (in August 2006, I think) and I’m glad they did.  Unfortunately they haven’t touched their setup since, so patrons are still limited to (a) apps in subdirectories only and (b) FastCGI (FCGI).  I have seen many complaints about FCGI, but I have only one: it’s really hard to know if it’s running my latest release.  FS-data have added a control panel of sorts, but it’s pretty unreliable.  Thus, I have to resort to <code>kill</code>ing.  But what to <code>kill</code>?</p>
<pre><code>$ ps -fe | grep rails
UID        PID  PPID  C STIME TTY          TIME CMD
wcj      27292  3558 27 13:41 ?        00:00:02 RAILS: /home/w/wcj/rails/sis/public/dispatch.fcgi
wcj      27365  3558 40 13:41 ?        00:00:02 RAILS: /home/w/wcj/rails/sis/public/dispatch.fcgi
...
</code></pre>
<p>With more than two processes I refuse to <code>kill</code> by PID – FCGI is just too quick to spawn new processes, and I’m not sure if they will run the right version of my app either.  So it’s <code>killall</code>.  But what to <code>killall</code>?</p>
<pre><code>$ killall -9 'RAILS: /home/w/wcj/rails/sis/public/dispatch.fcgi'
</code></pre>
<p>does not work.  So it’s <code>ps</code> to the rescue:</p>
<pre><code>$ ps -eo pid,comm:30
  PID COMMAND
27365 rails_dispatche
27292 rails_dispatche
</code></pre>
<p><code>rails_dispatche</code>, really?  No final ‘r’?  Whatever:</p>
<pre><code>killall -9 rails_dispatche
</code></pre>
<p>It works and I’m happy again.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2009/04/really-killing-rails-processes-at-fs-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Same, same &#8211; but different</title>
		<link>http://notetoself.vrensk.com/2008/11/same-same-but-different/</link>
		<comments>http://notetoself.vrensk.com/2008/11/same-same-but-different/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 23:17:00 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[language]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=36</guid>
		<description><![CDATA[I read in New York Magazine this weekend that Malcolm Gladwell (author of The Tipping Point, Blink and Outliers) has a &#8220;regular biweekly &#8216;boys’ night out&#8217;&#8221; and that made me wonder if he went out with his friends every other Friday or perhaps every Tuesday and Saturday.  &#8221;Biweekly&#8221; is a word that makes me uncomfortable [...]]]></description>
				<content:encoded><![CDATA[<p>I read in <a href="http://nymag.com/" onclick="pageTracker._trackPageview('/outgoing/nymag.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">New York Magazine</a> this weekend that Malcolm Gladwell (author of <a href="http://www.adlibris.com/se/product.aspx?isbn=0349114463" onclick="pageTracker._trackPageview('/outgoing/www.adlibris.com/se/product.aspx?isbn=0349114463&amp;referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">The Tipping Point</a>, <a href="http://www.adlibris.com/se/product.aspx?isbn=0141022043" onclick="pageTracker._trackPageview('/outgoing/www.adlibris.com/se/product.aspx?isbn=0141022043&amp;referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Blink</a> and <a href="http://www.adlibris.com/se/product.aspx?isbn=0141036249" onclick="pageTracker._trackPageview('/outgoing/www.adlibris.com/se/product.aspx?isbn=0141036249&amp;referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Outliers</a>) has a <a href="http://nymag.com/arts/books/features/52014/index1.html#story" onclick="pageTracker._trackPageview('/outgoing/nymag.com/arts/books/features/52014/index1.html_story?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">&#8220;regular biweekly &#8216;boys’ night out&#8217;&#8221;</a> and that made me wonder if he went out with his friends every other Friday or perhaps every Tuesday and Saturday.  &#8221;Biweekly&#8221; is a word that makes me uncomfortable since I hear it quite seldom, and it doesn&#8217;t seem to mean the same thing every time.  I&#8217;ve always thought that was because my otherwise near-perfect memory had a blind spot at that exact dictionary entry, so to speak.  Nevermind, I thought, if he invites me to join them I suppose he will be more specific, and if he doesn&#8217;t (quite likely) it doesn&#8217;t really matter, does it?</p>
<p>And then I read <a href="http://www.gocomics.com/bloomcounty/2008/11/19/" onclick="pageTracker._trackPageview('/outgoing/www.gocomics.com/bloomcounty/2008/11/19/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">today&#8217;s Bloom County strip</a> (re-runs from the &#8217;80s) where Opus arrives at the barber&#8217;s for his &#8220;biannual haircut&#8221; and I decided to take action.  I can deal with not knowing Malcolm Gladwell&#8217;s party schedule, but I really want to know if my favourite penguin gets a trim twice a year or every two years.  (I have tried both intervals, and each has its charm.)</p>
<p>I started with &#8220;biweekly&#8221; and here&#8217;s what the dictionary says:</p>
<p style="padding-left: 30px;"><span class="hwGrp"><span class="hw">biweekly</span><span class="pronGrp"><span class="pr"> |bʌɪˈwiːkli|<br />
</span></span></span><span class="SB"><span class="prelim"><span class="ps">adjective </span>&amp; <span class="ps">adverb<br />
</span></span><span class="sense"><span class="def">appearing or taking place every two weeks or twice a week </span><span class="exGrp"><span class="lbl">: </span><span class="gramGrp">[as <span class="syntax">adj. </span>] </span><span class="ex"><em>a biweekly bulletin</em> </span></span><span class="exGrp"><span class="lbl">| </span><span class="gramGrp">[as <span class="syntax">adv. </span>] </span><span class="ex"><em>she followed her doctor&#8217;s instructions to undergo health checks </em><em>biweekly</em><em>.</em></span></span></span></span></p>
<p>Wow.  I never finished my course in Language Philosophy in 1992, but I remember the Morning Star Paradox quite well.  It goes something like this:</p>
<ul>
<li>Mary belives that the Morning Star is Lucifer, and she believes that the Evening Star is the goddess Venus.  Her friend Tycho is aware of her beliefs, but&#8230;</li>
<li>Tycho knows that the Morning Star and the Evening Star refer to the same physical object, so&#8230;</li>
<li>Tycho thinks that Mary believes that Lucifer and Venus are one and the same.</li>
</ul>
<p>I remember that this was a useful tool for understanding the difference between a reference and a referent or somesuch, but most of all I thought it was beautiful.  Mary has romantic beliefs about the existance of deities and their position in the sky, and while scientists normally shrug at romantic beliefs, they (we) all have to stick our noses into this one.  Dear Mary, you can believe that the Morning Star is Lucifer, and you can believe that the Evening Star is Venus, but you can&#8217;t believe both.  If you can&#8217;t see the beauty in this I probably can&#8217;t help you.</p>
<p>Anyway, here are today&#8217;s more or less contradictory words:</p>
<p><strong>biweekly:</strong> (adj,adv) every two weeks or twice a week; (noun) a periodical that appears every two weeks or twice a week</p>
<p><strong>bimonthly:</strong> (adj,adv) occurring or produced twice a month or every two months; (noun) a periodical produced twice a month or every two months.  (With the added note that &#8220;[i]n the publishing world, the meaning of bimonthly is more fixed and is invariably used to mean ‘every two months.’&#8221;)</p>
<p><strong>biennal:</strong> (adj) taking place every other year, (noun) 1 a plant that takes two years to grow from seed to fruition and die. 2 an event celebrated or taking place every two years.</p>
<p><strong>biannual:</strong> (adj) occurring twice a year</p>
<p>There are a few other things that come to mind when I see these words together.  One is that &#8216;biannual&#8217; is never a noun.  Another is that the lexicographers chose to say &#8220;every two weeks or twice a week&#8221; but &#8220;twice a month or every two months&#8221;.  Order is not always significant in a dictionary, but it&#8217;s hard to fathom that not at least one of the two entries has a bias for &#8216;twice&#8217; or &#8216;every two&#8217;.  But it&#8217;s of course impossible to know which one it is.</p>
<p>And thirdly, the note for &#8216;bimonthly&#8217; as a noun makes me wonder if the notes are written by a different group of people from the ones who write the actual definitions, or if &#8216;publishing world&#8217; is the key word here.  You and I might call a periodical that appears every two weeks bimonthly since it appears twice a month, but in the publishing world, it will be a biweekly instead.</p>
<p>Wow.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/11/same-same-but-different/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>It&#8217;s fun to thrash bikes</title>
		<link>http://notetoself.vrensk.com/2008/10/its-fun-to-thrash-bikes/</link>
		<comments>http://notetoself.vrensk.com/2008/10/its-fun-to-thrash-bikes/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 14:10:59 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Life outside work]]></category>
		<category><![CDATA[bike]]></category>
		<category><![CDATA[pleasure]]></category>
		<category><![CDATA[saving money]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=34</guid>
		<description><![CDATA[Note to self: don&#8217;t leave your bike parked downtown (or indeed on public streets) over the night.  Apparently there is a great deal of pleasure to be had by thrashing other people&#8217;s bicycles.  And while I take pleasure from seeing my fellow man enjoying himself, I cannot really afford to sponsor it any more. I [...]]]></description>
				<content:encoded><![CDATA[<p>Note to self: don&#8217;t leave your bike parked downtown (or indeed on public streets) over the night.  Apparently there is a great deal of pleasure to be had by thrashing other people&#8217;s bicycles.  And while I take pleasure from seeing my fellow man enjoying himself, I cannot really afford to sponsor it any more.</p>
<p>I parked my bike on Magasinsgatan last night in order to watch <a href="http://www.korenrabalder.se/" onclick="pageTracker._trackPageview('/outgoing/www.korenrabalder.se/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Rabalder</a> perform Requiem. (The concert was a treat in a way that would have made Mozart green with envy.  He would have died to have electric guitars in his setting!)  After the concert, I left the bike there and chose to walk to the next event (this being <a href="http://www.kulturnatta.goteborg.se/" onclick="pageTracker._trackPageview('/outgoing/www.kulturnatta.goteborg.se/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Kulturnatta</a>) together with friends.  I live three blocks away and planned to pick up the bike on my way home.  Of course, I pride myself by not living by plans, and when picking up the bike on the way home turned out to be a six block detour, I decided to leave it for today.</p>
<p>I&#8217;ll have to walk more than six blocks to the bike shop to have the three kicked-off spokes replaced, though.  Hopefully it will be cheaper than having the front wheel replaced, like last time, or replacing the night lights the time before that.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/10/its-fun-to-thrash-bikes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flash vulnerability</title>
		<link>http://notetoself.vrensk.com/2008/10/flash-vulnerability/</link>
		<comments>http://notetoself.vrensk.com/2008/10/flash-vulnerability/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 16:21:05 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Developer Client]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=32</guid>
		<description><![CDATA[Apparently something called &#8220;click-jacking&#8221; can be used to hijack the microphone and camera on my laptop and the way to avoid that is to tell Flash that it can never ever have access to mike and cam.  Fine, done. There is a patch coming out in a few weeks (or it may just be included [...]]]></description>
				<content:encoded><![CDATA[<p>Apparently something called &#8220;<a href="http://www.adobe.com/support/security/advisories/apsa08-08.html" onclick="pageTracker._trackPageview('/outgoing/www.adobe.com/support/security/advisories/apsa08-08.html?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">click-jacking</a>&#8221; can be used to hijack the microphone and camera on my laptop and the way to avoid that is to tell Flash that it can never ever have access to mike and cam.  <a href="http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager02.html?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Fine, done</a>.</p>
<p>There is a patch coming out in a few weeks (or it may just be included in Flash 10 which I suppose will be a mandatory upgrade).  Fine again.  But how will I remember to go back and restore Flash&#8217;s access to my microphone and camera?  Well, hopefully I will see this blog entry the next time I write something.  Note to self.</p>
<p>Source: <a href="http://www.macworld.com/article/135961/2008/10/clickjackers.html" onclick="pageTracker._trackPageview('/outgoing/www.macworld.com/article/135961/2008/10/clickjackers.html?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Macworld</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/10/flash-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Verified HTTPS in Ruby</title>
		<link>http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/</link>
		<comments>http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 22:06:32 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Certificate Authorities]]></category>
		<category><![CDATA[HTTPS]]></category>
		<category><![CDATA[peer validation]]></category>
		<category><![CDATA[SSL]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=28</guid>
		<description><![CDATA[I need to pick up an XML file from a server every 30 minutes and process it. I’ve done similar things before, and using Hpricot it is a pleasure: #! /usr/bin/env ruby require 'rubygems' require 'hpricot' require 'open-uri' doc = Hpricot(open("http://example.com/the_file.xml")) (doc / :person).each { &#124;person&#124; ... } Couldn’t be simpler. This time, there is [...]]]></description>
				<content:encoded><![CDATA[<p>I need to pick up an XML file from a server every 30 minutes and process it.  I’ve done similar things before, and using <a href="http://code.whytheluckystiff.net/hpricot/" onclick="pageTracker._trackPageview('/outgoing/code.whytheluckystiff.net/hpricot/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Hpricot</a> it is a pleasure:</p>
<pre><code>#! /usr/bin/env ruby
require 'rubygems'
require 'hpricot'
require 'open-uri'

doc = Hpricot(open("http://example.com/the_file.xml"))
(doc / :person).each { |person| ... }
</code></pre>
<p>Couldn’t be simpler.  This time, there is a snag: the file is sensitive, so the connection is encrypted using HTTPS.  For this article, let’s say we’re talking about <a href="http://www.cert.org/" onclick="pageTracker._trackPageview('/outgoing/www.cert.org/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Cert’s</a> list of new vulnerabilities, which can be found at <a href="https://www.cert.org/blogs/vuls/rss.xml" onclick="pageTracker._trackPageview('/outgoing/www.cert.org/blogs/vuls/rss.xml?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">https://www.cert.org/blogs/vuls/rss.xml</a>.  <code>open-uri</code> supports HTTPS, so it shouldn’t be a problem, but it is:</p>
<pre><code>doc = Hpricot(open("https://www.cert.org/blogs/vuls/rss.xml"))
# =&gt;
/usr/lib/ruby/1.8/net/http.rb:590:in `connect': certificate verify failed (OpenSSL::SSL::SSLError)
</code></pre>
<p><code>OpenSSL</code>, which <code>open-uri</code> uses behind the scenes, fails to verify Cert’s certificate and halts execution.</p>
<h2>Solution 1: skip verification</h2>
<p>Let’s assume that I don’t care much about the verification; all I want is the data, and it just so happens that it is only available through HTTPS.  <code>open-uri</code> doesn’t let me turn off verification so I have to dig deeper.</p>
<p><code>open-uri</code> is just a clever wrapper around Ruby’s comprehensive, but insufficiently documented, networking library that handles a variety of protocols, including HTTPS.  To fetch a web page over a secure connection, you can use something like this sample client (from <code>net/https.rb</code>):</p>
<pre><code>#! /usr/bin/env ruby
require 'net/https'
require 'uri'

uri = URI.parse(ARGV[0] || 'https://localhost/')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true if uri.scheme == "https"  # enable SSL/TLS
http.start {
  http.request_get(uri.path) {|res|
    print res.body
  }
}
</code></pre>
<p>There are three things to note in the sample client:</p>
<ol>
<li>You should <code>require</code> <code>net/https</code>, not <code>net/http</code>.</li>
<li>You create the client with <code>Net::HTTP.new</code>, not <code>Net::HTTPS.new</code>. (There is no <code>HTTPS</code> class despite the fact that you <code>require 'net/https'</code>.)</li>
<li>You need to set <code>use_ssl = true</code> explicitly.  The <code>URI</code> library is clever enough to set its port attribute to 443 when it parses a URI that starts with <code>https</code>, but <code>Net::HTTP</code> isn’t quite as clever.</li>
</ol>
<p>If you put the above code in <code>webclient.rb</code> and run it, you’ll see this:</p>
<pre><code>$ ruby webclient.rb https://www.cert.org/blogs/vuls/rss.xml
warning: peer certificate won't be verified in this SSL session
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;rss version="2.0"&gt;
    &lt;channel&gt;
        &lt;title&gt;Vulnerability Analysis Blog&lt;/title&gt;
[...]
</code></pre>
<p>Yes, it will fetch and print the RSS XML, but it will also warn you that it doesn’t verify the host’s certificate.  Let’s turn off the warning by telling <code>Net::HTTP</code> that we don’t expect it to perform any verification:</p>
<pre><code>uri = URI.parse(ARGV[0] || 'https://localhost/')
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == "https"  # enable SSL/TLS
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_NONE
end
http.start { ... }
</code></pre>
<p>Run this, and you get the same result without the warning.</p>
<h2>Solution 2: add verification</h2>
<p>Solution 1 is not enough for my current needs.  I want encryption, but I also want to know that I’m talking to the right server.  To turn on verification, I change <code>VERIFY_NONE</code> to <code>VERIFY_PEER</code> and run again.  Now I’m back on square one with <code>OpenSSL::SSL::SSLError: certificate verify failed</code>.  Uh-huh.  So what’s wrong with that one?  It works in my browser without problems.</p>
<p>I’m not going to go into how HTTPS and certificate validation works.  Suffice it so say that my browser is more trusting than <code>OpenSSL</code>.  And it’s not blind trust either; the browser knows more Certificate Authorities.  So how do I add them to Ruby and <code>OpenSSL</code>?  I looked around and found a solution to a similar problem, <a href="http://blog.seagul.co.uk/articles/2006-10-24-connecting-to-gmail-with-ruby-or-connecting-to-pop3-servers-over-ssl-with-ruby" onclick="pageTracker._trackPageview('/outgoing/blog.seagul.co.uk/articles/2006-10-24-connecting-to-gmail-with-ruby-or-connecting-to-pop3-servers-over-ssl-with-ruby?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Connecting to POP3 servers over SSL with Ruby</a>.  Adapting that to my HTTPS problem, it becomes a two-step solution:</p>
<ol>
<li>Download the <a href="http://curl.haxx.se/ca/cacert.pem" onclick="pageTracker._trackPageview('/outgoing/curl.haxx.se/ca/cacert.pem?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">CA Root Certificates bundle</a> from haxx.se, the creators of <code>curl</code>.  Store the file in the same directory as <code>webclient.rb</code> and make sure that it’s called <code>cacert.pem</code>.  (But please see the discussion below on <em>Too much trust</em>.)</li>
<li>Make <code>webclient.rb</code> use this file instead of whatever is bundled with <code>OpenSSL</code>.</li>
</ol>
<p>Now we can tell <code>Net::HTTP</code> to use this CA file:</p>
<pre><code>uri = URI.parse(ARGV[0] || 'https://localhost/')
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == "https"  # enable SSL/TLS
  http.use_ssl = true
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  http.ca_file = File.join(File.dirname(__FILE__), "cacert.pem")
end
http.start { ... }
</code></pre>
<p>Look, it works!  It gives the expected output, and it is verifying… something.  But what?  Time to look under the hood again.  It turns out that with these settings, <code>OpenSSL</code> checks that the server certificate is signed by a known CA and has not expired, which is good, but not everything I’m looking for.  I also want it to check that the certificate belongs to the server that I’m talking to.  To see an example, go to <a href="https://google.com/" onclick="pageTracker._trackPageview('/outgoing/google.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">https://google.com/</a>.  In Firefox 3, you should get an iconic policeman telling you it’s a Page Load Error.  The certificate belongs to <code>www.google.com</code>, not <code>google.com</code>.  But our script is not quite as discerning:</p>
<pre><code>$ ruby webclient.rb https://google.com/
hostname was not match with the server certificate
&lt;HTML&gt;&lt;HEAD&gt;&lt;meta http-equiv="content-type" content="text/html;charset=utf-8"&gt;
&lt;TITLE&gt;302 Moved&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;
&lt;H1&gt;302 Moved&lt;/H1&gt;
The document has moved
&lt;A HREF="http://www.google.com"&gt;here&lt;/A&gt;.
&lt;/BODY&gt;&lt;/HTML&gt;
</code></pre>
<p>Note the warning on the first line of output.  Apparently <code>Net::HTTP</code> checks to see if the certificate belongs to the host, but it’s not a fatal error.  To change this, we need to enable the “post-connection check”.  So here is the final version of the script:</p>
<pre><code>#! /usr/bin/env ruby
require 'net/https'
require 'uri'

uri = URI.parse(ARGV[0] || 'https://localhost/')
http = Net::HTTP.new(uri.host, uri.port)
if uri.scheme == "https"  # enable SSL/TLS
  http.use_ssl = true
  http.enable_post_connection_check = true
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
  http.ca_file = File.join(File.dirname(__FILE__), "cacert.pem")
end
http.start {
  http.request_get(uri.path) {|res|
    print res.body
  }
}
</code></pre>
<p>Now it will fail for <code>https://google.com/</code> but succeed for <code>https://www.google.com/</code>.  Done!</p>
<h2>Too much trust</h2>
<p>OK, I should admit that downloading a file from someplace called <code>haxx.se</code> doesn’t seem like the best way to raise security.  If you really want to know who you will be trusting, you should download Root Certificates from each of the CA’s that you trust.  That’s way too much work for the application I’m working on right now, but it might be a requirement for you.  If you don’t want to go mad, though, try doing it the same way the haxx people did.  They wrote a little tool to extract the Root Certificates from the source files of Mozilla, and they even have a tool for extracting it from your binary installation.  Check out <a href="http://curl.haxx.se/docs/caextract.html" onclick="pageTracker._trackPageview('/outgoing/curl.haxx.se/docs/caextract.html?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">their documentation</a> for a full description and links to the tools (source code).</p>
<p><strong>[Update: </strong>John in comment 16 has written up an instruction on how to get the certificates file using https.  Turtles all the way down.]</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/09/verified-https-in-ruby/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>XHTML unsupported, prefer HTML</title>
		<link>http://notetoself.vrensk.com/2008/08/xhtml-unsupported-prefer-html/</link>
		<comments>http://notetoself.vrensk.com/2008/08/xhtml-unsupported-prefer-html/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 15:27:04 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=19</guid>
		<description><![CDATA[[This is a re-write of a project note I wrote in project over a year ago. Published here to make the world a better place.] There has been some commotion recently regarding XHTML and HTML, where standardistas have reiterated their arguments about XHTML: it’s a nice standard, but since is isn’t actually treated as XHTML [...]]]></description>
				<content:encoded><![CDATA[<p><em>[This is a re-write of a project note I wrote in project over a year ago.  Published here to make the world a better place.]</em></p>
<p>There has been some commotion recently regarding XHTML and HTML, where standardistas have reiterated their arguments about XHTML: it’s a nice standard, but since is isn’t actually treated as XHTML by browsers, it’s better to use HTML.</p>
<p>The “standard” text on this (at least for me) is <a href="http://www.hixie.ch/advocacy/xhtml" onclick="pageTracker._trackPageview('/outgoing/www.hixie.ch/advocacy/xhtml?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">http://www.hixie.ch/advocacy/xhtml</a> from which I&#8217;d like to quote the executive summary:</p>
<blockquote>
<p>If you use XHTML, you should deliver it with the application/xhtml+xml MIME type. If you do not do so, you should use HTML4 instead of XHTML. The alternative, using XHTML but   delivering it as text/html, causes numerous problems that are outlined below. Unfortunately, IE6   does not support application/xhtml+xml (in fact, it does not support XHTML at all).</p>
</blockquote>
<p>I have come back to that text on several occasions, but it never quite convinced me.  I didn&#8217;t want to lose the well-formedness of XHTML.  Then I ran across <a href="http://www.webdevout.net/articles/beware-of-xhtml" onclick="pageTracker._trackPageview('/outgoing/www.webdevout.net/articles/beware-of-xhtml?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">http://www.webdevout.net/articles/beware-of-xhtml</a> which made me change my mind. The article uses numerous examples to show that XHTML is not just a syntactically nicer version of HTML, but it actually has slightly differing rules for how to apply CSS.  So basically, in all projects that I have used XHTML, I have been relying on bugs in present browsers.  Ouch.</p>
<h3 id="time_to_change8212back">Time to change&#8212;back</h3>
<p>They promised us that XHTML was the future, so I haven&#8217;t worried too much about HTML lately. Are there any downsides to using HTML instead?  Well, not per se.  But the tools and platforms I use are slightly XHTML-centric.</p>
<ol>
<li>
<p>All the standard Rails helpers (form helpers, JS helpers, etc.) produce xhtml.  The simple solution is to drop this in a file in <code>lib/</code>:</p>
<pre><code>module ActionView::Helpers::TagHelper
  def tag_with_html_syntax(name, options = nil, open = true, escape = true)
    tag_without_html_syntax(name, options, open, escape)
  end
  alias_method_chain :tag, :html_syntax
end
</code></pre>
</li>
<li>
<p><a href="http://macromates.com/" onclick="pageTracker._trackPageview('/outgoing/macromates.com/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">TextMate</a> snippets produce XHTML. Most of them can be controlled by an  environment variable, but there are exceptions, like C-ret which produces produces an XHTML self-closed br element.</p>
</li>
<li>External tools, data sources and parsers are usually xml-centric.</li>
<li><a href="http://wordpress.org/" onclick="pageTracker._trackPageview('/outgoing/wordpress.org/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">WordPress</a>, which I have used for a few client projects lately, spits out XHTML. I&#8217;ll see if I can create a patch for that and have it accepted.</li>
</ol>
<p>Oh well.  XHTML, I&#8217;ll miss you.  HTML, can we be friends again?</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/08/xhtml-unsupported-prefer-html/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Escaping single quotes in Ruby harder than expected</title>
		<link>http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/</link>
		<comments>http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 14:23:22 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[gotcha]]></category>
		<category><![CDATA[regexp]]></category>
		<category><![CDATA[SQL escape]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=15</guid>
		<description><![CDATA[So I was writing this tool to create a bunch of SQL statements from a data dump. Simple enough, right. And as always when you generate SQL statements, you have to make sure that the data doesn’t interfere with the SQL syntax by escaping the single quotes (and generally any binary data, but I didn’t [...]]]></description>
				<content:encoded><![CDATA[<p>So I was writing this tool to create a bunch of SQL statements from a data dump.  Simple enough, right.  And as always when you generate SQL statements, you have to make sure that the data doesn’t interfere with the SQL syntax by escaping the single quotes (and generally any binary data, but I didn’t have that).  Any database gem/module/library has that built-in, of course, but I didn’t want to use that.  So I said <strong>[Note: this doesn't work. Read on for the solution.]</strong></p>
<pre><code>def quote (str)
  str.gsub('\\','\\\\').gsub('\'','\\\'')
end
</code></pre>
<p>I read this as “replace all backslashes with double backslashes, and then replace all single quotes with a backslash and a single quote”.  I added a simple test for it (yay TestUnit!):</p>
<pre><code>def setup
  @m = Migrate.new
end

def test_quote
  assert_equal("I\\'m home", @m.quote("I'm home"))
end

</code></pre>
<p>But imagine my surprise when I got</p>
<pre><code>  1) Failure:
test_quote(TestMigrate) [migration/test_migrate.rb:29]:
&lt; "I\\'m home"&gt; expected but was
&lt; "Im homem home"&gt;.
</code></pre>
<p>Ooookay.  What’s wrong here?  Have I misunderstood the rules for escaping the escape sequence?  It’s supposed to be easier with single quotes, but maybe I got it wrong.  So I tried with double quotes:</p>
<pre><code>def quote (str)
  str.gsub("\\","\\\\").gsub("'","\\'")
end
</code></pre>
<p>Surely this would work?  Nope, it gives the exact same error.  Time to look up <code>gsub</code> in the <a href="http://www.ruby-doc.org/core/classes/String.html#M000749" onclick="pageTracker._trackPageview('/outgoing/www.ruby-doc.org/core/classes/String.html_M000749?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">manual</a>:</p>
<blockquote><p><strong>str.gsub(pattern, replacement) =&gt; new_str<br />
str.gsub(pattern) {|match| block } =&gt; new_str</strong></p>
<p>[…] If a string is used as the replacement, special variables from the match (such as $&amp; and $1) cannot be substituted into it, as substitution into the string occurs before the pattern match starts. However, the sequences \1, \2, <strong>and so on</strong> [my emphasis] may be used to interpolate successive groups in the match.</p></blockquote>
<p>“And so on”?  Oh, so obviously <code>\'</code> (escaped <code>\\'</code> in the string literal) is the replacement string equivalent of <code>$'</code>, which means everything afther the match (as all regexp hackers know).  So I need to escape the backslash for regexp engine too:</p>
<pre><code>def quote (str)
  str.gsub("\\","\\\\").gsub("'","\\\\'")
end
</code></pre>
<p>OK, the tests pass.  But the code looks wrong.  Four backslashes can’t work for both cases, can they?  Let’s add a test case:</p>
<pre><code>def test_quote
  assert_equal("I\\'m home", @m.quote("I'm home"))
  assert_equal("S\\\\N", @m.quote("S\\N"))
end

</code></pre>
<p>Nope, that fails.  So we need this:</p>
<pre><code>def quote (str)
  str.gsub("\\","\\\\\\\\").gsub("'","\\\\'")
end
</code></pre>
<p>Eight backslashes.  Yes, the test passes, but is it worth it?  Is it understandable?  I don’t want comments to explain my code.  Comments are good to provide a raison d’être for something, but not to explain its looks.  Let’s switch to the other form of gsub:</p>
<pre><code>def quote (str)
  str.gsub(/\\|'/) { |c| "\\#{c}" }
end
</code></pre>
<p>“If you see a backslash or a single quote, replace it with a backslash and whatever you saw.”  That’s what I wanted to say anyway.</p>
<p>Good.  But I wrote this in <a href="http://daringfireball.net/projects/markdown/syntax" onclick="pageTracker._trackPageview('/outgoing/daringfireball.net/projects/markdown/syntax?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Markdown</a>, so now I have to generate the HTML and the go through it and make sure that I restore whatever backslashes Markdown ate. (It turns out it didn&#8217;t eat any.  TextMate has a Markdown Preview function that ate a lot of backslashes, but when I said &#8220;Convert to HTML&#8221; it didn&#8217;t eat any at all.  Go figure.)</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/08/escaping-single-quotes-in-ruby-harder-than-expected/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>The survey</title>
		<link>http://notetoself.vrensk.com/2008/08/the-survey/</link>
		<comments>http://notetoself.vrensk.com/2008/08/the-survey/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 12:44:40 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[The daily grind]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=12</guid>
		<description><![CDATA[It&#8217;s time for the yearly survey for web professionals: But that&#8217;s hardly a note to self.  Looks like I&#8217;m turning this into a blog.]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s time for the yearly survey for web professionals:<br />
<a href="http://www.alistapart.com/articles/survey2008" onclick="pageTracker._trackPageview('/outgoing/www.alistapart.com/articles/survey2008?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');"><img class="aligncenter size-full wp-image-13" title="i-took-the-2008-survey" src="http://notetoself.vrensk.com/wp-content/uploads/2008/08/i-took-the-2008-survey.gif" alt="" width="180" height="46" /></a></p>
<p>But that&#8217;s hardly a note to self.  Looks like I&#8217;m turning this into a blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/08/the-survey/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysql gem on OS X Leopard</title>
		<link>http://notetoself.vrensk.com/2008/07/mysql-gem-on-os-x-leopard/</link>
		<comments>http://notetoself.vrensk.com/2008/07/mysql-gem-on-os-x-leopard/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 14:03:54 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Developer Client]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[Leopard]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[works for me]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=9</guid>
		<description><![CDATA[Installing the mysql gem for Ruby is almost always a mess, as witnessed by the large number of hits one get when googling for &#8220;mysql gem leopard&#8221;.  To make the gem work with your platform, you need to ensure that the &#8216;make&#8217; command run internally by &#8216;gem&#8217; has the right ARCHFLAGS, which most of the [...]]]></description>
				<content:encoded><![CDATA[<p>Installing the mysql gem for Ruby is almost always a mess, as witnessed by the <a href="http://www.notsostupid.com/blog/2007/10/25/ruby-leopard-and-gems/" onclick="pageTracker._trackPageview('/outgoing/www.notsostupid.com/blog/2007/10/25/ruby-leopard-and-gems/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">large</a> <a href="http://www.schmidp.com/2007/9/29/rails-mysql-and-leopard" onclick="pageTracker._trackPageview('/outgoing/www.schmidp.com/2007/9/29/rails-mysql-and-leopard?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">number</a> <a href="http://www.rubyhead.com/2007/10/29/mysql-gem-in-leopard/" onclick="pageTracker._trackPageview('/outgoing/www.rubyhead.com/2007/10/29/mysql-gem-in-leopard/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">of</a> <a href="http://weblog.rubyonrails.org/2007/10/26/today-is-leopard-day" onclick="pageTracker._trackPageview('/outgoing/weblog.rubyonrails.org/2007/10/26/today-is-leopard-day?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">hits</a> one get when googling for &#8220;mysql gem leopard&#8221;.  To make the gem work with your platform, you need to ensure that the &#8216;make&#8217; command run internally by &#8216;gem&#8217; has the right ARCHFLAGS, which most of the web pages will tell you about.  So</p>
<pre>sudo env ARCHFLAGS='-arch i386' gem install mysql</pre>
<p>should handle it, more or less.  But since Leopard (the client version) does not have mysql, you will have had to install that on your own (I installed the MySQL binary package for 10.4, from <a href="http://dev.mysql.com/downloads/mysql/5.0.html#macosx-dmg" onclick="pageTracker._trackPageview('/outgoing/dev.mysql.com/downloads/mysql/5.0.html_macosx-dmg?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">dev.mysql.com</a>, because there was no 10.5 package available the day after I Leopard was released), and &#8216;gem&#8217; isn&#8217;t good at guessing where it is.  So I need to say</p>
<pre>sudo env ARCHFLAGS='-arch i386' gem install mysql -- --with-mysql-dir=/usr/local/mysql</pre>
<p>But for some reason that is not quite enough either.  I get this error:</p>
<pre>/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle:
dlopen(/Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle, 9):
Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib (LoadError)

  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle

  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql-2.7/lib/mysql.bundle
      from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:32:in `require'
      from my_script.rb:6</pre>
<p>Hey, look at that.  It actually tries to load the lib from `/usr/local/mysql/lib/mysql` rather than `/usr/local/mysql/lib`.  Why?  I don&#8217;t know.  I couldn&#8217;t be bothered to dive into the code, so I went for the quick workaround:</p>
<pre>sudo ln -s . /usr/local/mysql/lib/mysql</pre>
<p>Silly, and perhaps not the cleanest way to do it, but it works for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/07/mysql-gem-on-os-x-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache with PHP on FC6</title>
		<link>http://notetoself.vrensk.com/2008/07/apache-with-php-on-fc6/</link>
		<comments>http://notetoself.vrensk.com/2008/07/apache-with-php-on-fc6/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 18:00:08 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Server Configuration]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[FC6]]></category>
		<category><![CDATA[Fedora]]></category>
		<category><![CDATA[private DNS]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=7</guid>
		<description><![CDATA[I acquired this server in December 2006 to host a few Rails projects and one of the first things I did was to disable Apache and install Nginx.  Once I decided to use WordPress for this blog, I needed PHP, and while I could have tried to set up PHP for Nginx, I decided to [...]]]></description>
				<content:encoded><![CDATA[<p>I acquired this server in December 2006 to host a few <a href="http://www.rubyonrails.org/" onclick="pageTracker._trackPageview('/outgoing/www.rubyonrails.org/?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">Rails</a> projects and one of the first things I did was to disable Apache and install Nginx.  Once I decided to use WordPress for this blog, I needed PHP, and while I could have tried to set up PHP for Nginx, I decided to go the easy route and use the familiar LAMP combo.  I have after all used Apache in various guises ever since it was the Cern httpd back in 1993, so it should be no match for me.</p>
<p>Not so.  But to make a long story short and save myself some time next time around, here are the mistakes I made:</p>
<h2>Private DNS</h2>
<p>My wardrobe server (on my home network) hosts a number of public-facing web servers; little things that I set up for friends before I started doing web work professionally.  So, for instance www.norbusam.org points to my fixed home IP, and all traffic on port 80 is forwarded to my server.  The WGR614 that I use for NAT and routing is not smart enough to let me use the public interface from the private part of the network, i.e. if I sit at my desk at home and enter www.norbusam.org into my web browser, I won&#8217;t get anywhere.  That would have annoyed me if I hadn&#8217;t liked the solution so much: I set up a DNS daemon on the home server and let it trick all home computers to use the internal interface (192.168.x.y) for norbusam.org and others.  Easy as pie.</p>
<p>This came back to bite me for hours on end last night.  notetoself.vrensk.com was pointing at my home server, so while I was hacking the Apache settings on this server and reloading my browser furiously, all I got was my home server.  And since both run Apache, I never got suspicious—it just looked like my changes didn&#8217;t take.  Ouch.</p>
<h2>SELinux</h2>
<p>This server is running Security Enhanced Linux out of the box.  I asked for a vanilla install of FC6, and apparently SELinux is switched on by default.  I decided to keep it on when I got the server since I saw it as a learning opportunity.  It caused me some problems when I set up Postfix when the server was new, but I sorted it out and haven&#8217;t thought about it since then.</p>
<p>This, too, came back to bite me for a couple of hours.  It turns out that the default setting of SE for Apache are somewhere between frugal and paranoid.  There are various security bits to be set or cleared, and the default setting assumes that I only want to publish pages from a root-blessed directory and that I don&#8217;t want to run any scripts, use a database or have httpd talk to any other servers out there.  Rather than go through all these settings one by one and reverse them (and risk disabling something that was actually permissive to start with) I decided to turn off SELinux for Apache:</p>
<pre># setsebool -P httpd_disable_trans 1</pre>
<p>Followed by a restart (not reload) of Apache.  I&#8217;m indebted to <a href="http://beginlinux.com/index.php/server_training/web-server/117-web-server/976-apache-and-selinux" onclick="pageTracker._trackPageview('/outgoing/beginlinux.com/index.php/server_training/web-server/117-web-server/976-apache-and-selinux?referer=http%3A%2F%2Fnotetoself.vrensk.com%2Ffeed');">an article at Begin Linux</a> for this solution.  I can&#8217;t recommend reading the actual article though, as it is just a long recapitulation of man pages and other documentation without a trace of explanation or even a try to put things in context.</p>
<p>Oh well.  Next time I will make sure to double check my IPs and disable SELinux at least while setting up a system.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/07/apache-with-php-on-fc6/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Manifesto</title>
		<link>http://notetoself.vrensk.com/2008/07/manifesto/</link>
		<comments>http://notetoself.vrensk.com/2008/07/manifesto/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 16:57:43 +0000</pubDate>
		<dc:creator>David Vrensk</dc:creator>
				<category><![CDATA[Meta]]></category>

		<guid isPermaLink="false">http://notetoself.vrensk.com/?p=3</guid>
		<description><![CDATA[While this is a public blog, its primary audience is not the meandering surfers of the inter-tubes, but myself.  I need someplace to store various findings and HOWTOs that I write for myself.  I assume that they will prove useful for others too, from time to time, but that is mostly a side-effect. That being [...]]]></description>
				<content:encoded><![CDATA[<p>While this is a public blog, its primary audience is not the meandering surfers of the inter-tubes, but myself.  I need someplace to store various findings and HOWTOs that I write for myself.  I assume that they will prove useful for others too, from time to time, but that is mostly a side-effect.</p>
<p>That being said, I might produce the occasional rant or Instruction For Your Betterment or something else intended for public consumption.  I will let you know.</p>
]]></content:encoded>
			<wfw:commentRss>http://notetoself.vrensk.com/2008/07/manifesto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
