tag:blogger.com,1999:blog-157595712024-03-04T23:15:08.474-06:00Pixels and PoliticsPolitics, Computers, Ruby on Rails, and Miscellaneous.Unknownnoreply@blogger.comBlogger102125tag:blogger.com,1999:blog-15759571.post-60061122746781120902014-04-09T14:05:00.001-05:002014-04-09T20:07:59.923-05:00Updating Phusion Passenger to Mitigate the Heartbleed Bug<h2 id="toc_1.1" style="color: #404040; font-family: 'Trebuchet MS', Helvetica, sans-serif; font-size: 2.2em; line-height: 35.20000076293945px; margin-bottom: 0.5em; margin-top: 1.5em;">
Install Passenger/Nginx with Heartbleed Mitigation</h2>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 16px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-top: 1em;">
The following steps may be taken to mitigate the OpenSSL vulnerability.</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 16px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-top: 1em;">
<span style="color: #707070; font-family: 'Trebuchet MS', Helvetica, sans-serif; font-size: 1.8em; line-height: 28.799999237060547px;">Compile the heartbleeder vulnerability tester</span></div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 16px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-top: 1em;">
Locally:</div>
<pre style="border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-left: 2em; margin-top: 1em; padding-left: 0.5em;">$ brew install go # Mac only
$ mkdir -p ~/Code/go
$ export GOPATH=$HOME/Code/go
$ cd $GOPATH
$ go get github.com/titanous/heartbleeder
$ go build heartbleeder
$ bin/heartbleeder example.com
</pre>
<h3 id="toc_1.1.2" style="color: #707070; font-family: 'Trebuchet MS', Helvetica, sans-serif; font-size: 1.8em; line-height: 28.799999237060547px; margin-bottom: 0.5em; margin-top: 1.5em;">
Update Passenger/Nginx</h3>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 16px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-top: 1em;">
On your servers:</div>
<pre style="border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-left: 2em; margin-top: 1em; padding-left: 0.5em;">$ gem update passenger
$ export EXTRA_CXXFLAGS="-DOPENSSL_NO_HEARTBEATS"
$ export EXTRA_CFLAGS="-DOPENSSL_NO_HEARTBEATS"
$ passenger-install-nginx-module
# Update your nginx.conf with the new Passenger path
# Restart your nginx processes
</pre>
<h3 id="toc_1.1.3" style="color: #707070; font-family: 'Trebuchet MS', Helvetica, sans-serif; font-size: 1.8em; line-height: 28.799999237060547px; margin-bottom: 0.5em; margin-top: 1.5em;">
Check your https web servers</h3>
<pre style="border-left-color: rgb(204, 204, 204); border-left-style: solid; border-left-width: 1px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-left: 2em; margin-top: 1em; padding-left: 0.5em;">$ bin/heartbleeder example.com
</pre>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 16px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-top: 1em;">
<strong>Author</strong>: Patrick Morgan (patrick -at- patrick-morgan.net)</div>
<div style="font-family: Tahoma, Geneva, sans-serif; font-size: 16px; line-height: 20.799999237060547px; margin-bottom: 1em; margin-top: 1em;">
<strong>License</strong>: Creative Commons. Distribute Freely!</div>
Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-15759571.post-37753984299544799512013-01-18T23:01:00.001-06:002013-01-18T23:01:26.651-06:00So which branch do I want to merge with?You type <span style="font-family: Courier New, Courier, monospace;">git pull</span> at the command line, then you get a message that says:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">You asked me to pull without telling me which branch you want to merge with, and 'branch.master.merge' in your configuration file does not tell me, either. Please specify which branch you want to use on the command line and try again (e.g. 'git pull <repository> <refspec>'). See git-pull(1) for details.</refspec></repository></span></blockquote>
It goes on to say that you can make an addition to <span style="font-family: Courier New, Courier, monospace;">.git/cofig </span><span style="font-family: inherit;">to correct the underlying issue</span>. I think that is too many keystrokes. Use the handy <span style="font-family: Courier New, Courier, monospace;">git config </span><span style="font-family: inherit;">command to make those changes for you:</span><br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">git config branch.master.remote origin<br />git config branch.master.merge refs/heads/master</span></blockquote>
This is probably going to happen again, so lets add a git alias:<br />
<blockquote class="tr_bq">
<span style="font-family: Courier New, Courier, monospace;">git config --global alias.fixmaster \<br />
'!git config branch.master.remote origin && \<br />
git config branch.master.merge refs/heads/master'</span></blockquote>
Now if you get this error again, just type <span style="font-family: Courier New, Courier, monospace;">git fixmaster</span><span style="font-family: inherit;">.</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-15731332978920261782012-04-06T22:53:00.001-05:002012-04-06T22:56:32.742-05:00Pest Control in AustinI just finished deploying my father-in-law's pest control business site. If you have a bug problem in the Austin area, please consider <a href="http://www.bcpest.com/" target="_blank">BC Pest Control</a>. Bruce has decades of experience and has kept my home and lawn bug-free for several years now (especially the spiders and fleas!).<br />
<br />
For you developers out there, Heroku and Sintra are a great match for small commercial web sites.Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-15759571.post-5693847850502617762011-01-18T15:18:00.002-06:002011-01-18T15:27:52.947-06:00Netbeans Won't Debug Rails ProjectIf the Netbeans says it "can't contact the web server" when running "Debug Project" there is likely an issue with the debug gems that the IDE installs itself. To correct this problem:<br /><ol><li>Exit Netbeans</li><li>$ gem uninstall linecache</li><li>$ gem uninstall ruby-debug-base</li><li>$ gem uninstall ruby-debug-ide</li><li>$ gem install ruby-debug-ide</li><li>Start Netbeans, and "Debug Project"</li></ol><br />Please note that I am using MRI (native Ruby), not JRuby.<br /><ul><li>Netbeans 6.9.1 (Linux)<br /></li><li>ruby 1.8.7 (2010-12-23 patchlevel 330) [x86_64-linux]</li><li>RubyGems 1.4.1<br /></li><li>linecache (0.43)</li><li>ruby-debug-base (0.10.4)</li><li>ruby-debug-ide (0.4.16)</li></ul>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-85657681977925680522010-12-11T13:27:00.004-06:002010-12-11T13:47:47.668-06:00Per Host SSH Key Configuration<div>You can automatically specify an SSH private key, via local configuration, when connecting to SSH hosts. This is especially helpful when using Git to connect to multiple repositories which require different SSH keys.</div><div><br /></div>On a Unix client (or compatible shell such as cygwin, Xming, or msysgit ), create/modify ~/.ssh/config<br /><blockquote><span class="Apple-style-span">Host HOSTNAME_OR_IP<br />IdentityFile ~/.ssh/OTHER_ID_RSA</span></blockquote>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-49947849946643080312010-06-16T08:13:00.002-05:002010-06-16T08:16:08.202-05:00How to Enable Aero on Windows 7 N<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhASZqTL7ApXgil85RF8cB1i4JygCysGaTYNwhtzXX9MpnsWdFHmEhjuJ7llqymi7uQygFZNnoDBmY2PYV_-XLiD7JBUmGngxiOWeXnCx4BZiRW_ajPW_ZsheoRAfWlm7Qy0jZjgA/s1600/screen.png"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 219px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhASZqTL7ApXgil85RF8cB1i4JygCysGaTYNwhtzXX9MpnsWdFHmEhjuJ7llqymi7uQygFZNnoDBmY2PYV_-XLiD7JBUmGngxiOWeXnCx4BZiRW_ajPW_ZsheoRAfWlm7Qy0jZjgA/s320/screen.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5483359380915335090" /></a><br />To enable the Aero UI enhancements in Windows 7, you must "rate" your computer using the Performance Information and Tools panel. If you receive the error: "<span style="font-style:italic;">This system does not have the necessary multi-media support to run the requested assessment</span>", you may not have Windows Media Player installed (especially if you are running Windows 7 N). Download and install Windows Media Player at <a href="http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx">http://www.microsoft.com/windows/windowsmedia/download/AllDownloads.aspx</a> and try again.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-15759571.post-70877097537938814782010-03-02T12:04:00.002-06:002010-03-02T12:09:40.793-06:00Convert a Hash to a Query String or Parameter StringI Rails, to convert a Hash object into a query string or parameter string for use in a url:<br /><br />opts = {:a => 1, :b => 2}<br />params = ActionController::Routing::Route.new.build_query_string(opts)<br /><br />Params => "?a=1&b=2"Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-15759571.post-73025984607825250772010-02-05T10:23:00.002-06:002010-02-05T10:28:08.929-06:00Ruby Multithreading with a Thread Size LimitI wrote this class in the process of writing a multithreaded Amazon S3 key migrator. S3 doesn't like that, so don't even bother.<br /><br />You will want to use this with a thread-safe process block.<br /><br /><script src="http://gist.github.com/295920.js?file=threaded_processor.rb"></script>Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-15759571.post-48818233275741490142010-01-19T15:14:00.002-06:002010-01-19T15:16:21.235-06:00My .irbrc Ruby irb and Rails console configurationHere is my customized configuration file for Ruby irb and Rails console. You will need to install the wirble and hirb gems for full functionality.<br /><br /><script src="http://gist.github.com/251853.js?file=.irbrc"></script>Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-15759571.post-48753707075772702132010-01-18T18:01:00.001-06:002010-01-18T18:02:41.445-06:00Compile FFMPEG from Source with x264 SupportHere are my notes for compiling FFMPEG from source with x264 and Xvid/DivX support on Ubuntu 9.10 Karmic Koala.<br /><br />Your milage may vary!!!<br /><br /><script src="http://gist.github.com/280512.js"></script>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-88809076929362739472009-10-30T14:51:00.002-05:002009-10-30T14:52:52.012-05:00Change Default JVM on OSXIf you install the Java 1.6 JRE on OSX Leopard 10.5 and want to make it default:<br /><br /><blockquote>open /Applications/Utilities/Java\ Preferences.app</blockquote>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-21830559790251959582009-10-24T20:34:00.003-05:002009-10-24T20:38:05.991-05:00Giving Up on Windows 7For some wonderful reason, Windows 7 takes eight minutes to boot on my desktop machine. This is an Intel Core2Quad with 4GB of RAM. Not a speed demon, but no slouch. I have been in *Nix land too long and can't figure out what hardware is stalling the boot process. Horrifically frustrating.<br /><br />I am not used to not being able to figure things out, but I have reached the point of not caring anymore. Windows is just a game platform for me and I get real work done in Linux or OSX.<br /><br />Windows XP will play Left4Dead just fine.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-21611990217720911992009-09-22T20:21:00.002-05:002009-09-22T20:25:48.230-05:00Set Default Terminal Size in GnomeThis was difficult to find. You CAN set the default size of Gnome Terminal. The following instructions apply to Ubuntu 9.04, so your milage may vary:<br /><br />Open /usr/share/vte/termcap/xterm:<br /><tt> sudo gedit /usr/share/vte/termcap/xterm</tt><br />Find the line containing <span style="font-family:courier new;">:co#80:it#8:li#24:</span>\ (line 10 in Ubunto 9.04)<br />Replace the 80 with desired column width, and 24 with the desired row height.<br />Save and close all terminals.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-16662015101121825032009-08-30T08:39:00.002-05:002009-08-30T08:43:54.045-05:00Lone Star Ruby Conference 2009I must say that the conference this year was amazing. This is the first time I have been to a Ruby conference. Though I could have easily learned any of the subjects presented myself, the insight and enthusiasm from the speakers gave me better ideas for implementation and more excitement to actually do something.<br /><br />I have been inspired and now I want to give a talk next year.<br /><br />I am still stoked from the experience.Unknownnoreply@blogger.com1tag:blogger.com,1999:blog-15759571.post-11718369901235509242009-08-16T13:59:00.002-05:002009-08-16T14:01:15.361-05:00De-Interlace Video in AcidRipTo enable deinterlacing of video when converting DVD video with AcidRip, add the following to the "Post Filters" field under the "Video" tab: "pp=lb"Unknownnoreply@blogger.com2tag:blogger.com,1999:blog-15759571.post-58810951528567380352009-08-01T21:59:00.002-05:002009-08-01T22:05:42.502-05:00Apple Exploits<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzhr8XfM4KCoiDKtFCSPipiX-9Ize65TJqVe1NfRM4ZMKb8hudh0tNlmmEVtwmOGCQptd9g9mCSSkEtoKGDqMWzPedcZ0yeYc6YBFGq2EsdQ6jlzipmwdQk2-JHeT_cdoPVGQpFg/s1600-h/Apple_keyboard_working.JPG"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 264px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzhr8XfM4KCoiDKtFCSPipiX-9Ize65TJqVe1NfRM4ZMKb8hudh0tNlmmEVtwmOGCQptd9g9mCSSkEtoKGDqMWzPedcZ0yeYc6YBFGq2EsdQ6jlzipmwdQk2-JHeT_cdoPVGQpFg/s320/Apple_keyboard_working.JPG" border="0" alt=""id="BLOGGER_PHOTO_ID_5365197147714146418" /></a><br /><br /><br />Hackers are having a seeming field day with Apple products. Between the <a href="http://www.semiaccurate.com/2009/07/31/apple-keyboard-firmware-hack-demonstrated/">Apple Keyboard Firmware hack</a>, the <a href="http://cyberinsecure.com/remote-code-execution-through-intel-cpu-vulnerability-will-be-presented-in-hack-in-the-box-security-conference/">Intel processor firmware hack</a> (this one is OS agnostic), and the <a href="http://www.theiphoneblog.com/2009/07/30/charlie-miller-demonstrate-iphone-sms-hack-black-hat-conference-today/">iPhone SMS hack</a> it's a bad day to be an Apple fanboy or user.<br /><br /><br /><br />I'll stick to doing my online banking on my Linux machine.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-5816263814005842402009-07-19T12:38:00.006-05:002009-07-19T12:57:36.913-05:00Must Read Book for Web Developers<p style="margin: 0pt 20px; float: left;"><a href="http://www.amazon.com/gp/product/0596529325?ie=UTF8&tag=fbqui-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0596529325"><img src="https://images-na.ssl-images-amazon.com/images/I/51QfNgF8QBL._SL160_.jpg" /></a></p>Today I got my copy of <a href="http://www.amazon.com/gp/product/0596529325?ie=UTF8&tag=fbqui-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0596529325">Programming Collective Intelligence</a> and I wish I had bought this book back when it came out. In my day job, I am developing mostly social networking type sites, and I could have saved days of hair pulling.<br /><p>Some days it seems as if I am just writing the same old "dumb" web-sites, and I never really understood how other programmers integrated the massive amounts of data we collect every day into a usable and actionable form, both for user and stake-holder. I figured it involved complicated maths that I either don't remember or never took (dotcom college dropout here). Tobey Segaran puts data mining concepts into readable English and sample code.<br /><br />I never post book reviews, but I am only 3 chapters in, and I love it.</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-92000250614625321592009-06-22T13:13:00.004-05:002009-06-28T07:36:36.494-05:00Adium won't connect to Yahoo Messenger<p>Do you have Yahoo Messenger connection problems with Adium or Pidgin. The Adium 1.4 beta fixes the issue. <a href="http://beta.adium.im">beta.adium.im</a></p><p>More <a href="http://adium.im/blog/2009/06/yahoo-change/">here</a>.</p><p></p><p></p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-34500750850237925312009-06-10T10:53:00.001-05:002009-06-10T10:57:08.982-05:00View Contents of SSL CSR<span style="font-family: courier new;">openssl req -text -noout -in host.csr</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-5201192338395108912009-05-25T11:03:00.000-05:002009-05-25T11:04:17.368-05:00Pushing to a Gitosis Git Repo for the first time<pre style="font-family: courier new;"><span style="font-size:85%;"><code>git push origin master:refs/heads/master</code></span></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-61042200985373149832009-05-09T16:24:00.003-05:002009-05-09T16:32:57.277-05:00Errors when Running GWT from EclipseI was able to get a preview release of the Google AppEngine SDK for Java last week, and finally had an opportunity to play with it. I installed Eclipse on my 64bit Ubuntu Linux box and all the plugins as suggested by Google's Java docs. Everything worked great until I tried to debug the default app as generated by the Eclipse Plugin.<br />I got an error in the GWT (Google Web Toolkit) packages saying (among other things)<br /><br /><span style="font-size:85%;"><span style="font-family: courier new;">libswt-pi-gtk-3235.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)</span></span><br /><br />With a little digging, I found that this was related to 32bit compiled java libraries being run under the 64bit Java runtime. The solution is to install the 32bit Java runtime binary, and instruct Eclipse to use it.<br /><br /><span style="font-size:85%;"><span style="font-family: courier new;">#From Terminal</span><br /><span style="font-family: courier new;">sudo apt-get install sun-java-6-bin ia32-sun-java6-bin</span><br /><span style="font-family: courier new;">sudo apt-get remove gij</span><br /><span style="font-family: courier new;">sudo update-alternatives --config java</span><br /><span style="font-family: courier new;"># Select the 32bit runtime</span></span><br /><br />From Eclipse go to Window -> Preferences -> Java -> Installed JRE's -> Add -> Standard VM and use the path <span style="font-size:85%;"><span style="font-family: courier new;">/usr/lib/jvm/ia32-java-6-sun-1.6.0.13</span></span><br /><br />Now you can Run -> Debug As -> Web ApplicationUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-13656000786911429072009-04-21T11:55:00.002-05:002009-04-21T12:00:12.779-05:00Rails and form_for() within PartialsThis one tripped me up for almost 2 hours.<br /><br />When using form_for() within a partial, use the variable reference instead of a symbol when specifying the form object. i.e. Use form_for(@user){|user_form|}, instead of form_for(:user){|user_form|}<br /><br />I was creating a multi-model form with nested attributes using the new Rails 2.3 fields_for semantics, and the nested model field id's didn't have the numbered "*_attributes_0" suffix string. Ruling out syntax errors, I inspected the nested form objects and found that my user_form.object was nil, and thus the form_for method was not assigning the form object. When led me to find that my use of form_for(:user) was broken. form_for(@user) worked perfectly.<br /><br />My conclusion may be incorrect, but it appears that using a symbolic reference as an object attribute for form_for() within a partial is broken.<br /><br />The moral of the story is, just use the variable reference.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-70112088741554820572009-03-28T16:12:00.002-05:002009-03-28T16:14:44.838-05:00Capistrano deploy.rb for Git and Phusion PassengerHere is my Capsitrano <a href="http://gist.github.com/87207">deploy.rb</a> script/recipe for use with Git repos on servers powered by Phusion Passenger (mod_rails). <br /><br /><a href="http://gist.github.com/87207">http://gist.github.com/87207</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-15759571.post-85724243290376088652009-01-09T14:36:00.005-06:002009-01-09T14:41:27.180-06:00Telnet SMTP Escape CharacterWhen connecting to an SMTP server via telnet (i.e. <span style="font-family: courier new;">telnet mail.example.com 25</span>), you will be informed that "<span style="font-family: courier new;">Escape character is '^]'.</span>" This means you need to press <span style="font-family: courier new;">CTRL-]</span> (control plus right-bracket)<br /><br />I am embarrassed how long it took me to realize that.Unknownnoreply@blogger.com3tag:blogger.com,1999:blog-15759571.post-32095401178053884162009-01-04T22:00:00.003-06:002009-01-05T09:10:29.144-06:00MySpace Mobsters Calculator and Strategy HelperI wrote a <a href="http://my-mobsters-helper.appspot.com/">Mobsters helper</a> this weekend to help in choosing the best weapons configuration. Enjoy!<br /><br />I am liking Google AppEngine so far, and this weekend project has really put me onboard with jQuery.Unknownnoreply@blogger.com0