<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>some problems, solutions, and other stuff  i’ve encountered as a web developer</description><title>Python FTW!</title><generator>Tumblr (3.0; @teem)</generator><link>http://www.timmedina.net/</link><item><title>Note to self: Add mysql bin dir to path</title><description>&lt;p&gt;When installing &lt;code&gt;mysql&lt;/code&gt; gem in Ruby 1.9.1 (using &lt;a href="http://rvm.beginrescueend.com"&gt;rvm&lt;/a&gt;), the process keeps on failing even when specifying &lt;code&gt;--with-mysql-dir=/usr/local/mysql&lt;/code&gt; etc. Apparently the solution is to add the &lt;code&gt;/usr/local/mysql&lt;/code&gt; to &lt;code&gt;$PATH&lt;/code&gt; before issuing the &lt;code&gt;gem install&lt;/code&gt; command.&lt;/p&gt;</description><link>http://www.timmedina.net/post/434935785</link><guid>http://www.timmedina.net/post/434935785</guid><pubDate>Tue, 09 Mar 2010 01:25:28 +0800</pubDate><category>solutions</category><category>ruby1.9.1</category><category>mysql</category><category>gems</category></item><item><title>"Fail fast, fail open."</title><description>“Fail fast, fail open.”</description><link>http://www.timmedina.net/post/365234493</link><guid>http://www.timmedina.net/post/365234493</guid><pubDate>Mon, 01 Feb 2010 23:46:21 +0800</pubDate></item><item><title>SWFUpload + Rails == Invalid Authenticity Token</title><description>&lt;p&gt;&lt;a href="http://github.com/lardawge/swfupload-rails-authentication"&gt;http://github.com/lardawge/swfupload-rails-authentication&lt;/a&gt;&lt;/p&gt;</description><link>http://www.timmedina.net/post/341220557</link><guid>http://www.timmedina.net/post/341220557</guid><pubDate>Tue, 19 Jan 2010 02:26:00 +0800</pubDate><category>rails</category><category>swfupload</category><category>jquery</category></item><item><title>openssl, eventmachine, and the ruby 1.8.7 (and ree, too) bus error</title><description>&lt;p&gt;Rails 3 is going to require at least Ruby 1.8.7 so I decided to install Ruby Enterprise Edition  on my Mac. I have OSX Leopard (10.5.8) and use macports. After installing &lt;a href="http://rvm.beginrescueend.com/"&gt;rvm&lt;/a&gt;, I encountered the same problem whenever I executed my web server in my Rails app:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/usr/local/rvm/ree-1.8.7-2009.10/lib/ruby/1.8/openssl/ssl.rb:31: [BUG] Bus Error
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI 0x8770, Ruby Enterprise Edition 2009.10
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The culprit is that I have two openssl installations and the eventmachine gem isn’t compiled with the same openssl as the my REE install. This issue was reported &lt;a href="http://github.com/eventmachine/eventmachine/issues#issue/11"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So the solution is either to recompile REE to use Macport’s openssl or recompile eventmachine to use the system’s openssl lib. I chose to recompile REE.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo rvm install ree --configure --enable-shared=true,--with-openssl-dir=/opt/local --debug
&lt;/code&gt;&lt;/pre&gt;</description><link>http://www.timmedina.net/post/319568080</link><guid>http://www.timmedina.net/post/319568080</guid><pubDate>Wed, 06 Jan 2010 17:49:38 +0800</pubDate><category>ruby1.8.7</category><category>ruby</category><category>ree</category><category>openssl</category><category>bus error</category><category>osx</category><category>eventmachine</category><category>macports</category></item><item><title>Symbian development on Linux and OS X</title><description>&lt;a href="http://www.martin.st/symbian/"&gt;Symbian development on Linux and OS X&lt;/a&gt;</description><link>http://www.timmedina.net/post/204268136</link><guid>http://www.timmedina.net/post/204268136</guid><pubDate>Sun, 04 Oct 2009 23:58:41 +0800</pubDate><category>symbian</category><category>osx</category><category>mobile</category><category>tools</category></item><item><title>Adding Date And Time To Your Bash History</title><description>&lt;a href="http://www.howtoforge.com/adding-date-and-time-to-your-bash-history"&gt;Adding Date And Time To Your Bash History&lt;/a&gt;: &lt;p&gt;export HISTTIMEFORMAT=”%h/%d - %H:%M:%S “&lt;/p&gt;</description><link>http://www.timmedina.net/post/179337744</link><guid>http://www.timmedina.net/post/179337744</guid><pubDate>Fri, 04 Sep 2009 11:44:53 +0800</pubDate></item><item><title>RailsAPI Textmate Bundle</title><description>&lt;a href="http://github.com/gunn/railsapi-tmbundle/tree/master"&gt;RailsAPI Textmate Bundle&lt;/a&gt;: &lt;p&gt;Textmate bundle for viewing Rails documentation (using railsapi.com).&lt;/p&gt;</description><link>http://www.timmedina.net/post/159538694</link><guid>http://www.timmedina.net/post/159538694</guid><pubDate>Mon, 10 Aug 2009 11:43:23 +0800</pubDate><category>rails</category><category>textmate</category></item><item><title>Moved to Tumblr</title><description>&lt;p&gt;I migrated my stuff from &lt;a href="http://slicehost.com"&gt;Slicehost&lt;/a&gt; to &lt;a href="http://tumblr.com"&gt;tumblr&lt;/a&gt;. I started by backing up the contents of my slice to my laptop &lt;a href="http://articles.slicehost.com/2007/10/9/backing-up-your-files-with-rsync"&gt;using rsync&lt;/a&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rsync -e ssh -avl --delete --stats --progress user@timmedina.com:/home/user backup
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After everything was backed up, I deleted my slice, bought a .net domain, and configured my tumblr account to &lt;a href="http://www.tumblr.com/docs/custom_domains"&gt;use custom domain names&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I’m still thinking of a way to organize my website. I’ll probably learn to &lt;a href="http://www.tumblr.com/docs/custom_domains"&gt;create custom themes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;And I have to add commenting, too.&lt;/p&gt;</description><link>http://www.timmedina.net/post/159234863</link><guid>http://www.timmedina.net/post/159234863</guid><pubDate>Mon, 10 Aug 2009 01:43:59 +0800</pubDate><category>rsync</category><category>tumblr</category></item><item><title>Tumblenote!</title><description>&lt;a href="http://tumblenote.tumblr.com/"&gt;Tumblenote!&lt;/a&gt;</description><link>http://www.timmedina.net/post/155543683</link><guid>http://www.timmedina.net/post/155543683</guid><pubDate>Tue, 04 Aug 2009 17:34:03 +0800</pubDate></item><item><title>PL/Python cheatsheet with some tute links</title><description>&lt;a href="http://www.postgresonline.com/journal/index.php?/archives/106-PL-Python-Cheatsheet-Overview.html"&gt;PL/Python cheatsheet with some tute links&lt;/a&gt;</description><link>http://www.timmedina.net/post/104871733</link><guid>http://www.timmedina.net/post/104871733</guid><pubDate>Fri, 08 May 2009 11:42:00 +0800</pubDate><category>python</category></item><item><title>Postgresql Leopard Gotchas</title><description>&lt;a href="http://earthcode.com/blog/2008/01/postgresql_on_leopard_gotchas.html"&gt;Postgresql Leopard Gotchas&lt;/a&gt;: &lt;p&gt;After a fresh postgresql installation, &lt;code&gt;initdb&lt;/code&gt; didn’t work until I reset the &lt;code&gt;kern.sysv.shmall&lt;/code&gt; and &lt;code&gt;kern.sysv.shmmax&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo sysctl -w kern.sysv.shmmax=134217728
sudo sysctl -w kern.sysv.shmall=65536
&lt;/code&gt;&lt;/pre&gt;</description><link>http://www.timmedina.net/post/104404145</link><guid>http://www.timmedina.net/post/104404145</guid><pubDate>Thu, 07 May 2009 10:12:00 +0800</pubDate><category>osx</category><category>leopard</category><category>postgresql</category></item><item><title>A Better ri</title><description>&lt;a href="http://danielchoi.com/software/ri-enhanced.html"&gt;A Better ri&lt;/a&gt;</description><link>http://www.timmedina.net/post/99577867</link><guid>http://www.timmedina.net/post/99577867</guid><pubDate>Fri, 24 Apr 2009 14:54:00 +0800</pubDate><category>ruby</category></item><item><title>Debian Administration: Using GNU Screen </title><description>&lt;a href="http://www.debian-administration.org/articles/34"&gt;Debian Administration: Using GNU Screen &lt;/a&gt;: &lt;p&gt;&lt;ul&gt;
&lt;li&gt;screen
&lt;ul&gt;
&lt;li&gt;Run a new screen session&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;screen -R
&lt;ul&gt;
&lt;li&gt;Reattach to a previously detatched session&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a c
&lt;ul&gt;
&lt;li&gt;Create a new window.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a k
&lt;ul&gt;
&lt;li&gt;Kill the current window - after confirmation&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a Ctrl-a
&lt;ul&gt;
&lt;li&gt;Switch to the other window&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a S
&lt;ul&gt;
&lt;li&gt;Split the current window in two.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a TAB
&lt;ul&gt;
&lt;li&gt;Move between split sections of the screen.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a A
&lt;ul&gt;
&lt;li&gt;Give the the current window a name.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Ctrl-a ”
&lt;ul&gt;
&lt;li&gt;List all windows - move around to change the window with the arrow keys&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;/p&gt;</description><link>http://www.timmedina.net/post/98832169</link><guid>http://www.timmedina.net/post/98832169</guid><pubDate>Wed, 22 Apr 2009 16:13:46 +0800</pubDate><category>screen</category></item><item><title>Using Debugger in a Phusion Passenger Dev setup</title><description>&lt;a href="http://duckpunching.com/passenger-mod_rails-for-development-now-with-debugger"&gt;Using Debugger in a Phusion Passenger Dev setup&lt;/a&gt;: &lt;p&gt;My setup: Rails 2.1.2, Passenger 2.2.1, ruby-debug 0.10.3&lt;/p&gt;</description><link>http://www.timmedina.net/post/98360152</link><guid>http://www.timmedina.net/post/98360152</guid><pubDate>Tue, 21 Apr 2009 10:16:36 +0800</pubDate><category>ruby on rails</category></item><item><title>app-engine-patch -- ignoring mediagenerator</title><description>&lt;p&gt;move the django admin media files from _generated_media/1/admin to some directory inside the PROJECT_DIR:&lt;/p&gt;
&lt;p&gt;1. move the admin dir to desired location, say PROJECT_DIR/admin_media&lt;/p&gt;
&lt;p&gt;2. modify app.yaml urls to point to that static_dir location, e.g. add&lt;/p&gt;
&lt;p&gt;- url: /admin_media&lt;/p&gt;
&lt;p&gt;static_dir: admin_media&lt;/p&gt;
&lt;p&gt;3. modify the MEDIA_URL and ADMIN_MEDIA_PREFIX in settings.py&lt;/p&gt;
&lt;p&gt;MEDIA_URL = “/media/”&lt;/p&gt;
&lt;p&gt;ADMIN_MEDIA_PREFIX = “/admin_media/”&lt;/p&gt;
We need to override MEDIA_URL so that when we access the media_url path from the templates, we don’t get the altered media_url (settings_post.py alters this by appending the MEDIA_VERSION by interpolating the %s. ADMIN_MEDIA_PREFIX is also based on the MEDIA_URL, but we want it to use /admin_media.</description><link>http://www.timmedina.net/post/97855838</link><guid>http://www.timmedina.net/post/97855838</guid><pubDate>Mon, 20 Apr 2009 02:16:10 +0800</pubDate><category>django</category><category>appengine</category><category>app-engine-patch</category></item><item><title>Installed some stuff today</title><description>&lt;p&gt;wxpython from http://www.wxpython.org/download.php Unicode py2.5 build&lt;/p&gt;
&lt;p&gt;sqlalchemy 0.5.3 via easy_install&lt;/p&gt;
&lt;p&gt;phusion passenger 2.2 and nginx (installed via passenger)&lt;/p&gt;</description><link>http://www.timmedina.net/post/97852791</link><guid>http://www.timmedina.net/post/97852791</guid><pubDate>Mon, 20 Apr 2009 02:04:19 +0800</pubDate><category>python</category><category>eggs</category><category>ruby</category><category>ruby on rails</category></item><item><title>"All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in..."</title><description>“All programmers are optimists. Perhaps this modern sorcery especially attracts those who believe in happy endings and fairy godmothers. Perhaps the hundreds of nitty frustrations drive away all but those who habitually focus on the end goal. Perhaps it is merely that computers are young, programmers are younger, and the young are always optimists.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Frederick Brooks&lt;/em&gt;</description><link>http://www.timmedina.net/post/55111349</link><guid>http://www.timmedina.net/post/55111349</guid><pubDate>Sat, 18 Oct 2008 11:58:54 +0800</pubDate></item><item><title>Content Types in Rails Controllers and RSpec'ing It</title><description>&lt;p&gt;From the to_csv plugin README, you can set the content type to text/csv in your rails controller action:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;response.headers['Content-Type'] = 'text/csv; charset=iso-8859-1; header=present'
response.headers['Content-Disposition'] = "attachment; filename=users_#{Time.now.strftime("%m-%d-%Y")}.csv"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;To RSpec this behavior, this works:&lt;/b&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Then "the output should be a CSV" do
  response.headers["type"].should have_text('text/csv')
end&lt;/code&gt;&lt;/pre&gt;</description><link>http://www.timmedina.net/post/54978244</link><guid>http://www.timmedina.net/post/54978244</guid><pubDate>Fri, 17 Oct 2008 15:57:00 +0800</pubDate><category>ruby</category><category>rspec</category><category>bdd</category><category>rails</category></item><item><title>"If the cost premium for a more productive developer is less than the higher productivity of that..."</title><description>“If the cost premium for a more productive developer is less than the higher productivity of that developer, then it’s cheaper to hire the more expensive developer.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.martinfowler.com/bliki/CheaperTalentHypothesis.html"&gt;Martin Fowler&lt;/a&gt;&lt;/em&gt;</description><link>http://www.timmedina.net/post/47850118</link><guid>http://www.timmedina.net/post/47850118</guid><pubDate>Fri, 29 Aug 2008 10:11:00 +0800</pubDate></item><item><title>Chandler</title><description>&lt;a href="http://chandlerproject.org/"&gt;Chandler&lt;/a&gt;: &lt;p&gt;A notebook you can organize, back up and share!&lt;/p&gt;</description><link>http://www.timmedina.net/post/45705611</link><guid>http://www.timmedina.net/post/45705611</guid><pubDate>Wed, 13 Aug 2008 02:58:09 +0800</pubDate><category>productivity</category><category>software</category><category>tool</category></item></channel></rss>
