<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

<title>ph-lee</title>
<link href="http://www.ph-lee.com/atom.xml" rel="self"/>
<link href="http://www.ph-lee.com/"/>
<updated>2012-02-05T12:39:33+00:00</updated>
<id>http://www.ph-lee.com/</id>
<author>
<name>asmega</name>
<email>me@ph-lee.com</email>
</author>


<entry>
<title>Tidy git branches</title>
<link href="http://www.ph-lee.com/2012/02/05/tidy-git-branches.html"/>
<updated>2012-02-05T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2012/02/05/tidy-git-branches</id>
<content type="html">&lt;p&gt;Branching in git is an ease to work with and literally takes seconds. You can be working on your own feature, switch to a colleague&amp;#8217;s feature then switch to production code to check a bug all within a few keystrokes and in no time at all.&lt;/p&gt;
&lt;p&gt;Branching is easy and a convenience. However this often leads to many branches and over time that leads branch hell. We want to be able to clean up all those merged in branches that we were too lazy to delete 3 months ago. Here&amp;#8217;s the code to do the purge.&lt;/p&gt;
&lt;script src='https://gist.github.com/1620379.js?file=index'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;html&amp;amp;gt;&amp;amp;lt;body&amp;amp;gt;You are being &amp;amp;lt;a href=&amp;amp;quot;https://raw.github.com/gist/1620379/index&amp;amp;quot;&amp;amp;gt;redirected&amp;amp;lt;/a&amp;amp;gt;.&amp;amp;lt;/body&amp;amp;gt;&amp;amp;lt;/html&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;p&gt;If you&amp;#8217;re working with github or you&amp;#8217;re storing your code in a &amp;#8216;central&amp;#8217; repository you&amp;#8217;ll likely be experiencing the same thing on the remote server as well. Here&amp;#8217;s the modified version to purge remote branches.&lt;/p&gt;
&lt;script src='https://gist.github.com/1620431.js?file=index'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;html&amp;amp;gt;&amp;amp;lt;body&amp;amp;gt;You are being &amp;amp;lt;a href=&amp;amp;quot;https://raw.github.com/gist/1620431/index&amp;amp;quot;&amp;amp;gt;redirected&amp;amp;lt;/a&amp;amp;gt;.&amp;amp;lt;/body&amp;amp;gt;&amp;amp;lt;/html&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;
&lt;p&gt;With these little scripts you can keep periodically prune your branches every so often and not need to this every time and also prevent your repository from over growing.&lt;/p&gt;</content>
</entry>

<entry>
<title>Rails mass assignment checker</title>
<link href="http://www.ph-lee.com/2011/10/23/rails-mass-assignment-checker.html"/>
<updated>2011-10-23T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2011/10/23/rails-mass-assignment-checker</id>
<content type="html">&lt;p&gt;A quick way to list all you rails models and find out column names an which have been white and blacklisted against mass assignment.&lt;/p&gt;
&lt;script src='https://gist.github.com/1307343.js?file=main'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;html&amp;amp;gt;&amp;amp;lt;body&amp;amp;gt;You are being &amp;amp;lt;a href=&amp;amp;quot;https://raw.github.com/gist/1307343/main&amp;amp;quot;&amp;amp;gt;redirected&amp;amp;lt;/a&amp;amp;gt;.&amp;amp;lt;/body&amp;amp;gt;&amp;amp;lt;/html&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;</content>
</entry>

<entry>
<title>sed find and replace</title>
<link href="http://www.ph-lee.com/2011/07/31/sed-find-and-replace.html"/>
<updated>2011-07-31T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2011/07/31/sed-find-and-replace</id>
<content type="html">&lt;p&gt;Currently in the middle of a &lt;a href=&quot;http://rubyonrails.org/&quot;&gt;rails 3&lt;/a&gt; upgrade. Here&amp;#8217;s a quick one line fix with &lt;a href=&quot;http://en.wikipedia.org/wiki/Sed&quot;&gt;sed&lt;/a&gt; to replace all named_scope to scope due to &lt;a href=&quot;http://api.rubyonrails.org/classes/ActiveRecord/NamedScope/ClassMethods.html&quot;&gt;deprecation&lt;/a&gt;&lt;/p&gt;
&lt;script src='https://gist.github.com/1116740.js?file=sed'&gt;&lt;/script&gt;&lt;noscript&gt;&lt;pre&gt;&lt;code&gt;&amp;amp;lt;html&amp;amp;gt;&amp;amp;lt;body&amp;amp;gt;You are being &amp;amp;lt;a href=&amp;amp;quot;https://raw.github.com/gist/1116740/sed&amp;amp;quot;&amp;amp;gt;redirected&amp;amp;lt;/a&amp;amp;gt;.&amp;amp;lt;/body&amp;amp;gt;&amp;amp;lt;/html&amp;amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/noscript&gt;</content>
</entry>

<entry>
<title>nginx rewrite rules for html extensions</title>
<link href="http://www.ph-lee.com/2011/07/05/nginx-rewrite-rules-for-html-extensions.html"/>
<updated>2011-07-05T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2011/07/05/nginx-rewrite-rules-for-html-extensions</id>
<content type="html">&lt;p&gt;I Just swtiched to &lt;a href=&quot;http://jekyllrb.com&quot;&gt;jekyll&lt;/a&gt; running in &lt;a href=&quot;http://nginx.net&quot;&gt;nginx&lt;/a&gt;. It&amp;#8217;s simple and lightning fast.&lt;/p&gt;
&lt;p&gt;jekyll makes all output files .html however I wanted these files to be available to people without the explicit need to have .html in the url.&lt;/p&gt;
&lt;p&gt;I found the following &lt;a href=&quot;http://snippets.aktagon.com/snippets/411-How-to-remove-html-from-URLs-with-nginx-rewrites&quot;&gt;rewrite rule&lt;/a&gt; to solve exactly that.&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;nginx&quot;&gt;&lt;span class=&quot;k&quot;&gt;location&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# break if URI has .html extension&lt;/span&gt;
  &lt;span class=&quot;kn&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$request_filename&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;sr&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;^.+.html&lt;/span&gt;$&lt;span class=&quot;s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;# add .html to URI and serve file, directory, or symlink if it exists&lt;/span&gt;
  &lt;span class=&quot;kn&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;(-e&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$request_filename.html&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;rewrite&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;^/(.*)&lt;/span&gt;$ &lt;span class=&quot;s&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$1.html&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;last&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kn&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</content>
</entry>

<entry>
<title>Where I've been according to my iPhone</title>
<link href="http://www.ph-lee.com/2011/05/08/where-ive-been-according-to-my-iphone.html"/>
<updated>2011-05-08T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2011/05/08/where-ive-been-according-to-my-iphone</id>
<content type="html">&lt;p&gt;iPhones have been tracking the location of themselves. Which implies they have been tracking their owners as well. Not really surprising for Apple or any other company wanting world domination. You can find out more in this &lt;a href=&quot;http://www.bbc.co.uk/news/technology-13292313&quot;&gt;&lt;span class=&quot;caps&quot;&gt;BBC&lt;/span&gt; News article&lt;/a&gt;. So this is where I&amp;#8217;ve been according to my iphone&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/iphone_geo.png&quot; title=&quot;heatmap of places I&amp;#39;ve been&quot; alt=&quot;heatmap of places I&amp;#39;ve been&quot; /&gt;&lt;/p&gt;
&lt;p&gt;So it looks like I don&amp;#8217;t venture out much. Although seeing the data is cool the whole ethics behind it is a totally different topic of conversation.&lt;/p&gt;
&lt;p&gt;Thanks to &lt;a href=&quot;http://petewarden.typepad.com&quot;&gt;Pete Warden&lt;/a&gt; for writing &lt;a href=&quot;http://petewarden.github.com/iPhoneTracker&quot;&gt;iPhoneTracker&lt;/a&gt; which created the above location heat map.&lt;/p&gt;</content>
</entry>

<entry>
<title>Restarting nginx</title>
<link href="http://www.ph-lee.com/2011/05/07/restarting-nginx.html"/>
<updated>2011-05-07T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2011/05/07/restarting-nginx</id>
<content type="html">&lt;p&gt;A quick how to on restarting nginx when init scripts or start scripts aren&amp;#8217;t available. These aren&amp;#8217;t added by default as far as I know.&lt;/p&gt;
&lt;p&gt;This is done by sending the correct signal to nginx. The pid of nginx can be found at /opt/nginx/logs/nginx.pid. Although this may vary depending on where nginx is installed and how it was configured. Let&amp;#8217;s now say the pid was 12345 execute the following command…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo kill -s HUP 12345&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Where &lt;span class=&quot;caps&quot;&gt;HUP&lt;/span&gt; is the hangup signal. You can see the &lt;a href=&quot;http://wiki.nginx.org/CommandLine&quot;&gt;nginx wiki&lt;/a&gt; for signals that can be sent to nginx.&lt;/p&gt;
&lt;p&gt;The wiki states the &lt;span class=&quot;caps&quot;&gt;HUP&lt;/span&gt; signal 1. Reloads config; 2. Start the new worker processes with a new configuration; 3. Gracefully shutdown the old worker processes.&lt;/p&gt;</content>
</entry>

<entry>
<title>Generate missing rspec spec_helper</title>
<link href="http://www.ph-lee.com/2011/04/21/generate-missing-rspec-spec_helper.html"/>
<updated>2011-04-21T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2011/04/21/generate-missing-rspec-spec_helper</id>
<content type="html">&lt;p&gt;You plugged rspec in after you created your rails app. As a result you&amp;#8217;ll be missing some files that rspec should of generated. One of which is spec_helper and some autotest files. Simply run…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rails g rspec:install&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Done.&lt;/p&gt;</content>
</entry>

<entry>
<title>Git forest and the lumberjack</title>
<link href="http://www.ph-lee.com/2010/11/07/git-forest-and-the-lumberjack.html"/>
<updated>2010-11-07T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2010/11/07/git-forest-and-the-lumberjack</id>
<content type="html">&lt;p&gt;Git is great when it comes to branches. It&amp;#8217;s quick and easy. However over time you&amp;#8217;ll find yourself with a rather long list when it comes to running the `git branch` command since you were too lazy too clean up after yourself. Not to worry we&amp;#8217;ll do a clean up and transform many branches to a few.&lt;/p&gt;
&lt;p&gt;This is easy if you created all the branches and know exactly what each one contains and whether it&amp;#8217;s been merged in or not. However this is not the case when rather old ‘dead&amp;#8217; branches, created by someone else with no relating ticket are present.&lt;/p&gt;
&lt;p&gt;`gitk` to the rescue. However you find that under normal circumstances it&amp;#8217;ll only display branches that are also on your current ancestral line of your checked out branch. You need to add the `–all` flag. So `gitk –all` which shows all branches. The same flag also exists if you&amp;#8217;re using gitx for the mac.&lt;/p&gt;
&lt;p&gt;This way you can visualize how old a branch is and do diffs to see if there&amp;#8217;s any code you need. Then axe away any unneeded branches.&lt;/p&gt;</content>
</entry>

<entry>
<title>rm: /PATH_TO_FILE not removed: Disc quota exceeded</title>
<link href="http://www.ph-lee.com/2010/05/29/rm-path_to_file-not-removed-disc-quota-exceeded.html"/>
<updated>2010-05-29T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2010/05/29/rm-path_to_file-not-removed-disc-quota-exceeded</id>
<content type="html">&lt;p&gt;This occurred whilst using Solaris on Joyent. Somewhat annoying when one can&amp;#8217;t remove a file when “Disc quota exceeded”!&lt;/p&gt;
&lt;p&gt;What one can do is override the file contents with nothingness.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;cat /dev/null &amp;gt;/PATH_TO_FILE&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Source: &lt;a href=&quot;http://forum.joyent.com/viewtopic.php?id=26181&quot;&gt;Joyent forums&lt;/a&gt;&lt;/p&gt;</content>
</entry>

<entry>
<title>The real British Mac keyboard</title>
<link href="http://www.ph-lee.com/2010/03/27/the-real-british-mac-keyboard.html"/>
<updated>2010-03-27T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2010/03/27/the-real-british-mac-keyboard</id>
<content type="html">&lt;p&gt;You bought a mac in the UK only to find the keyboard layout isn&amp;#8217;t fully British or fully American. See &lt;a href=&quot;http://en.wikipedia.org/wiki/British_and_American_keyboards&quot;&gt;Wikipedia&lt;/a&gt;. There&amp;#8217;s a pound symbol but the at, hash and quotation marks don&amp;#8217;t seem quite right.&lt;/p&gt;
&lt;p&gt;You&amp;#8217;ll want to go to &lt;a href=&quot;http://liyang.hu/osx-british.xhtml&quot;&gt;http://liyang.hu/osx-british.xhtml&lt;/a&gt; for a fix for snow leopard.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re thinking that it&amp;#8217;s the “mac way” and you should accept it and live with I have to totally disagree. Any system should should be configurable to meet the user&amp;#8217;s needs and imposing only one method of doing something is counter productive. It feels good to type this article on a keyboard knowing what each key should output rather than rewiring my brain.&lt;/p&gt;</content>
</entry>

<entry>
<title>ruby strftime parameters</title>
<link href="http://www.ph-lee.com/2010/02/05/ruby-strftime-parameters.html"/>
<updated>2010-02-05T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2010/02/05/ruby-strftime-parameters</id>
<content type="html">&lt;p&gt;ruby strftime parameters are not mentioned in the ruby api but are instead specified in the time.c source. The docs can be found in the date man docs.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;man date&lt;/code&gt;&lt;/p&gt;</content>
</entry>

<entry>
<title>ubuntu shutdown and wakeup timer</title>
<link href="http://www.ph-lee.com/2010/01/03/ubuntu-shutdown-and-wakeup-timer.html"/>
<updated>2010-01-03T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2010/01/03/ubuntu-shutdown-and-wakeup-timer</id>
<content type="html">&lt;h2&gt;Going green&lt;/h2&gt;
&lt;p&gt;My all-in-one kubuntu media centre and general server sits unused most of the time. So why not set it to switch on and off in sync with when I need it based on the time of day. Should save on some bills.&lt;/p&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span class=&quot;caps&quot;&gt;ACPI&lt;/span&gt;&lt;/li&gt;
	&lt;li&gt;Linux&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Method&lt;/h2&gt;
&lt;p&gt;Setup a cron job as root to shutdown at the specified time. To edit crons as root enter the following.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo crontab -u root -e&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Add the following line to the list. This will shut down the box everyday at 0400. Of course you can modify as needed to suit your needs. And if you want to hibernate I&amp;#8217;m sure theres a hibernate command.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;0 4 * * * /sbin/shutdown -h now&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;While we&amp;#8217;re at it we&amp;#8217;ll also set up the wakeup time using rtcwake. So also add the following to the cron list.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;45 3 * * * /usr/sbin/rtcwake -m no -s 29700&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;15 minutes before the shutdown we set the box to wake up in 29700 seconds which equates to 8 hours and 15 minutes. So the machine is scheduled to wake up at 12 noon.&lt;/p&gt;
&lt;h2&gt;Setup&lt;/h2&gt;
&lt;p&gt;This solution might be setup dependent so here are some specs that may help…&lt;/p&gt;
&lt;p&gt;Linux kubuntu 9.10 Karmic Koala&lt;br /&gt;
2.6.31-16-generic #53-Ubuntu &lt;span class=&quot;caps&quot;&gt;SMP&lt;/span&gt; Tue Dec 8 04:01:29 &lt;span class=&quot;caps&quot;&gt;UTC&lt;/span&gt; 2009 i686 &lt;span class=&quot;caps&quot;&gt;GNU&lt;/span&gt;/Linux&lt;br /&gt;
Motherboard: &lt;span class=&quot;caps&quot;&gt;ASUS&lt;/span&gt; A7V-133 &lt;span class=&quot;caps&quot;&gt;ACPI&lt;/span&gt; &lt;span class=&quot;caps&quot;&gt;BIOS&lt;/span&gt; Revision 1007 (10/03/2001)&lt;br /&gt;
Making media centres&amp;#8217; greener.&lt;/p&gt;</content>
</entry>

<entry>
<title>MythTV blue screen on playback</title>
<link href="http://www.ph-lee.com/2009/12/28/mythtv-blue-screen-on-playback.html"/>
<updated>2009-12-28T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/12/28/mythtv-blue-screen-on-playback</id>
<content type="html">&lt;p&gt;Problem: Getting a blue screen on video and live TV playback with MythTV.&lt;/p&gt;
&lt;p&gt;Solution from &lt;a href=&quot;http://ubuntuforums.org/showthread.php?t=606624&quot;&gt;ubuntu forums&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;xvattr -a XV_CRTC -v 1&lt;/code&gt;&lt;/p&gt;</content>
</entry>

<entry>
<title>S-Video TV out on kubuntu</title>
<link href="http://www.ph-lee.com/2009/12/22/s-video-tv-out-on-kubuntu.html"/>
<updated>2009-12-22T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/12/22/s-video-tv-out-on-kubuntu</id>
<content type="html">&lt;p&gt;The problem: ubuntu media centre that hooks up to an old TV which takes S-video. Graphics card or ubuntu isn&amp;#8217;t capable of automatically detecting the TV.&lt;/p&gt;
&lt;p&gt;The solution: &lt;a href=&quot;http://mfbernardes.com/drupal/content/finally-i-got-tv-out-s-video-working-my-thinkpad-t42&quot;&gt;Bernades&lt;/a&gt; has an article on how to get ubuntu to detect the tv and output it using &lt;a href=&quot;http://www.x.org/wiki/Projects/XRandR&quot;&gt;XRandR&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;xrandr --output S-video --set load_detection 1&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;xrandr --output S-video --auto&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The problem is that this isn&amp;#8217;t persistent and as soon as you reboot you&amp;#8217;ll be back to square one.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://wiki.ubuntu.com/X/Config/Resolution#Setting%20xrandr%20changes%20persistently&quot;&gt;Ubuntu wiki&lt;/a&gt; shows a script can be setup to run the above lines of code on startup. So in my case of using kde add the above lines of code to the following file.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/etc/kde4/kdm/Xsetup&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Give your a box a reboot and your linux media centre should be configured to use your TV.&lt;/p&gt;</content>
</entry>

<entry>
<title>Ubuntu Path Environment variable</title>
<link href="http://www.ph-lee.com/2009/11/22/ubuntu-path-environment-variable.html"/>
<updated>2009-11-22T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/11/22/ubuntu-path-environment-variable</id>
<content type="html">&lt;p&gt;To get at it&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo vim /etc/environment&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;To reload any changes you made&lt;/p&gt;
&lt;p&gt;&lt;code&gt;source /etc/environment&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s it folks.&lt;/p&gt;</content>
</entry>

<entry>
<title>Installing Flash on Firefox in Linux (ubuntu)</title>
<link href="http://www.ph-lee.com/2009/11/15/installing-flash-on-firefox-in-linux-ubuntu.html"/>
<updated>2009-11-15T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/11/15/installing-flash-on-firefox-in-linux-ubuntu</id>
<content type="html">&lt;p&gt;Easiest way to install flash on Firefox on ubuntu is explained at this faq at &lt;a href=&quot;http://plugindoc.mozdev.org/faqs/flash.html#install-linux&quot;&gt;mozdev.org&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re wondering where your plugins directory is located there seem to be several. This &lt;a href=&quot;https://answers.launchpad.net/ubuntu/+question/6988&quot;&gt;article at lauchpad.net&lt;/a&gt; may give you the answer you need.&lt;/p&gt;
&lt;p&gt;On top of that if you type in about:plugins in the address bar of firefox you can see information regarding plugins already installed, including flash.&lt;/p&gt;</content>
</entry>

<entry>
<title>Installing mysql on Mac Snow Leopard</title>
<link href="http://www.ph-lee.com/2009/09/18/installing-mysql-on-mac-snow-leopard.html"/>
<updated>2009-09-18T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2009/09/18/installing-mysql-on-mac-snow-leopard</id>
<content type="html">&lt;p&gt;This articles is regarding Mac OS X 10.6 with mysql 5.1.37.&lt;/p&gt;
&lt;p&gt;I followed this article at hivelogic.com which required compiling mysql from source. It mostly worked with a few hitches which I&amp;#8217;d like to share.&lt;/p&gt;
&lt;p&gt;After following the article and attempting to run my rails app the first problem I hit was…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;uninitialized constant MysqlCompat::MysqlRes&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;this problem seemed to be that you need to specify the atchitecture as 64-bit when installing the mysql gem. So run the below command intead when install the mysql gem…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;sudo env ARCHFLAGS=&quot;-arch x86_64&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Or if you already installed the gem just re-install with this command. The next problem was the following…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;d move a project from ubuntu onto the mac I couldn&amp;#8217;t find the mysql socket to use as it was specifying the wrong location. On the mac the file can be found at&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/tmp/mysql.sock&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So you&amp;#8217;ll need to modify your database.yml file accordingly to point to this location&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;</content>
</entry>

<entry>
<title>Connecting to SourceTV with password</title>
<link href="http://www.ph-lee.com/2009/07/07/connecting-to-sourcetv-with-password.html"/>
<updated>2009-07-07T00:00:00+01:00</updated>
<id>http://www.ph-lee.com/2009/07/07/connecting-to-sourcetv-with-password</id>
<content type="html">&lt;p&gt;In order to connect to SourceTV with a password set the following syntax is used in console&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;connect SERVER_IP; password PASSWORD_HERE&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;For example&amp;#8230;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;connect 192.168.0.1:27016; password mypassword&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;</content>
</entry>

<entry>
<title>How-to : Rip Team Fortress 2 OST tracks</title>
<link href="http://www.ph-lee.com/2009/03/14/how-to-rip-team-fortress-2-ost-tracks.html"/>
<updated>2009-03-14T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/03/14/how-to-rip-team-fortress-2-ost-tracks</id>
<content type="html">&lt;p&gt;When you start TF2 you will here one of the game &lt;span class=&quot;caps&quot;&gt;OST&lt;/span&gt; tracks by Valve Studio Orchestra. Currently there are five tracks…&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Team Fortress 2&lt;/li&gt;
	&lt;li&gt;Rocket Jump Waltz&lt;/li&gt;
	&lt;li&gt;Playing with Danger&lt;/li&gt;
	&lt;li&gt;The Art of War&lt;/li&gt;
	&lt;li&gt;Faster Than a Speeding Bullet&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can get three of them from.. rootSteamsteamappsSTEAM NAMEteam fortress 2tfsounduiThey are titled gamestartup1.mp3, gamestartup2.mp3 and gamestartup3.mp3.&lt;/p&gt;
&lt;p&gt;Two of the tracks are located in the Game Cache files (.gcf). Found here..rootSteamsteamappsteam fortress 2 content.gcf&lt;/p&gt;
&lt;p&gt;To open this file you&amp;#8217;ll need a .gcf reader. One reader is GCFScape. So download and install that and open the above .gcf file. Then navigate to.. roottfsounduiHere you will find the other two tracks; gamestartup4.mp3 and gamestartup5.mp3.&lt;/p&gt;
&lt;p&gt;Since you own the game I don&amp;#8217;t see how ripping it is a problem as you&amp;#8217;ve paid for the content.&lt;/p&gt;
&lt;p&gt;&lt;span class=&quot;caps&quot;&gt;UPDATE&lt;/span&gt;: Since the release of the spy and sniper update two further tracks are now available, these are:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Petite Chou-Fleur&lt;/li&gt;
	&lt;li&gt;Right Behind You&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These are also located in the &lt;span class=&quot;caps&quot;&gt;GCF&lt;/span&gt; file stated above at the same location and titled: gamestartup6.mp3 and gamestartup7.mp3&lt;/p&gt;
&lt;p&gt;Enjoy.&lt;/p&gt;</content>
</entry>

<entry>
<title>How-to: Deploy Ruby on Rails in a subdirectory and not in root</title>
<link href="http://www.ph-lee.com/2009/02/27/deploying-ruby-on-rails-in-a-subdirectory-and-not-in-root.html"/>
<updated>2009-02-27T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/02/27/deploying-ruby-on-rails-in-a-subdirectory-and-not-in-root</id>
<content type="html">&lt;p&gt;Normally one would deploy their rails application in the root directory (top-level) ie where the domain is, for example…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;www.your-domain.com&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;However, you may want to deploy your app in a subdirectory such as…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;www.your-domain.com/your_app&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;You may want to do this if you want to deploy several applications on the same domain or temporarily for testing purposes. So heres what to do. Naviagate to the environment.rb file found here…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;root | configuration | environment.rb&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Open the file in your favourite text editor. Add the relative url configuration to your config as shown below. I added it to the end of the do statement.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Rails::Initializer.run do |config|
config.action_controller.relative_url_root = &quot;/your_app&quot;
end&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This setups the environment for rails to now run with url root of your_app.&lt;/p&gt;
&lt;p&gt;Happy deploying!&lt;/p&gt;</content>
</entry>

<entry>
<title>Fishbone diagrams and Visio 2007</title>
<link href="http://www.ph-lee.com/2009/02/25/fishbone-diagrams-and-visio-2007.html"/>
<updated>2009-02-25T00:00:00+00:00</updated>
<id>http://www.ph-lee.com/2009/02/25/fishbone-diagrams-and-visio-2007</id>
<content type="html">&lt;p&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ishikawa_diagram&quot;&gt;Fishbone diagrams&lt;/a&gt; are used for cause and effect as wikipedia explains. Useful for brainstorming documentation for user troubleshooting.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://office.microsoft.com/en-us/visio/default.aspx&quot;&gt;Microsoft Visio 2007&lt;/a&gt; is a quick and easy way to make such diagrams. Simply go to…&lt;/p&gt;
&lt;p&gt;&lt;code&gt;File | New | Business | Cause and Effect Diagram&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m sure you can figure the rest out.&lt;/p&gt;</content>
</entry>


</feed>

