<?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>Dark Liquid &#187; Howto/Tutorial</title>
	<atom:link href="http://darkliquid.co.uk/category/howtotutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://darkliquid.co.uk</link>
	<description>Rainy Days</description>
	<lastBuildDate>Sun, 01 Aug 2010 06:33:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Google Chrome and the /etc/hosts file</title>
		<link>http://darkliquid.co.uk/2009/12/12/google-chrome-and-the-etchosts-file/</link>
		<comments>http://darkliquid.co.uk/2009/12/12/google-chrome-and-the-etchosts-file/#comments</comments>
		<pubDate>Sat, 12 Dec 2009 11:45:38 +0000</pubDate>
		<dc:creator>Dark Liquid</dc:creator>
				<category><![CDATA[Howto/Tutorial]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[geek]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[servers]]></category>

		<guid isPermaLink="false">http://darkliquid.co.uk/?p=283</guid>
		<description><![CDATA[I&#8217;ve switched to using Chrome recently as my browser of choice but recently came across a rather annoying problem with it. I was writing a new chapter of a story on Protagonize and didn&#8217;t notice that the server migration they were doing happened to star during the course of my writing. I click submit and [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve switched to using Chrome recently as my browser of choice but recently came across a rather annoying problem with it.</p>
<p>I was writing a new chapter of a story on Protagonize and didn&#8217;t notice that the server migration they were doing happened to star during the course of my writing. I click submit and pow, my work was gone as the site didn&#8217;t exist any more. I thought I might have lost it but luckily Chrome still had it and tried to repost it every time I did a refresh. However, I had no way of getting the text out of Chrome as it would not display the original text entry form. Crap. I had two choice, either wait until the migration was complete or lose my work.</p>
<p>I decided to wait and the migration went through fine but one last problem! The server had changed IP address and none of the DNS had updated yet! I set up an entry in my hosts file expecting Chrome to honour it but it ignored it. Oh noes!</p>
<p>So, I did what any self-respecting geek would do, set up my own DNS server, changed my computer to use that as it&#8217;s primary DNS and had that DNS server use my hosts file. That way Chrome was unknowingly using my hosts file and all was well. I saved my story chapter and got it posted. Geek solutions for the win!</p>
<p>Here is how I did it (obviously this is only applicable to Linux, Ubuntu Karmic in my specific case):</p>
<pre><code lang="bash">
# edited /etc/hosts and added the new protagonize DNS entry
sudo aptitude install dnsmasq
# edit /etc/dnsmasq.conf and added the line: listen-address=127.0.0.1
/etc/init.d/dnsmasq restart
# edit /etc/resolv.conf and added this line as the first nameserver entry: nameserver 127.0.0.1
</code></pre>
<p>I also decided I wanted to keep using dnsmasq as a local DNS cache (for faster DNS queries and dealing with evil issues like this) so I added an entry to my
<pre><code lang="bash">/etc/dhcp3/dhclient.conf</code></pre>
<p> file (which controls what happens when your computer gets new network details automatically via DHCP, which is what I use on my network) to ensure it updated the
<pre><code lang="bash">/etc/resolve.conf</code></pre>
<p> with the entry for the local DNS cache. I did this by adding the line
<pre><code lang="bash">prepend domain-name-servers 127.0.0.1;</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://darkliquid.co.uk/2009/12/12/google-chrome-and-the-etchosts-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamically Defined Targets for Remote Tasks in Vlad</title>
		<link>http://darkliquid.co.uk/2009/10/01/dynamically-defined-targets-for-remote-tasks-in-vlad/</link>
		<comments>http://darkliquid.co.uk/2009/10/01/dynamically-defined-targets-for-remote-tasks-in-vlad/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 10:47:05 +0000</pubDate>
		<dc:creator>Dark Liquid</dc:creator>
				<category><![CDATA[Howto/Tutorial]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[useful]]></category>
		<category><![CDATA[vlad]]></category>

		<guid isPermaLink="false">http://darkliquid.co.uk/?p=274</guid>
		<description><![CDATA[Typically things like Vlad and Capistrano make the assumption you already know where you want to run your tasks. They assume you already have some servers somewhere ticking over just fine and you want to do stuff on them according to some predetermined pattern. However, what happens when you want to write some tasks you [...]]]></description>
			<content:encoded><![CDATA[<p>Typically things like Vlad and Capistrano make the assumption you already know where you want to run your tasks. They assume you already have some servers somewhere ticking over just fine and you want to do stuff on them according to some predetermined pattern.</p>
<p>However, what happens when you want to write some tasks you can run on <em>any</em> remote server? What happens if you don&#8217;t have any servers and you want to build some dynamically and then run some remote tasks on them?</p>
<p>Well, I&#8217;ve been asking these questions and I found an answer that helped me out and thought I&#8217;d share it here.</p>
<p>Using the dependency system of rake and the lazy role evaluation of vlad along with the fact that it provides some very useful public class methods (so they are presumably safe, rather than hacking into the internals with send or the like) I wrote the following simple test script:</p>
<pre><code lang="ruby">
require 'rubygems'
require 'highline'
require 'vlad'
task :server_config do
  ssh_string = HighLine.new.ask 'Enter the SSH details of the server you want to connect to: '
  Rake::RemoteTask.role :server, ssh_string
end

desc 'Run stuff on a server'
remote_task :server, :roles => :server do
  run "echo 'hello i am a server'"
end
task :server => :server_config
</code></pre>
<p>What&#8217;s going on here is that I have a remote task using a role server which as of yet <em>I haven&#8217;t defined</em>. When I run <code>rake server</code> that runs the server task. The server task is dependent on the server_config task which sets up a role &#8216;server&#8217; with the given string (ideally something like user@server.com). The remote task then executes, evaluating the value of the role, which is now set to the users input, and connects to the server you&#8217;ve set at run time. How awesome is that?</p>
<p>Of course, this is a contrived example, you could use a system to setup roles automatically from other things rather than pulling in user input but the lesson to take away here is that is is possible to use vlad tasks on dynamically defined targets <em>easily</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://darkliquid.co.uk/2009/10/01/dynamically-defined-targets-for-remote-tasks-in-vlad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Phone Firmware</title>
		<link>http://darkliquid.co.uk/2009/09/19/new-phone-firmware/</link>
		<comments>http://darkliquid.co.uk/2009/09/19/new-phone-firmware/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 15:05:27 +0000</pubDate>
		<dc:creator>Dark Liquid</dc:creator>
				<category><![CDATA[Howto/Tutorial]]></category>

		<guid isPermaLink="false">http://darkliquid.co.uk/?p=266</guid>
		<description><![CDATA[I&#8217;ve been holding off upgrading the firmware on my G1 due to fears about warranties and bricking my primary communications device but my phone was acting up recently, being very, very slow on the stock firmware that I decided, what the hell, lets do it. My good friend bytey directed me to a useful guide [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been holding off upgrading the firmware on my G1 due to fears about warranties and bricking my primary communications device but my phone was acting up recently, being very, very slow on the stock firmware that I decided, what the hell, lets do it.</p>
<p>My good friend <a href="http://bytey.co.uk">bytey</a> directed me to <a href="http://forum.xda-developers.com/showthread.php?t=442480">a useful guide on rooting and flashing your phone</a>. I went a little further than that and so I thought I&#8217;d share the process with you.</p>
<p>I first followed the above guide but stopped when it came time to installing a new firmware, instead just following the rooting, recovery and HardSPL instructions. Once that was done, I ran into trouble.</p>
<p>I decided to download and install cyanogen 4.0.4. To use the Apps2SD functionality, you need to partition your microSD card so it has a ext3 partition and a fat32, which I did using fdisk and the mkfs tools under linux. I opted to have the fat32 partition be the first on the disk, followed by the ext3 one. I&#8217;d heard that problems happened with large ext3 partitions so I made sure to keep it to 1GB or less.</p>
<p>The install process went along easy enough, I downloaded the firmware from the <a href="http://www.cyanogenmod.com/">cyanogen mod site</a> and renamed the update-blah-blah-blah.zip file to update.zip and placed it in the root of the SDcard then powered off the phone. I booted the phone into recovery mode by holding the home button and tapping the power button, did an Alt-L to show the menu, Alt-W to wipe the phone and then Alt-S to flash the rom from the update.zip.</p>
<p>Voila, one reboot later and I&#8217;m running cyanogen!</p>
<p>What happened after this resulted in me screwing up my install. I installed the cyanogen updater from the market and tried to install the <a href="http://forum.xda-developers.com/showthread.php?p=4343872">enoch theme</a> with it. When the updater tried to apply the theme the screwed everything up and I had to reinstall cyanogen.</p>
<p>What I should have actually done was install the cyanogen recovery image first. I did this by downloading it from the cyanogen website, opening a terminal on the phone, su-ing and then typing:</p>
<pre><code lang="bash">
flash_image recovery /sdcard/name-of-cyanogen-recovery-image.img
</code></pre>
<p>After installing that the cyanogen updater worked a treat for installing the enoch theme and I was away!</p>
]]></content:encoded>
			<wfw:commentRss>http://darkliquid.co.uk/2009/09/19/new-phone-firmware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Titanium and other developments</title>
		<link>http://darkliquid.co.uk/2009/06/21/titanium-and-other-developments/</link>
		<comments>http://darkliquid.co.uk/2009/06/21/titanium-and-other-developments/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 07:42:12 +0000</pubDate>
		<dc:creator>Dark Liquid</dc:creator>
				<category><![CDATA[Howto/Tutorial]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://darkliquid.co.uk/?p=244</guid>
		<description><![CDATA[I&#8217;ve been playing around with Appcelerator&#8217;s Titanium system and so far it&#8217;s been interesting. I haven&#8217;t done very much in the way of app development yet as I am still learning the APIs but I finally managed to get it to run under Linux (Ubunty Jaunty specifically) which is a plus! How to get the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing around with Appcelerator&#8217;s Titanium system and so far it&#8217;s been interesting. I haven&#8217;t done very much in the way of app development yet as I am still learning the APIs but I finally managed to get it to run under Linux (Ubunty Jaunty specifically) which is a plus!</p>
<p><strong>How to get the Titanium Installer to run on Ubuntu Jaunty</strong></p>
<p>Basically, I needed to run the following command:</p>
<pre><code lang="bash">sudo aptitude install libcurl4-openssl-dev</code></pre>
<p>which installs the libcurl4 with OpenSSL library and associated development bits that the Titanium Installer needs to run. The error message that pops up isn&#8217;t the most helpful for working this out, complaining about a missing CURL_OPENSSL_3 symbol or some such thing. Perhaps some better explanation would be useful in their installer so it can suggest how you might fix these things.</p>
<p>I just need to install the android SDK under Linux now (I&#8217;ve already tested things out under OSX with both the android and iPhone 3.0 SDKs and it all seems good).</p>
<p>I might try working on developing Windows apps (which I need to do as part of my course) under Linux using wine for cross-compilation. That would be awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://darkliquid.co.uk/2009/06/21/titanium-and-other-developments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disk Recovery</title>
		<link>http://darkliquid.co.uk/2009/05/24/disk-recovery/</link>
		<comments>http://darkliquid.co.uk/2009/05/24/disk-recovery/#comments</comments>
		<pubDate>Sun, 24 May 2009 11:45:31 +0000</pubDate>
		<dc:creator>Dark Liquid</dc:creator>
				<category><![CDATA[Howto/Tutorial]]></category>
		<category><![CDATA[data recovery]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[raves]]></category>

		<guid isPermaLink="false">http://darkliquid.co.uk/?p=236</guid>
		<description><![CDATA[Well, that was pretty cool, I just managed to recover the data off of a dying 30GB hard drive on my friends laptop. It was surprsingly easy, all I really needed was time. First of all I downloaded and burnt off the latest beta of SystemRescueCD. After booting from that on the laptop, I set [...]]]></description>
			<content:encoded><![CDATA[<p>Well, that was pretty cool, I just managed to recover the data off of a dying 30GB hard drive on my friends laptop. It was surprsingly easy, all I really needed was time.</p>
<p>First of all I downloaded and burnt off the latest beta of SystemRescueCD. After booting from that on the laptop, I set up the networking on it and downloaded dd_rhelp from freshmeat. I then mounted I directory on my main desktop machine via sshfs on the laptop and ran the following command:</p>
<pre><code lang="bash">
./dd_rhelp /dev/sda1 /mnt/ssh/backup.img
</code></pre>
<p>That command basically uses the dd_rescue tool on the SystemRescueCD to copy the first partition of the first hard drive into a file on my desktop computer (via the sshfs mount point at, you guessed it, /mnt/ssh). dd_rhelp is nice because it makes the process faster apparently but leaving all the bad sector, I/O error retrying till the end, instead skipping over errors when they happen in order to copy the actually working stuff first. Then it goes in and fills in the blanks. I left this running for about 16 hours after which it had all of the drive except for about 0.5MB which just would not copy. I cancelled the copying at this point and went to work on the backup image on my desktop.</p>
<p>First of all I backed up the backup image. Some of the things I might do to it could be destructive and I don&#8217;t want to wait another 16 hours to grab the data again, if the drive will even work. On the backup, I then ran the following command:</p>
<pre><code lang="bash">
fsck.vfat backup.img -rw
</code></pre>
<p>This scanned the filesystem in the backup image (in this case FAT32) for errors and asked me to choose a way to fix them. I basically told it to not mess around with anything except broken filenames and incorrect cluster sizes under the assumption that if this could actually see files to mess around with, chances are I didn&#8217;t need to play with the actual FAT table on the disk.</p>
<p>After running that and writing the changes to the image, I mounted the file into my system and copied off all the data my friends would most likely want (the entire Documents and Settings folder in this case) and burnt it all onto a DVD for them. I&#8217;ll keep the hard drive image around in case they discover there is something else they need in the next few weeks but yep, that was it. Easy.</p>
<p>I must say I was damned impressed with SystemRescueCD, it&#8217;s chocablock full of very useful tools and it&#8217;s ability to do networking and it&#8217;s provision of ssh tools makes it very nice to work with indeed. I could not have done this without it. Well, actually that&#8217;s a lie, I was prepared to burn a customised copy of DSL with all the tools I needed compiled and built into it but luckily I found SystemRescueCD before I wasted my time on that.</p>
<p>Fun stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://darkliquid.co.uk/2009/05/24/disk-recovery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Macbook Triple-Boot with OSX Leopard, Windows 7 and Ubuntu 9.04</title>
		<link>http://darkliquid.co.uk/2009/05/23/macbook-triple-boot-with-osx-leopard-windows-7-and-ubuntu-904/</link>
		<comments>http://darkliquid.co.uk/2009/05/23/macbook-triple-boot-with-osx-leopard-windows-7-and-ubuntu-904/#comments</comments>
		<pubDate>Sat, 23 May 2009 06:43:34 +0000</pubDate>
		<dc:creator>Dark Liquid</dc:creator>
				<category><![CDATA[Howto/Tutorial]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://darkliquid.co.uk/?p=230</guid>
		<description><![CDATA[Well, since my macbook decided to screw up after a failed software update under OSX (thanks Apple) I decided to rebuild my system from scratch. Since I&#8217;ve been considering doing this study-from-home Games Development course, I need Windows and I don&#8217;t too much fancy paying for it, Windows 7 is available legally for free, so [...]]]></description>
			<content:encoded><![CDATA[<p>Well, since my macbook decided to screw up after a failed software update under OSX (thanks Apple) I decided to rebuild my system from scratch.</p>
<p>Since I&#8217;ve been considering doing this study-from-home Games Development course, I need Windows and I don&#8217;t too much fancy paying for it, Windows 7 is available legally for free, so I decided to use that. Since this was a new build, I upgraded to Leopard since my old OSX install was Tiger and my old linux install was an old Intrepid install that had been dist-upgraded to Jaunty so this time I decided to use Jaunty from scratch.</p>
<p>First of all, I booted off of the OSX disks and partitioned my 120GB hard drive into two sections. The first was 30GB for OSX, the rest was free space.</p>
<p>Once OSX had finished installing, I used Disk Utility from within OSX to further partition the drive&#8217;s free space to give me a 20GB partition for Windows 7, a small 1GB partition at the end of the drive for swap and the rest was given over to Jaunty. I formatted all 3 of these partitions as FAT or MS-DOS format. I couldn&#8217;t actually format them this way from the partitioning tool s after I created the partitions with the Mac filesystem, I reformatted them with Disk Utility individually. I probably didn&#8217;t need to format them at all, but what the hell.</p>
<p>Why didn&#8217;t I just use BootCamp? It seemed annoying. The BootCamp Assistant insisted on not letting me have control over my paritions and seemed very Windows-centric, not offering any mention of Linux. It also didn&#8217;t mention Windows 7, just XP and Vista so I decided since it didn&#8217;t seem to be supported anyway that I&#8217;d go with other methods instead rather than try and force it to work how I wanted and pray it worked.</p>
<p>Next, I did all the system software updates for OSX so that they wouldn&#8217;t interfere with any later steps. I then downloaded and installed <a href="http://refit.sourceforge.net">reFIT</a>, a nice EFI bootloader that made everything else very easy.</p>
<p>After that I rebooted and installed Windows 7. Windows 7 insists on a NTFS formatted partition so I formatted my previously FAT formatted 20GB partition and let it use that. The install went quite smoothly without any issues. After each restart, the reFIT bootloader should display a Windows symbol with a harddrive overlaid on it in it&#8217;s menu. Boot from that until you are finally at a working Windows 7 desktop.</p>
<p>At this point I rebooted and tried to access my OSX install using the option on reFIT, it worked fine, much to my surprise, and it seems thatinstalling Windows no longer trashes your bootloaders.</p>
<p>After that, I booted my Jaunty install disk (I used the alternate install disk because my normal one wouldn&#8217;t even boot in the computer). Installation was easy but there are a few things to watch out for. Make sure to select custom partitioning at the partitioning stage and then select the large empty FAT partition as the main / parition for Linux. I used ext4 as my filesystem but use whatever you like. Then select the small 1GB FAT partition for swap. I am assuming you have a basic grasp of how to partition and format things with the Ubuntu installer which for the most part is fairly self-explanatory anyway. Another thing to watch out for is the bootloader installation. With my paritioning layout of EFI, OSX, Windows 7, Linux and Linux Swap, I opted to install the GRUB boot loader onto (hd0, 3) or directly into the linux partition. Once the installer finished, I checked I could still boot into each system and everything worked fine, no hassle. The reFIT menu now had three icons an Apple, Windows and Linux one, each with harddrive overlays and they all worked fine.</p>
<p>At this point you have a working triple-boot system. However, the linux install doesn&#8217;t perform very well out of the box. I followed the very good instructions to improve my Linux experience on my macbook here: <a href="https://help.ubuntu.com/community/MacBook2-1/Jaunty">https://help.ubuntu.com/community/MacBook2-1/Jaunty</a></p>
<p><strong>UPDATE!!!</strong></p>
<p>I was having quite a few driver issues and things such as sound wouldn&#8217;t work. However thanks to the advice of Jonas Wisser I decided to download the BootCamp drivers from the Snow Leopard prerelease. These worked a treat and basically fixed everything as far as I can tell so far.</p>
<p>Some words of warning:</p>
<ul>
<li>My original system got trashed because an OSX update died, I&#8217;m guessing it tried to update the EFI firmware which I had replaced with reFIT. Having reFIT installed could make your system unbootable after you do an OSX update so I&#8217;d recommend keeping the reFIT installer around so you can reinstall it after doing updates before rebooting, just in case.</li>
<li>Windows 7 is a free release candidate until March 2010 where it will apparently degrade until you either pay for the full version which should then be released or it stops working all together.</li>
<li>Some stuff in Linux doesn&#8217;t work perfectly on the Macbook, such as the iSight having a green capture issue. This is discussed more on the page linked to previously.</li>
</ul>
<p><strong>Conclusions</strong></p>
<p>So far I&#8217;m very pleased with my new install. Nothing has exploded yet, no weird errors, the installation was flawless. Basically nothing has really gone wrong or broken. I&#8217;m not much of a fan of Windows and I&#8217;ve barely even touched my Windows 7 install but I&#8217;m quite impressed by it, it seems pretty stable so far and it&#8217;s not done any of the things that normally annoy me immensely about Windows yet, so for the time being I think Microsoft might have finally released a decent version of Windows. I wont be switching any time soon, or ever, but so far I can at least tip my hat to Microsoft on what so far appears to be a job well done. I haven&#8217;t played much with Leopard yet, so I can&#8217;t really say how I feel about it other than it&#8217;s not very much different to Tiger so far, except with a little more polish in some areas. Jaunty I had running on here before and so far it&#8217;s working nicely. Just need to fully test out all the changes I made as recommended via that link I posted earlier to see if I can make it even better.</p>
]]></content:encoded>
			<wfw:commentRss>http://darkliquid.co.uk/2009/05/23/macbook-triple-boot-with-osx-leopard-windows-7-and-ubuntu-904/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
	</channel>
</rss>
