<?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>CommitBlog</title>
	<atom:link href="http://blog.laaz.org/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.laaz.org/tech</link>
	<description>Programming, technology and IT-survival</description>
	<lastBuildDate>Tue, 15 May 2012 07:23:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Mount partitions like a boss (AppleScript)</title>
		<link>http://blog.laaz.org/tech/2012/05/15/mount-partitions-like-a-boss-applescript/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/05/15/mount-partitions-like-a-boss-applescript/#comments</comments>
		<pubDate>Tue, 15 May 2012 07:23:45 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[diskutil]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[mount partition]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=525</guid>
		<description><![CDATA[How to quickly mount partitions when the need arises? A small AppleScript to help you out. The need No good comes without little drawbacks. When I swapped ODD with HDD, I noticed that it was quite a bit noisier than &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/05/15/mount-partitions-like-a-boss-applescript/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/03/01/textmate-2-new-window-via-applescript/' rel='bookmark' title='TextMate 2 New Window (via AppleScript)'>TextMate 2 New Window (via AppleScript)</a></li>
<li><a href='http://blog.laaz.org/tech/2010/04/13/macfusion-workaround/' rel='bookmark' title='MacFUSION workaround'>MacFUSION workaround</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>How to quickly mount partitions when the need arises? A small AppleScript to help you out.</p>
<h2>The need</h2>
<p>No good comes without little drawbacks. When I <a href="http://blog.laaz.org/tech/2012/04/20/macbook-pro-bidrive-or-diy-optical-bay-hdd-caddy/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">swapped ODD with HDD</a>, I noticed that it was quite a bit noisier than SSD and even compared to similar MBP with HDD in original bay (probably because ODD bay has a slot that lets noise out easily). So, now I tend to eject the secondary disk when I don&#8217;t need it, so my Mac can spin it down. All nice and dandy, but reattaching it when needed was a bit tedious.</p>
<h2>The Script</h2>

<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">set</span> partList <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;Meedia&quot;</span>, <span style="color: #009900;">&quot;BOOTCAMP&quot;</span><span style="color: #000000;">&#125;</span>
<span style="color: #0066ff;">choose <span style="color: #ff0033; font-weight: bold;">from</span> list</span> partList <span style="color: #ff0033; font-weight: bold;">with</span> prompt <span style="color: #009900;">&quot;Choose partitions&quot;</span> <span style="color: #ff0033; font-weight: bold;">with</span> multiple selections allowed
<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">result</span> <span style="color: #ff0033; font-weight: bold;">is</span> <span style="color: #ff0033;">not</span> <span style="color: #ff0033;">equal</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">false</span> <span style="color: #ff0033; font-weight: bold;">then</span>
	<span style="color: #ff0033; font-weight: bold;">repeat</span> <span style="color: #ff0033; font-weight: bold;">with</span> part <span style="color: #ff0033; font-weight: bold;">in</span> <span style="color: #0066ff;">result</span>
		<span style="color: #0066ff;">do shell script</span> <span style="color: #009900;">&quot;diskutil mount &quot;</span> <span style="color: #000000;">&amp;</span> part
		<span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Volume &quot;</span> <span style="color: #000000;">&amp;</span> part <span style="color: #000000;">&amp;</span> <span style="color: #009900;">&quot; mounted&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">repeat</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span></pre></div></div>

<p>This script asks for which of the partitions to mount and then iterates with diskutil through the selection.</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/05/Mount-Partitions-Dialog.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-526" title="Mount Partitions Dialog" src="http://blog.laaz.org/tech/wp-content/uploads/2012/05/Mount-Partitions-Dialog-300x219.png" alt="" width="300" height="219" /></a></p>
<h2>Download</h2>
<p>You can copy-paste the above script to AppleScript Editor and adjust it to your needs, or you can download this as a ready to use application.</p>
<h4><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/05/MountPartitions.zip#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">MountPartitions.zip</a></h4>
<p>&nbsp;</p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/03/01/textmate-2-new-window-via-applescript/' rel='bookmark' title='TextMate 2 New Window (via AppleScript)'>TextMate 2 New Window (via AppleScript)</a></li>
<li><a href='http://blog.laaz.org/tech/2010/04/13/macfusion-workaround/' rel='bookmark' title='MacFUSION workaround'>MacFUSION workaround</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/05/15/mount-partitions-like-a-boss-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Windows 7 on MacBook Pro without SuperDrive</title>
		<link>http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 21:54:10 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Boot Camp]]></category>
		<category><![CDATA[SuperDrive]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=513</guid>
		<description><![CDATA[Right after I swapped my SuperDrive to second internal HDD I was graving to move my 20 GB Boot Camp partition to the other drive and make it bigger, so that I don&#8217;t have to carry another USB disk for my &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/04/02/ruby-on-rails-toolchest-for-windows-users/' rel='bookmark' title='Ruby (on Rails) toolchest for Windows users'>Ruby (on Rails) toolchest for Windows users</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Boot Camp" src="http://images.apple.com/support/assets/images/products/bootcamp/hero_bootcamp.jpg" alt="" width="180" height="180" />Right after I <a href="http://blog.laaz.org/tech/2012/04/20/macbook-pro-bidrive-or-diy-optical-bay-hdd-caddy/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">swapped my SuperDrive to second internal HDD</a> I was graving to move my 20 GB Boot Camp partition to the other drive and make it bigger, so that I don&#8217;t have to carry another USB disk for my games. Rumor has it that <a href="http://twocanoes.com/software.php?software=1" target="_blank">Winclone</a> could have done it in a snap, but I thought how hard can it be and set out to do it myself.</p>
<p>Turns out that there were several different complications that messed things up for me, but in the end, I have a<strong> working Windows 7 installation</strong> on the secondary disk. Read on to find out how I accomplished it.</p>
<p><span id="more-513"></span></p>
<h1>What didn&#8217;t work</h1>
<p>You can skip to Success Story if you are not curious.</p>
<h2>USB-booting installer</h2>
<div id="attachment_519" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/Boot-Camp-Assistant.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-519" title="Boot Camp Assistant" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/Boot-Camp-Assistant-300x213.png" alt="" width="300" height="213" /></a><p class="wp-caption-text">Boot Camp Assistant warning that I need optical drive</p></div>
<p>First I tried to <a href="https://discussions.apple.com/message/16840167#16840167" target="_blank">fake Boot Camp Assistant to create bootable USB stick</a>, but that did not boot for some reason. Also, booting from USB-DVD did not work.</p>
<p>Then I used Virtual Box to fully install Windows on physical partition and that did not show up in the boot menu either.</p>
<p>With all of these options I also combined <a href="http://refit.sourceforge.net/" target="_blank">rEFIt</a> to no avail.</p>
<h2>EFI, rEFIt and File Vault 2</h2>
<p>Intel Macs have been using <a href="http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface" target="_blank">EFI</a> instead of <a href="http://en.wikipedia.org/wiki/BIOS" target="_blank">BIOS</a> for booting up the system since the beginning. If Boot Camp dual-booting is not enough for you, there is the rEFIt alternative boot manager that gives you more power over boot options. But it turns out that although rEFIt installs without any complaints, it fails to load from <strong>File Vault 2 encrypted</strong> partition, which is understandable as I haven&#8217;t yet provided my passkey.</p>
<p>So, running out of options, I decided to decrypt my partition, which I&#8217;d have had to do anyway sometime to be able to resize the encrypted partition over the previous Boot Camp partition (Disk Utility is not able to resize encrypted partitions).</p>
<p>I still had rEFIt installed and I retried some of previous failed attempts, including booting from USB, but still no effect.</p>
<p>Finally I noticed that I had actually <strong>two</strong> boot loaders &#8211; Mac&#8217;s own <em>Option</em>-key triggered menu and then the rEFIt that was installed on the primary Mac OS X partition. While most of the time Mac menu didn&#8217;t show me anything besides primary partition and Recovery HD, rEFIt showed me Windows partition (sometimes two of them pointing to the same partition), but was not able to boot from them (giving different errors from EFI failures to Windows complaining that <a href="http://social.technet.microsoft.com/Forums/en-US/itprovistasetup/thread/1b2045b9-7fef-47f0-aea3-1e185fb7544c/" target="_blank">winload.exe is missing or corrupt</a>).</p>
<p>In the end I removed rEFIt altogether.</p>
<h1>The Success Story</h1>
<p>OK, enough of the failures. What ended up working was a variant of the <a href="http://www.andrewsavory.com/blog/2011/2156" target="_blank">Virtual Machine method</a>, that used Virtual Box to make the partition bootable and then copy over the installation files to that partition. Unfortunately I can not find the original post that lead me to the idea, but it was probably somewhere in <a href="http://forums.macrumors.com/showthread.php?t=631901&amp;page=5" target="_blank">this thread</a>.</p>
<p><strong>Note:</strong> At this point I had tried multitude of setups already and I can&#8217;t be sure that all of the steps below are necessary nor that all of the required steps are listed. If you find some errors, please comment on them.</p>
<h2>Create partition</h2>
<p>Create a partition in some way. You can use Boot Camp Assistant to shrink existing HFS+ partition and create a FAT32 partition or you can do it yourself via Disk Utility or <code>diskutil</code> command line tool. I had my partition left over from one of the tries with Boot Camp Assistant and USB DVD-drive.</p>
<p>Using Boot Camp for this step has the side effect that it gives you the option to download latest Boot Camp drivers for windows (just have a USB stick ready to store them).</p>
<div id="attachment_520" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/Boot-Camp-Assistant-Support-Software.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-520" title="Boot Camp Assistant Support Software" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/Boot-Camp-Assistant-Support-Software-300x221.png" alt="" width="300" height="221" /></a><p class="wp-caption-text">Let Boot Camp Assistant download latest support software</p></div>
<h2>Set up Virtual Box guest</h2>
<p>I used Oracle&#8217;s excellent (and free) <a href="https://www.virtualbox.org/" target="_blank">Virtual Box</a> virtualization tool. To get Virtual Box to use your physical Boot Camp partition, you have to make a raw disk image that is bound to your physical disk. In my case it was the <code>disk1</code> and I partition number 3 (<code>disk1s3</code> as seen from Disk Utility&#8217;s Info). To create the image, change directory to some good enough place to hold the file and enter (<strong>NB!</strong> adapt to your needs):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> VBoxManage internalcommands createrawvmdk <span style="color: #660033;">-rawdisk</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>disk1 <span style="color: #660033;">-filename</span> bootcamp.vmdk <span style="color: #660033;">-partitions</span> <span style="color: #000000;">3</span></pre></div></div>

<p>Next, give yourself access to the physical disk and the just created image files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">777</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>disk1s3
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #007800;">$USER</span> bootcamp<span style="color: #000000; font-weight: bold;">*</span>.vmdk</pre></div></div>

<p>Last thing is to actually set up Virtual Box Guest OS. There is nothing special there, except that you specify your<em> bootcamp.vmdk</em> as the startup disk, instead of creating new one.</p>
<h2>Installing Windows</h2>
<p>Install Windows to the Virtual Box guest as usual. I shut down the Virtual Box client at the &#8220;<em>Setting up Windows for first use</em>&#8221; step, but according to some posts (links to which I again have misplaced), you could stop even at the first reboot, though it didn&#8217;t seem to work in my case.</p>
<p>Now you should have a partition that is visible to the Mac Boot menu, but not a working Windows installation.</p>
<p>Next step is to restart the install, only this time on the real hardware. To accomplish this, mount the Boot Camp partition, <em>delete everything and copy over all files from the installer ISO</em>. NB! You probably need to have some kind of NTFS driver, either <a href="http://www.tuxera.com/community/ntfs-3g-download/" target="_blank">NTFS-3G</a> (see my blog on <a href="g/tech/2011/07/23/macfuse-and-mac-os-x-lion/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">how to get NTFS-3g working in Lion</a>) or some commercial driver like the <a href="http://www.paragon-software.com/home/ntfs-mac/" target="_blank">Paragon NTFS for Mac OS X</a> I have installed.</p>
<p>After you copy over the files, reboot your Mac and hold down <em>Option</em>-key to access the Windows partition. Now install windows as you would if you had with optical disk attached.</p>
<h1>Conclusion</h1>
<p>Now that I have finally managed to jump through all those hoops to get Windows installed, I can only wish that Virtualization advances enough that I could play those old Call of Duty games without even rebooting into Windows. Until then, I hope to preserve my newly installed Windows. <img src='http://blog.laaz.org/tech/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/04/02/ruby-on-rails-toolchest-for-windows-users/' rel='bookmark' title='Ruby (on Rails) toolchest for Windows users'>Ruby (on Rails) toolchest for Windows users</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook Pro bidrive or DIY optical bay HDD Caddy</title>
		<link>http://blog.laaz.org/tech/2012/04/20/macbook-pro-bidrive-or-diy-optical-bay-hdd-caddy/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/04/20/macbook-pro-bidrive-or-diy-optical-bay-hdd-caddy/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 07:35:04 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[hdd odd]]></category>
		<category><![CDATA[macbook pro]]></category>
		<category><![CDATA[optibay]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=493</guid>
		<description><![CDATA[If you ever run out of disk space on your laptop you might have wondered if you could replace your Optical Disc Drive which you rarely use anymore with another HDD. Turns out that of course you can and there &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/04/20/macbook-pro-bidrive-or-diy-optical-bay-hdd-caddy/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/' rel='bookmark' title='Installing Windows 7 on MacBook Pro without SuperDrive'>Installing Windows 7 on MacBook Pro without SuperDrive</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignright" style="width: 260px"><img class=" " title="OptiBay" src="http://www.mcetech.com/images/obreversewdrive090601.jpg" alt="" width="250" height="176" /><p class="wp-caption-text">OptiBay</p></div>
<p>If you ever run out of disk space on your laptop you might have wondered if you could replace your Optical Disc Drive which you rarely use anymore with another HDD. Turns out that of course you can and there are plenty of manufacturers out there who sell kits to do that. One of the most famous in Mac community is the <a href="http://www.mcetech.com/optibay/">MCE Technologies OptiBay</a> pictured right.</p>
<p>But I live in Estonia and of course I wanted it NOW, so I went out for a little adventure to see if I can fit one of those <em>el cheapo</em> <a href="http://www.akasa.co.uk/update.php?tpl=product/product.detail.tpl&amp;no=181&amp;type=Enclosures&amp;type_sub=2.5%20Enclosure&amp;model=AK-OA2SSA-BK">Akasa N.Stor HDD to ODD cases</a> found in local PC store.</p>
<p>For the imatient: <strong>yes I can</strong>.</p>
<p><span id="more-493"></span></p>
<h1>The Slim SuperDrive</h1>
<p>I went out and bought myself the aforementioned Akasa ODD bay case, but failed to notice that it had markings for both 12.5 and 9.5 mm HDD-s. What this means is, of course, the case itself is <strong>12.5 mm</strong> thick, which is 3 mm too much to fit in place of the SuperDrive. So if you can find a 9.5 mm case, your in luck. I had to be a bit more creative, but more on that later.</p>
<div id="attachment_494" class="wp-caption alignnone" style="width: 235px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_1.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-494" title="Akasa N.Stor" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_1-225x300.jpg" alt="" width="225" height="300" /></a><p class="wp-caption-text">Akasa N.Stor 12.5 mm bay</p></div>
<div id="attachment_496" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_2.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-496" title="Akasa N.Stor unpackaged" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_2-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Akasa N.Stor unpackaged</p></div>
<p>&nbsp;</p>
<h1>What&#8217;s in the belly</h1>
<p>First things first &#8211; unscrew your MacBook and take of the bottom. Note, that the bottom is held in place from the center by two clips and at first it seems that you missed some screws. Just gently pull on the bottom cover to release the clips one by one.</p>
<div id="attachment_497" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_3.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-497" title="MacBook Pro uncovered" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_3-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">To access the ODD, first remove Wireless chip screws (RED arrows) and then either (a) release the antenna wires (GREEN arrows) or the connection ribbon (BLUE arrow).</p></div>
<p>Now behold all of the glory inside your MacBook. More precisely pay attention to the Wireless chip that blocks access to ODD. You have to unscrew it (<span style="color: #ff0000;">RED</span> arrows) and then you have the option which of the wires to unplug. Either (a) release the antenna wires (<span style="color: #00ff00;">GREEN</span> arrows) or the connection ribbon (<span style="color: #3366ff;">BLUE</span> arrow). I opted for the antenna, because it seemed a bit less prone to break. (Though later on I learned that the ribbon reattaches a bit easier than the antenna wires, so pick your poison).</p>
<h1>Take out SuperDrive</h1>
<p>Now you can access the SuperDrive.</p>
<div id="attachment_498" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_4.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-498" title="MacBook Pro Superdrive" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_4-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Take out SuperDrive</p></div>
<p>First unscrew the 3 screws (marked <span style="color: #ff0000;">RED</span>) that hold it in place and then gently pull on the ribbon cable that connects it to the motherboard (marked <span style="color: #3366ff;">BLUE</span>) and remove the drive.</p>
<p>If you ever plan to replace the ODD into your MacBook (maybe when you&#8217;re selling it off), your are going to need those screws, so better <strong>screw them back in now</strong>, before they don&#8217;t get lost.</p>
<p><strong>UPDATE:</strong> After I received my <a href="http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&amp;item=160736136688">excellent SuperDrive external closure</a>, I found out that I should&#8217;ve unscrewed one additional fixing from the SuperDrive. In the above picture, it is the rightmost <span style="color: #ff0000;">RED</span> screw holder is itself attached to the SuperDrive with 2 screws. That won&#8217;t fit in the external closure, so instead of taping it inside the closure as I did, you could screw it back in the laptop for future use.</p>
<h1>The Creative Part</h1>
<p>Now we come to the part where I found out that the Akasa N.Stor was 3 mm too thick for the bay. Fortunately, after I dismantled the N.Stor case (BTW, one screw was behind a sticker), it turned out that the additional 3 mm were added with protruding stands that could easily chopped off (or so I hoped).</p>
<div id="attachment_499" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_5.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-499" title="Make N.Stor 9.5 mm" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_5-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">In the process of chopping off 3 mm of plastic from the N. Store</p></div>
<p>In the picture the <span style="color: #ff0000;">RED</span> arrows point to some of the stands that need to be chopped off. That part was easy &#8211; a sharp pocket knife and a steady hand.</p>
<p>The more tricky part was to thin up the inner rectangle. But I found that small wire-cutters followed up by knife and then a file did the job pretty well.</p>
<div id="attachment_500" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_6.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-500" title="Hacked N.Store compared to SuperDrive" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_6-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Hacked N.Store compared to SuperDrive</p></div>
<p>To avoid dust getting into the computer I washed the case thoroughly and then dried it off.</p>
<h1>Stuff it in</h1>
<p>Fitting the disk with the remains of the N.Store was easy enough but the problem was that the SuperDrive had screw-holes that the N.Store didn&#8217;t. So how would I secure the disk in place?</p>
<div id="attachment_501" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_7.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-501" title="foam" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_7-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Cabling foam</p></div>
<p>I found in my drawer some pieces of foam that was wrapped around a VGA cable. That looked like something I could use.</p>
<p>The N.Stor did have a plastic piece that was supposed to hold the HDD in place, but it did not seem to do it&#8217;s job that good, so I decided to stuff the HDD too from two sides and then fix the whole thing from two adjoining sides so that it was gently pressed against ODD bay walls.</p>
<div id="attachment_502" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_8.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-502" title="Stuff it in" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_8-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Stuff foam around the HDD and the casing</p></div>
<p>The frame that held Wireless chip proved to be in the ideal position, so I reattached that first and then stuffed foam between that and the N.Stor case. Another roll of foam was put between the case and the DVD slot.</p>
<h1>The Result</h1>
<div id="attachment_503" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_9.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="size-medium wp-image-503" title="ODD HDD final result" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/opticalbay_hdd_9-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Final result</p></div>
<p>The last piece was the insulator shield from the N.Store that completed the design. Reattach the back cover and you are done. <strong>Viola!</strong></p>
<p>I was a bit nervous when booting the Mac up, but everything worked nicely and now I have a bidrive MacBook Pro with SSD and HDD totalling 750 GB storage &#8211; should enough for some time. <img src='http://blog.laaz.org/tech/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>At the end it cost me 16 € compared to $90 for the OptiBay (35 € even in the aftermarket here). OK, the OptiBay comes with a free USB case for the SuperDrive which I don&#8217;t have, but it turns out that I can get one of those for another 10 €, totalling in 26 € for me. And a bit of exitement from accomplishing something myself.</p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/' rel='bookmark' title='Installing Windows 7 on MacBook Pro without SuperDrive'>Installing Windows 7 on MacBook Pro without SuperDrive</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/04/20/macbook-pro-bidrive-or-diy-optical-bay-hdd-caddy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby (on Rails) toolchest for Windows users</title>
		<link>http://blog.laaz.org/tech/2012/04/02/ruby-on-rails-toolchest-for-windows-users/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/04/02/ruby-on-rails-toolchest-for-windows-users/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 16:49:21 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[rubyinstaller]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=465</guid>
		<description><![CDATA[Setting up solid Ruby on Rails developer box based on Windows can be tedious task. More so than on other platforms, because vanilla Windows is meant for end user and lacks proper development tools that exist on other platforms. But &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/04/02/ruby-on-rails-toolchest-for-windows-users/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/' rel='bookmark' title='Installing Windows 7 on MacBook Pro without SuperDrive'>Installing Windows 7 on MacBook Pro without SuperDrive</a></li>
<li><a href='http://blog.laaz.org/tech/2010/04/27/ruby-lambda/' rel='bookmark' title='Ruby lambda'>Ruby lambda</a></li>
<li><a href='http://blog.laaz.org/tech/2011/08/25/ruby-rack-servers-benchmark/' rel='bookmark' title='Ruby Rack servers benchmark'>Ruby Rack servers benchmark</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="Rails" src="http://rubyonrails.org/images/rails.png" alt="" width="87" height="111" />Setting up solid Ruby on Rails developer box based on Windows can be tedious task. More so than on other platforms, because vanilla Windows is meant for end user and lacks proper development tools that exist on other platforms. But fear not, there are many good people out there that have jumped through multitude of hoops to get different parts of the ecosystem working. All that remains is to build a solid foundation for developmer from them.<span id="more-465"></span></p>
<h1>1. Ruby Installer</h1>
<p><img class="alignright" title="RubyInstaller.org" src="http://cdn.rubyinstaller.org/images/logo.png" alt="" width="290" height="82" />Of course the first and foremost brick in the foundation is <a href="http://rubyinstaller.org/" target="_blank">RubyInstaller.org</a> which is the easiest way to get Ruby working on Windows machine.</p>
<p>Just head over to the site and download the latest installer release (which at the time of writing is <a href="http://rubyforge.org/frs/download.php/75848/rubyinstaller-1.9.3-p125.exe">Ruby 1.9.3-p125</a>) and run it.</p>
<p>After agreeing to the license terms, RubyInstaller prompts you with some options. I think it a good idea to put Ruby on the path and also associate <code>.rb</code> and <code>.rbw</code> files with Ruby:</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/rubyinstaller-options.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-466" title="rubyinstaller options" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/rubyinstaller-options-300x111.png" alt="" width="300" height="111" /></a></p>
<p>Go ahead and finish the install.</p>
<h2>DevKit</h2>
<p>Some Ruby gems need to compile native code and in order to do so, they need some additional development tools which are missing in default Windows. Fortunately RubyInstaller has packaged them in a handy extension you can download from <a href="http://rubyinstaller.org/downloads/" target="_blank">their download page</a> under the &#8220;Development Kit&#8221; header.</p>
<p>Just unpack into some folder of your choosing, e.g. <code>C:\DevKit</code> (BTW, the package itself doesn&#8217;t contain a parent folder, so point it to an empty or non-existant folder) and navigate your <code>command prompt</code> to that folder. Based on the <a href="https://github.com/oneclick/rubyinstaller/wiki/Development-Kit">DevKit manual</a>, the following is needed to install it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby dk.rb init</pre></div></div>

<p>This will generate a <code>config.yml</code> file which you could use to configure multiple rubies, but for now we leave it as is. To install DevKit, just enter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby dk.rb <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<p><span class="Apple-style-span" style="color: #555555; font-size: 20px; font-weight: bold; line-height: 26px;">Gem conf</span></p>
<p>By default Ruby Gem command installs documentation for every gem. I have found that Googling is much more convenient and faster than browsing local documentation and as generating docs from code often takes more time than installing the gem in the first place, I have come to disable the documentation from the start. To do so, open Notepad (we&#8217;ll come to install a better editor later on) and input:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">gem: --no-ri --no-rdoc</pre></div></div>

<p>Save the file under your Documents and Settings directory with a filename <code>.gitrc</code> (yes, with a leading dot &#8211; that means hidden file in UNIX). E.g for me:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">C:\Documents and Settings\Laas\.gemrc</pre></div></div>

<h1>2. GIT</h1>
<p>&nbsp;</p>
<p><img class="alignright" title="GIT" src="http://msysgit.github.com/img/git-logo.png" alt="" width="92" height="179" />I won&#8217;t even come to the argument whether version control is needed. It&#8217;s a must. Period.</p>
<p>For me (and a lot of folks out there) currently <a href="http://git-scm.com/" target="_blank">GIT</a> is the best version control system &#8211; you can start using it without much effort and without even thinking about where to store the repository in the long run &#8211; it will all come in it&#8217;s own time.</p>
<p>For Windows users the easiest way to get GIT up and running is using <a title="msysGit" href="http://msysgit.github.com/" target="_blank">msysGit</a>. Head over to their Downloads page and download latest release (which at the time of writing is <a href="http://code.google.com/p/msysgit/downloads/detail?name=Git-1.7.9-preview20120201.exe&amp;can=2&amp;q=full+installer+official+git">Git-1.7.9-preview20120201.exe</a>).</p>
<p>Installing msysGit asks you a few questions. First come the install options and you could choose to check &#8216;Git GUI here&#8217; (and maybe &#8216;Git Bash Here&#8217;, but we&#8217;ll change the terminal emulator later on so that won&#8217;t be as helpful):</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/msysGit-components.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-470" title="msysGit components" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/msysGit-components-300x226.png" alt="" width="300" height="226" /></a></p>
<p>Next two settings are of importance. First one chooses how Git is integrated to PATH and I think the golden middle is best:</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/msysgit-path.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-471" title="msysgit path integration" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/msysgit-path-300x228.png" alt="" width="300" height="228" /></a></p>
<p>&nbsp;</p>
<p>And the last one changes how Git treats Windows line endings. Working with multi-platform programs (and Ruby on Rails is a good candidate for that) can be problematic, when developers don&#8217;t consider that Unix and Windows use different line endings (LF and CRLF respectfully). Git can automatically convert between the two and that is the default selection in msysGit. Change this only if you know you need to. Even if your editor already uses Unix endings, the first option won&#8217;t hurt.</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/msysgit-lineendings.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-472" title="msysgit line-endings" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/msysgit-lineendings-300x228.png" alt="" width="300" height="228" /></a></p>
<p>Now you should have a working Git installation.</p>
<h1>3. Console 2</h1>
<p>Windows Command prompt is a pain to use. It has multiple shortcomings when it comes to developing and while some are harder to overcome (e.g copy-paste because Windows uses Ctrl-C to copy, which at the same time is used to terminate a running command), others are more easy. There are several alternatives to the default <code>cmd.exe</code>, but I have found that the best is <a href="http://sourceforge.net/projects/console/" target="_blank">Console 2</a>.</p>
<p>It is actually a wrapper to cmd.exe but it adds Tab support, easier copy-paste and whats best for Rails developer &#8211; flexible windows width, so that you can fit all those routes in the window.</p>
<p>Just head over to their site and download <a href="http://sourceforge.net/projects/console/files/latest/download" target="_blank">latest version</a> and unpack it (I chose to put it under &#8216;Program Files&#8217;, but the location does not matter). For easier access, make a shortcut on your desktop.</p>
<h2>Configure</h2>
<p>For even better experience, we configure Console to use Git Bash we installed in the previous step. Open Console and navigate to <code>Edit &gt; Settings &gt; Tabs</code>. There the Shell division has two options. First one points to the executable that is run as the command interpreter. Default empty value means &#8216;cmd.exe&#8217;, but we change it to Git bash. First use the file navigator option to find Git bash (in the &#8216;bin&#8217; folder under Git installation directory) and then add two options to that line:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">C:\Program Files\Git\bin\bash.exe <span style="color: #660033;">--login</span> <span style="color: #660033;">-i</span></pre></div></div>

<p>Next, if you keep all your projects in one folder, set the startup directory to point to that folder.</p>
<p>All together you should see something like this:</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/04/console-settings.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-medium wp-image-473" title="console-settings" src="http://blog.laaz.org/tech/wp-content/uploads/2012/04/console-settings-300x95.png" alt="" width="300" height="95" /></a></p>
<p>If you now restart Console, you should see a bit different  look (which you like, I hope).</p>
<h1>4. Editor</h1>
<p>As pormised, we now come to pick a good programmers editor. There are a lot of choices out there and I won&#8217;t come to claim any of them to be THE single best. Also, as many of the best editors are actually paid software, I won&#8217;t advertise any of them, but will only make a short list of them and point out a few things to notice.</p>
<p>Many of Rails developers are Mac users and many of them use <a href="http://macromates.com/" target="_blank">TextMate</a> as their editor, thus a lot of TextMate bundles exist to make developers life easier. It might be a good idea to start with one of those that support TextMate bundles.</p>
<p>Give a try of many of them to find your poison:</p>
<ul>
<li><a href="http://notepad-plus-plus.org/" target="_blank">Notepad++</a> &#8211; free and powerful editor</li>
<li><a href="http://www.jedit.org/" target="_blank">jEdit</a> &#8211; also free, but Java-based and <em>cross-platform</em></li>
<li><a href="http://www.e-texteditor.com/index.html" target="_blank">E Texteditor</a> - paid app, but has the benefit of using TextMate bundles.</li>
<li><a href="http://www.sublimetext.com/2" target="_blank">Sublime Text 2</a> &#8211; paid app (currently in beta), also supports TextMate bundles, it&#8217;s <em>cross-platform</em></li>
<li><a href="http://www.activestate.com/komodo-edit">Komodo Edit</a> &#8211; free IDE,<em> cross-platform</em></li>
<li><a href="http://www.jetbrains.com/ruby/" target="_blank">RubyMine</a> &#8211; paid Ruby IDE, <em>cross-platform</em></li>
</ul>
<div><span class="Apple-style-span" style="line-height: 18px;">And of course, there is the epic question whether to use <a href="http://en.wikipedia.org/wiki/Integrated_development_environment" target="_blank">IDE</a> or a simple text editor. For myself, I have come to this conclusion that for Rails development, IDE-s don&#8217;t have that much power to offer for the increased overhead of their weight, so I like myself a nice quick and small programmers editor. But your milage may vary and a good IDE could come handy from time to time.</span></div>
<p>&nbsp;</p>
<h2>Configure</h2>
<p>Which ever editor you choose, most definitely you need to configure it to your needs. At the bare minimum, you have to choose whether you use<strong> tabs or spaces</strong> and how many of them for indenting code lines.</p>
<p>To give you a head start, it seems to be convention in Ruby world to use <strong>2 spaces</strong> instead of tabs &#8211; this is a good balance between readability and width for most Ruby projects and also makes it easy to share and edit Ruby code online (where tabs are not so easy to enter) or via email etc.</p>
<h1>5. Rails</h1>
<p>Last thing before firing off development would be to install Rails itself along with its dependencies. Open console and type the following commands.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> bundler</pre></div></div>

<p>This installs fantastic <a href="http://gembundler.com/">Bundler</a> gem to manage your apps gems for you.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails</pre></div></div>

<p>And this installs Rails itself.</p>
<p>Now, off you go. Start developing Rails applications. Shue!</p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2012/04/24/installing-windows-7-on-macbook-pro-without-superdrive/' rel='bookmark' title='Installing Windows 7 on MacBook Pro without SuperDrive'>Installing Windows 7 on MacBook Pro without SuperDrive</a></li>
<li><a href='http://blog.laaz.org/tech/2010/04/27/ruby-lambda/' rel='bookmark' title='Ruby lambda'>Ruby lambda</a></li>
<li><a href='http://blog.laaz.org/tech/2011/08/25/ruby-rack-servers-benchmark/' rel='bookmark' title='Ruby Rack servers benchmark'>Ruby Rack servers benchmark</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/04/02/ruby-on-rails-toolchest-for-windows-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TextMate 2 New Window (via AppleScript)</title>
		<link>http://blog.laaz.org/tech/2012/03/01/textmate-2-new-window-via-applescript/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/03/01/textmate-2-new-window-via-applescript/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 16:13:30 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[TextMate]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=430</guid>
		<description><![CDATA[Often I find myself in a situation where I need to quickly paste some text and edit it a bit. Switching to TextMate also switches spaces to my last TM session, which might not be my current space. With other &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/03/01/textmate-2-new-window-via-applescript/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2010/11/27/bettertouchtool-and-safari/' rel='bookmark' title='BetterTouchTool and Safari'>BetterTouchTool and Safari</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/03/TMNewWindow.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignright size-full wp-image-431" title="TextMate 2 New Window" src="http://blog.laaz.org/tech/wp-content/uploads/2012/03/TMNewWindow.png" alt="" width="184" height="184" /></a>Often I find myself in a situation where I need to quickly paste some text and edit it a bit. Switching to TextMate also switches spaces to my last TM session, which might not be my current space. With other programs (and TextMate 1 for that matter) this can be overcome by selecting &#8220;New file&#8221; or &#8220;New window&#8221; from dock menu.</p>
<p>But the problem is that <a href="http://blog.macromates.com/2011/textmate-2-0-alpha/">TextMate 2 alpha</a> currently does not have<br />
&#8220;New file&#8221; option in the Dock menu. I really miss this, because of my workflow &#8211; I use spaces to manage projects and programs I have open concurrently and I don&#8217;t want to mix the TextMate windows between spaces. So opening new TM2 window in <em>current</em> space is a must.</p>
<p>But surely the developers are preoccupied with more important features and thus I decided to throw in my 2 cents and cobbled together an AppleScript that one can use to open new window in current space.</p>
<h2>TMNewWindow</h2>
<p>Place this script in your <strong>Applications</strong> folder and wait until Spotlight has indexed it. Then push whatever shortcut you have for Spotlight (or <a href="http://www.alfredapp.com/">Alfred</a>, if you are like me) and enter few first chars. I have found that <em>tmn</em> is enough to trigger this application.</p>
<p><img class="alignnone size-medium wp-image-433" title="Alfred TMNewWindow" src="http://blog.laaz.org/tech/wp-content/uploads/2012/03/alfred_tmnewwindow-300x72.png" alt="" width="300" height="72" /></p>
<p>Hitting enter will fire this app and a sec later new TextMate window should be opened in current space. Definitely faster than switching to TM2, hitting ⌘N and then moving the window to correct space.</p>
<p>&nbsp;</p>
<style type="text/css">a#maxbutton-1 { text-decoration: none; color: #ffffff; font-family: Arial; font-size: 14px; font-style: normal; font-weight: bold; padding-top: 15px; padding-right: 25px; padding-bottom: 15px; padding-left: 25px; background-color: #98ba40; background: linear-gradient(#98ba40 45%, #618926); background: -moz-linear-gradient(#98ba40 45%, #618926); background: -o-linear-gradient(#98ba40 45%, #618926); background: -webkit-gradient(linear, left top, left bottom, color-stop(.45, #98ba40), color-stop(1, #618926)); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="#98ba40", endColorStr="#618926"); -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="#98ba40", endColorStr="#618926"); border-style: solid; border-width: 1px; border-color: #618926; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-top-left-radius: 4px; -webkit-border-top-right-radius: 4px; -webkit-border-bottom-left-radius: 4px; -webkit-border-bottom-right-radius: 4px; text-shadow: -1px -1px 0px #618926; box-shadow: 0px 0px 2px #333333; } a#maxbutton-1:visited { text-decoration: none; color: #ffffff; } a#maxbutton-1:hover { text-decoration: none; color: #ffffff; background-color: #2270df; background: linear-gradient(#2270df 45%, #12295d); background: -moz-linear-gradient(#2270df 45%, #12295d); background: -o-linear-gradient(#2270df 45%, #12295d); background: -webkit-gradient(linear, left top, left bottom, color-stop(.45, #2270df), color-stop(1, #12295d)); filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="#2270df", endColorStr="#12295d"); -ms-filter: progid:DXImageTransform.Microsoft.gradient(startColorStr="#2270df", endColorStr="#12295d"); border-color: #0f2557; text-shadow: -1px -1px 0px #12295d; box-shadow: 0px 0px 2px #333333; }</style><a id="maxbutton-1" href="http://blog.laaz.org/tech/wp-content/uploads/2012/03/TMNewWindow.zip" >Download TMNewWindow</a>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2010/11/27/bettertouchtool-and-safari/' rel='bookmark' title='BetterTouchTool and Safari'>BetterTouchTool and Safari</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/03/01/textmate-2-new-window-via-applescript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhoto Empty Trash</title>
		<link>http://blog.laaz.org/tech/2012/02/28/iphoto-empty-trash/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/02/28/iphoto-empty-trash/#comments</comments>
		<pubDate>Tue, 28 Feb 2012 09:35:18 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[disk space]]></category>
		<category><![CDATA[iPhoto]]></category>
		<category><![CDATA[trash]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=421</guid>
		<description><![CDATA[If you use iPhoto to manage your photos and you have deleted a bunch of them either because they weren&#8217;t so good or perhaps moved to other library using iPhoto Library Manager, you notice that disk space hasn&#8217;t been freed. &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/02/28/iphoto-empty-trash/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2010/10/18/itunes-iphoto-and-migration-assistant/' rel='bookmark' title='iTunes, iPhoto and Migration Assistant'>iTunes, iPhoto and Migration Assistant</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" title="iPhoto" src="http://images.apple.com/ilife/iphoto/images/title_20100727.png" alt="" width="266" height="71" />If you use iPhoto to manage your photos and you have deleted a bunch of them either because they weren&#8217;t so good or perhaps moved to other library using <a title="iPhoto Library Manager" href="http://www.fatcatsoftware.com/iplm/" target="_blank">iPhoto Library Manager</a>, you notice that disk space hasn&#8217;t been freed. Fear not.</p>
<h2>iPhoto Trash</h2>
<p>iPhoto uses its own trashcan to store deleted photos for easy retrieval. You can view the contents of trash by clicking its icon in the left pane in the <strong>Recent</strong> section.</p>
<p><span class="Apple-style-span" style="line-height: 19px;"><img class="size-full wp-image-422 alignnone" title="iPhoto Trash" src="http://blog.laaz.org/tech/wp-content/uploads/2012/02/iPhoto-Trash.png" alt="" width="189" height="79" /></span></p>
<h2>Empty iPhoto Trash</h2>
<p>To free your disk space of these deleted photos you have to simply empty the trashcan. To do so, just push <strong>Empty Trash</strong> button in the upper right corner if you are inside the Trash.</p>
<p>Or at any time select &#8220;<strong>Empty iPhoto Trash</strong>&#8221; from the iPhoto menu as seen below.</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/02/Empty-iPhoto-Trash-1.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-full wp-image-423" title="Empty iPhoto Trash menuitem" src="http://blog.laaz.org/tech/wp-content/uploads/2012/02/Empty-iPhoto-Trash-1.png" alt="" width="279" height="137" /></a></p>
<p>Now it prompts you with the usual confirmation:</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/02/Empty-iPhoto-Trash-2.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-full wp-image-424" title="Empty iPhoto Trash confirmation" src="http://blog.laaz.org/tech/wp-content/uploads/2012/02/Empty-iPhoto-Trash-2.png" alt="" width="421" height="155" /></a></p>
<p>And when you agree, it will move the photos to the Mac OS X system Trash.</p>
<h2>Empty Trash</h2>
<p>After the iPhoto Trash has been emptied, the files are now in system Trash and to finally free disk space, this also must be emptied. This is done as usual, by right-clicking (Ctrl-clicking) the Trashcan and selecting &#8220;<strong>Empty Trash</strong>&#8220;. Again, it will prompt you with confirmation, but this time it includes <strong>all</strong> the files in the Trash so be sure to be sure. <img src='http://blog.laaz.org/tech/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2012/02/Empty-Trash.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-full wp-image-425" title="Empty Trash" src="http://blog.laaz.org/tech/wp-content/uploads/2012/02/Empty-Trash.png" alt="" width="420" height="155" /></a></p>
<h2>Safety net</h2>
<p>As you see, freeing disk space from deleted photos can be a long walk, but after all, photos might just be our most valuable files on our computers as they are impossible to recreate.</p>
<p><strong>Always</strong> make (several) backups of your photos to be sure not to loose them.</p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2010/10/18/itunes-iphoto-and-migration-assistant/' rel='bookmark' title='iTunes, iPhoto and Migration Assistant'>iTunes, iPhoto and Migration Assistant</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/02/28/iphoto-empty-trash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn Linux into a remote AirPlay speaker</title>
		<link>http://blog.laaz.org/tech/2012/01/25/turn-linux-into-a-remote-airplay-speaker/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/01/25/turn-linux-into-a-remote-airplay-speaker/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 22:04:05 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Rest of the World]]></category>
		<category><![CDATA[Airfoil]]></category>
		<category><![CDATA[AirPlay]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[ShairPort]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=417</guid>
		<description><![CDATA[Some time ago Apple game out with the AirPlay feature (an upgraded AirTunes) which enables iOS devices and iTunes play music and videos on a remote device. &#160; In our office we have a Linux box, a set of speakers and &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/01/25/turn-linux-into-a-remote-airplay-speaker/">Read more &#187;</a></p>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Some time ago Apple game out with the <a title="AirPlay" href="http://www.apple.com/itunes/airplay/">AirPlay</a> feature (an upgraded AirTunes) which enables iOS devices and iTunes play music and videos on a remote device.</p>
<p>&nbsp;</p>
<p>In our office we have a Linux box, a set of speakers and a few laptops sporting Mac and Windows. Tonight I set out with a goal to turn that Linux box into an AirPlay speaker so that each of us can play music from their laptop without having to reconnect the cables every time.</p>
<h2>Airfoil</h2>
<p><img class="alignright" title="Airfoil" src="http://rogueamoeba.com/global/images/icons/96/airfoil96.png" alt="" width="96" height="96" />First off I stubled upon RougeAmoeba&#8217;s <a href="http://rogueamoeba.com/airfoil/">Airfoil</a>, which is a $25 sofware piece that, enables half a dozen device classes to be hooked up as remote speakers to a Mac or Windows (yes, that too). And, better yet, instead of only enabling iTunes to play, it can reroute all sound to that remote speaker. Though, it&#8217;s Linux speaker software is free download, it still seems to require paid Airfoil to route audio, because bare iTunes couldn&#8217;t care less of the wannabe Linux speaker that should have appeared to the WiFi. As the price would have been multiplied by the number of laptops, it was unfortunately out of question.</p>
<h2>Shairport</h2>
<p><img class="size-full wp-image-418 alignright" title="ShairPort" src="http://blog.laaz.org/tech/wp-content/uploads/2012/01/shairplay.png" alt="" width="192" height="77" /></p>
<p>With a bit of googling around, I next found <a href="https://github.com/albertz/shairport">Shairport</a>, which (if I got it correctly) is based on data found in a hacked and reverse engineered AirPort Express. ShairPort turns a random PC into a fake AirPlay speaker set. The software itself got installed relatively quickly after going through the short docs (perhaps because I had most of the dependencies like avahi etc already in place because of the Airfoil).</p>
<p>&nbsp;</p>
<p>Also, for Airfoil, I had already opened firewall to Zeroconf/Bonjour and ports <strong>TCP:5000-5005</strong> and <strong>UDP:6000-6005</strong>  which seemed to apply to Shairport too.</p>
<p>After starting up the daemon, all of our iTunes magically discovered the new remote speakers and allowed us to play music there with a simple mouse click. Even from Windows. And from iPhone. And, if wanted, all at the same time. Voila!</p>
<p>This is definitely much easier than messing with the wires all the time.</p>
<p>&nbsp;</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/01/25/turn-linux-into-a-remote-airplay-speaker/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>desopafy Wikipedia</title>
		<link>http://blog.laaz.org/tech/2012/01/18/desopafy-wikipedia/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2012/01/18/desopafy-wikipedia/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 08:14:17 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Rest of the World]]></category>
		<category><![CDATA[SOPA]]></category>
		<category><![CDATA[wikipedia]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=405</guid>
		<description><![CDATA[Today Wikipedia has a blackout. This is because US is passing a law that can threaten open Internet. Please read all about the SOPA blackout in the Wikipedia article. I have signed a petition against SOPA and I am fully concerned &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2012/01/18/desopafy-wikipedia/">Read more &#187;</a></p>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Today Wikipedia has a blackout. This is because US is passing a law that can threaten open Internet.</p>
<p><img class="alignright" title="Wikipedia Blackout" src="http://upload.wikimedia.org/wikipedia/commons/9/98/WP_SOPA_Splash_Full.jpg" alt="" width="362" height="313" /></p>
<p>Please read all about the <a href="http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more">SOPA blackout in the Wikipedia article</a>. I have signed a petition against SOPA and I am fully concerned about what this could mean to Internet.</p>
<p>Wikipedia is main source of information for me and when googling around I hit Wikipedia dozens of times a day. I would not even like to think about what it would be like if Wikipedia would be blocked, because of linking to webpages that, among other things, contained some alleged pirated materials.</p>
<p>&nbsp;</p>
<h2>Now what?</h2>
<p>Having said all this and having already put in my 2 cents, I now have work to do and this blackout is hindering my progress, even if for just one day. Fortunately Wikipedia has not removed itself from Internet. It only has drawn a black blanket over it&#8217;s contents. So, after viewing this black page and dedicating a few (milli)seconds to think about the consequences of SOPA, tech-savvy people can still reach the articles and make use of them.</p>
<p><strong>NOTE</strong>: This post is <strong>not</strong> about avoiding Wikipedia blackout. This post is about getting work done, <strong>after</strong> you have signed some anti-SOPA petition or written a letter of concern to the US Senate or your own Ministry of Foreign Affairs if you live outside US.</p>
<h2>Desopafy</h2>
<p>There are several ways to still access Wikipedia today. Wikipedia itself has pointed out that mobile Wikipedia is still accessible and as the blackout is JavaScript-based, disabling JavaScript, will avoid the blackout too. But being JavaScript based, the blackout can also be reversed with JS. My initial code was a bit crude, so I googled around and found a more thorough version (thanks <a href="https://gist.github.com/timraymond">timraymond</a> and <a href="https://gist.github.com/kballenegger">kballenegger</a>). Add this link to your bookmarks (or drag it to your bookmark bar):</p>
<p><a style="border: 1px solid white; background-color: black; color: white; font-weight: bold; padding: 0.5em;" href="javascript:%24(%22%23mw-page-base%2C%20%23mw-head-base%2C%20%23content%2C%20%23mw-head%2C%20%23mw-panel%2C%20%23footer%22).css(%22display%22%2C%22inherit%22)%3B%24(%22%23mw-sopaOverlay%22).css(%22display%22%2C%22none%22)#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">Desopafy_Wikipedia</a></p>
<p>This bookmarklet will hide the blackout and show the Wikipedia article. But please, do at least think of what this blackout means, before you remove it.</p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2012/01/18/desopafy-wikipedia/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Gimp Resyntesize: remove unwanted objects from photos</title>
		<link>http://blog.laaz.org/tech/2011/10/17/gimp-resyntesize-remove-unwanted-objects-from-photos/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2011/10/17/gimp-resyntesize-remove-unwanted-objects-from-photos/#comments</comments>
		<pubDate>Mon, 17 Oct 2011 08:13:02 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Rest of the World]]></category>
		<category><![CDATA[GIMP]]></category>
		<category><![CDATA[photo editing]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=391</guid>
		<description><![CDATA[Use open-source GIMP to remove unwanted objects from your photos.<p class="read-more"><a href="http://blog.laaz.org/tech/2011/10/17/gimp-resyntesize-remove-unwanted-objects-from-photos/">Read more &#187;</a></p>
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Probably many of us have seen at least demos of using Photoshop to un-clutter your photos, resulting in almost unseemingly removed objects and restored background. While I won&#8217;t argue that Photoshop does excellent job at this, it is good to know that open-source GIMP this functionality too.</p>
<p>The GIMP <a title="GIMP Resynthesizer" href="http://registry.gimp.org/node/25219" target="_blank">Resynthesizer plugin</a> makes it easy to intelligently remove unwanted objects from photos. There seems to be a 2.0 version of this plugin available at the developer&#8217;s github page (<a href="https://github.com/bootchk/resynthesizer" target="_blank">bootchk/resynthesizer</a>), but I haven&#8217;t tried that yet.</p>
<p>How this plugin works has been covered number of times before, (e.g this <a title="Content-Aware Fill in GIMP" href="http://www.youtube.com/watch?v=6OOYnZyY2rs" target="_blank">&#8220;Content-Aware Fill&#8221; clip</a> or this <a href="http://www.hutsby.net/2010/04/howto-use-resynthesizer-for-gimp-on-osx.html" target="_blank">resynthesizer tutorial</a>), so I won&#8217;t go into details of this here.</p>
<p>Only difference for me was that I used the <code>Enchance &gt; Smart remove selection...</code> filter rather than <code>Map &gt; Resynthesize...</code> and the result is displayed below.</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2011/10/Gimp_resynthesizer.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-full wp-image-393" title="GIMP Resynthesizer" src="http://blog.laaz.org/tech/wp-content/uploads/2011/10/Gimp_resynthesizer.png" alt="Using GIMP Resynthesizer to remove unwanted objects" width="560" height="420" /></a></p>
<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2011/10/17/gimp-resyntesize-remove-unwanted-objects-from-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mail.app Gmail style related messages</title>
		<link>http://blog.laaz.org/tech/2011/09/06/mail-app-gmail-style-related-messages/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://blog.laaz.org/tech/2011/09/06/mail-app-gmail-style-related-messages/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 16:22:32 +0000</pubDate>
		<dc:creator>Laas</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[Mail.app]]></category>

		<guid isPermaLink="false">http://blog.laaz.org/tech/?p=383</guid>
		<description><![CDATA[Mac OS X Lion Mail.app has a ton of new features and not the least of them is the conversation view that makes it look much in like Gmail. Still, unlike Gmail, Mail.app by default shows only incoming conversation and &#8230;<p class="read-more"><a href="http://blog.laaz.org/tech/2011/09/06/mail-app-gmail-style-related-messages/">Read more &#187;</a></p>
Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2009/11/16/location-aware-time-machine/' rel='bookmark' title='Location Aware Time Machine'>Location Aware Time Machine</a></li>
<li><a href='http://blog.laaz.org/tech/2010/11/09/address-book-groups/' rel='bookmark' title='Address Book groups'>Address Book groups</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Mac OS X Lion Mail.app has a ton of <a href="http://www.apple.com/macosx/whats-new/mail.html">new features</a> and not the least of them is the conversation view that makes it look much in like Gmail.</p>
<p>Still, unlike Gmail, Mail.app by default shows only incoming conversation and omits sent messages, unless one presses the &#8220;<em>Show related messages</em>&#8221; button.</p>
<p>Fortunately there is a preference option to turn this on constantly.</p>
<p><a href="http://blog.laaz.org/tech/wp-content/uploads/2011/09/Show-related-messages-1.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><img class="alignnone size-full wp-image-388" title="Show related messages" src="http://blog.laaz.org/tech/wp-content/uploads/2011/09/Show-related-messages-1.png" alt="" width="552" height="506" /></a></p>
<p>Go to menu &#8220;Mail &gt; Preferences &gt; View&#8221; and check &#8220;<em>Include related messages</em>&#8221; box.</p>
<p>I wonder why this option is turned off by default?</p>
<p>Related posts:<ol>
<li><a href='http://blog.laaz.org/tech/2009/11/16/location-aware-time-machine/' rel='bookmark' title='Location Aware Time Machine'>Location Aware Time Machine</a></li>
<li><a href='http://blog.laaz.org/tech/2010/11/09/address-book-groups/' rel='bookmark' title='Address Book groups'>Address Book groups</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.laaz.org/tech/2011/09/06/mail-app-gmail-style-related-messages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

