<?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>Sirupsen&#039;s Blog</title>
	<atom:link href="http://blog.sirupsen.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sirupsen.dk</link>
	<description>Because everything can be done simpler</description>
	<lastBuildDate>Tue, 11 May 2010 09:55:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>A simple Imgur Bash screenshot utility</title>
		<link>http://blog.sirupsen.dk/script-fu/an-incredibly-simple-imgur-bash-screenshot-utility/</link>
		<comments>http://blog.sirupsen.dk/script-fu/an-incredibly-simple-imgur-bash-screenshot-utility/#comments</comments>
		<pubDate>Mon, 10 May 2010 11:57:40 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Script-fu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[screenshot]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=327</guid>
		<description><![CDATA[I tend to use screenshots a lot when I do instant messaging, since they tend to help explaining things much better &#8211; and faster than raw text in many situations. It&#8217;s very rare I need to actually edit the screenshot, and in these rare occasions, It doesn&#8217;t bother me to fire up something like Pinta [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fscript-fu%2Fan-incredibly-simple-imgur-bash-screenshot-utility%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fscript-fu%2Fan-incredibly-simple-imgur-bash-screenshot-utility%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I tend to use screenshots a lot when I do instant messaging, since they tend to help explaining things much better &#8211; and faster than raw text in many situations. It&#8217;s very rare I need to actually edit the screenshot, and in these rare occasions, It doesn&#8217;t bother me to fire up something like <a href="http://pinta-project.com/">Pinta</a> or <a href="http://www.gimp.org/">Gimp</a> &#8211; to make these small changes.</p>
<p><span id="more-327"></span></p>
<p>Just scroll down to get right to the script.</p>
<p>I just needed this functionality:</p>
<ol>
<li>Activate script</li>
<li>Select region</li>
<li>Put direct Imgur link to screenshot in clipboard</li>
</ol>
<p>The part with selecting, is quite easy with scrot:</p>
<pre>scrot -s</pre>
<p>Does exactly this, uploading to Imgur via Bash is also quite simple:</p>
<pre>curl -s -F "image=@$1" -F "key=api-key" <a href="http://imgur.com/api/upload.xml">http://imgur.com/api/upload.xml</a></pre>
<p>This returns some XML, including the direct link to the image. I am by no means a ninja with regex, so my method of getting the direct link URL is quite possibly far from the most effective (please comment if you are aware of a better/faster method of adding this functionality)</p>
<pre>grep -E -o "&lt;original_image&gt;(.)*&lt;/original_image&gt;" | grep -E -o "<a href="http://i.imgur.com/[^">http://i.imgur.com/[^</a>&lt;]*"</pre>
<p>Putting it into the clipboard is quite easy with <strong>Xclip</strong>:</p>
<pre>xclip -selection c</pre>
<p>And then I wanted it to notify me whenever the upload was performed, and the direct link was in my clipboard, quite easy with <strong>libnotify</strong>:</p>
<pre>notify-send "Done"</pre>
<p>And this all ended with the following script (yes, I know it can be one line and everything, but this just seemed like a more elegant solution, also I am quite aware there&#8217;s probably a much better way of doing this, if you can come up with a better solution &#8211; please put it in the comments!):</p>
<pre>function uploadImage {
  curl -s -F "image=@$1" -F "key=486690f872c678126a2c09a9e196ce1b" <a href="http://imgur.com/api/upload.xml">http://imgur.com/api/upload.xml</a> | grep -E -o "&lt;original_image&gt;(.)*&lt;/original_image&gt;" | grep -E -o "<a href="http://i.imgur.com/[^">http://i.imgur.com/[^</a>&lt;]*"
}
scrot -s "shot.png"
uploadImage "shot.png" | xclip -selection c &amp;&amp; rm "shot.png"
notify-send "Done"</pre>
<p>Hope this script can be as useful for you, as it has been to me.</p>
<p>You should follow me on twitter <a href="http://twitter.com/Sirupsen">here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/script-fu/an-incredibly-simple-imgur-bash-screenshot-utility/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What I wish a Ruby programmer had told me one year ago..</title>
		<link>http://blog.sirupsen.dk/me/what-i-wish-a-ruby-programmer-had-told-me-one-year-ago/</link>
		<comments>http://blog.sirupsen.dk/me/what-i-wish-a-ruby-programmer-had-told-me-one-year-ago/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 08:43:05 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=308</guid>
		<description><![CDATA[Warning: Biased content follows. Scroll down if you just want to skip to my wise words. One year ago, I started coding for real again. I dumped wasting times on stupid games and so on. I like building websites, so I started by going back to the roots. HTML &#38; CSS which I had coded [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fme%2Fwhat-i-wish-a-ruby-programmer-had-told-me-one-year-ago%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fme%2Fwhat-i-wish-a-ruby-programmer-had-told-me-one-year-ago%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><strong>Warning:</strong> Biased content follows.</p>
<p>Scroll down if you just want to skip to my wise words.</p>
<p>One year ago, I started coding for real again. I dumped wasting times on stupid games and so on. I like building websites, so I started by going back to the roots. HTML &amp; CSS which I had coded when I was about 10, and it didn&#8217;t take me long before I had moved from tables to div tags and all. I learned myself to hand-code it, and not rely on software like Dreamweaver. Resulting in better, more compact and valid HTML. I had played around with PHP when I was about 11, so I decided to build some stuff in it again.</p>
<p><span id="more-308"></span></p>
<p>I should never have done that, I have realized. I used about 4 months in PHP, picking up  bad habits. At some point, I found myself reaching points where I saw PHP solutions plain stupid. I didn&#8217;t have experience with any other languages, but I knew there had to be better ways. So I decided to dive into Python, and later look at the Django web framework. So I did.</p>
<p>After a few days playing around with Python, I felt okay with it. I didn&#8217;t love Python, but it was fairly simple, and from the simple Django examples I felt confident I was ready to proceed and expand my literacy in Python via Django. After following the basic tutorials, I felt Django was already superior to PHP.</p>
<p>I had heard about this evil language called Ruby and some framework called Rails, I had not considered it though because of three (stupid) reasons:</p>
<ul>
<li>Highest ratio of smug fanboys</li>
<li>End-statements</li>
<li>Ruby had become popular due to Rails, not the other way around as it is with Django</li>
</ul>
<p>So a Saturday night, I turned off the light, locked the door and sealed the windows. It was time to check out this Japanese creation. The fanboys all over the web seemed to recommend this fabulous book called <a href="http://en.wikipedia.org/wiki/Why's_(poignant)_Guide_to_Ruby">Why&#8217;s (poignant) guide to Ruby</a>. I installed Ruby, and dove into the book.</p>
<p>A few hours later, I had forgotten everything about Python. Stupid language. Ruby was where it was at, and I instantly started recommending it to all my code-buddies. It&#8217;s such an awesome language, why not spread the joy? They said I was a fanboy, and told me to gtfo. And I quickly realized what had happened.</p>
<ul>
<li>Ruby is evil</li>
</ul>
<p>Ruby is indeed evil. So evil. Extremely evil. But why so evil? Because it&#8217;s so <em>beautiful</em>. The syntax is so elegant, everything are objects. Everything makes sense. The Ruby-way of doing things is so sexy.</p>
<p>I quickly headed over to #ruby and asked them what I should do to practise my all-so-awesome Ruby skills, and some guy recommended me coding a todo-app. It seemed it was the new semi-advanced-but-no-so-advanced hello world. So I did, and here&#8217;s the extremely awesome output (be prepared, it&#8217;s extremely bad code and you should <strong>NEVER</strong> do something like this in Ruby):</p>
<p><script src="http://gist.github.com/255066.js"></script> Proudly I showed it to the guy who recommended me to create a Todo-app. &#8220;Look at this! Ruby is so narwhal!&#8221; It took him a while to reply. It would&#8217;ve taken me a while to reply too if somebody showed me such code. It looks like some Bash code, in an object oriented language. Woah.  So this guy, he was very helpful and told me he&#8217;d make a skeleton for the app. and make me fill in the holes/methods, it was something like this:  <script src="http://gist.github.com/382000.js"></script></p>
<p>So I did. It took a while to adapt from the bad PHP-style, to the Ruby-style. I ended up with <a href="https://gist.github.com/6656de5cc00df7802c5e">this</a>. And then I added <a href="https://gist.github.com/94bc0e64442de04deb0b">an interface.</a> And then <a href="http://gist.github.com/255203">meta-programming.</a> And then I was in love.</p>
<p>So the title of this post is &#8220;What I wish a Ruby programmer had told me one year ago..&#8221;, and that&#8217;s quite an intro. Since what I wish a Ruby programmer had told me is not much, but could&#8217;ve saved me 4 months in company with PHP.</p>
<p>Here&#8217;s what I&#8217;ll tell anyone asking me how they should get into programming:</p>
<p>&#8220;First, learn Ruby (buy a book). Play around, create a Todo-app. Create simple programs to handle system tasks for you. But always remember to use classes, and separate the interface from the functionality. In the end this&#8217;ll be pain, you&#8217;ll always think about making it appear Rubyish, but at some point &#8211; it becomes natural. And when it has become natural, you go <a href="http://blog.sirupsen.dk/guides/create-your-first-ruby-gem-and-release-it-to-gemcutter/">create a Gem</a>. If you create a big Gem, with much functionality &#8211; split it into more Gems, and make it require those. Or use other peoples Gems. If you want to move on with developing web applications, start out simple. Check out a lightweight framework like <a href="http://www.sinatrarb.com/">Sinatra</a>, it&#8217;s cool and very fun to work with. Move on to Rails if you want, it takes longer to learn, but it is much faster to develop in.&#8221;</p>
<p>And perhaps point them towards Linux, if they are up for it:</p>
<p>&#8220;<strong>I</strong> do not believe Windows is the best development platform in the world for Ruby. I recommend you to try out Linux (or OS X, if you&#8217;ve got the money for it). Start with a simple distribution, like <a href="http://www.ubuntu.com/">Ubuntu</a>. And then I recommend something like <a href="http://www.archlinux.org/">Arch Linux</a> whenever you feel like you are ready for something more advanced, assuming you want to learn more about how Linux works!&#8221;</p>
<p>You should follow me on Twitter <a href="http://twitter.com/Sirupsen">here</a>.</p>
<p><strong>Note:</strong> I&#8217;m biased. And I know it. Ruby is not a language for everyone, and PHP is not a bad language &#8211; it&#8217;s just not for me. Neither is Python a bad language &#8211; it&#8217;s just not for me. Windows is not a bad operating system &#8211; It&#8217;s just not for me. I advise you to try different languages/operating systems, and eventually find the one you feel at home in.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/me/what-i-wish-a-ruby-programmer-had-told-me-one-year-ago/feed/</wfw:commentRss>
		<slash:comments>62</slash:comments>
		</item>
		<item>
		<title>Create your first Ruby Gem and release it to Gemcutter</title>
		<link>http://blog.sirupsen.dk/guides/create-your-first-ruby-gem-and-release-it-to-gemcutter/</link>
		<comments>http://blog.sirupsen.dk/guides/create-your-first-ruby-gem-and-release-it-to-gemcutter/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 12:12:14 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[jeweler]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=282</guid>
		<description><![CDATA[A few days ago I was set off to create my first RubyGem. There are many resources on how to do this, but it took me a good while to gather all the information I figured I&#8217;d need for my application, so I&#8217;ve decided to gather my bit of knowledge in this article. This article&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fcreate-your-first-ruby-gem-and-release-it-to-gemcutter%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fcreate-your-first-ruby-gem-and-release-it-to-gemcutter%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>A few days ago I was set off to create my first RubyGem. There are many resources on how to do this, but it took me a good while to gather all the information I figured I&#8217;d need for my application, so I&#8217;ve decided to gather my bit of knowledge in this article.</p>
<p>This article&#8217;s goal is kick start the creation of your first Gem. To make this experience more enjoyable, I&#8217;ve chosen to use a gem called <a href="http://github.com/technicalpickles/jeweler">Jeweler</a>.</p>
<p><strong>Note:</strong> I am by <strong>no</strong> means a <em>&#8220;ruby-pro&#8221;</em>. I have only created a single Gem, but I thought this article could be helpful to a lot of people, and thus I wrote it. If you have any corrections, questions, or suggestions please either email me at sirup@sirupsen.dk or comment below.</p>
<p><span id="more-282"></span></p>
<h2>Preparing</h2>
<p>.. for world domination!</p>
<p>I assume you already know a bit of <a href="http://www.ruby-lang.org/en/">Ruby</a>, that you know what <a href="http://rubygems.org/">RubyGems</a> is, and you have already downloaded a few gems, and used some of them in your work. Now your are simply seeking to create your own Gems. You are indeed in for a fun time, coding gems is lots of fun!</p>
<p>Before we can begin, install the <a href="http://github.com/technicalpickles/jeweler">Jeweler</a> gem via RubyGems:</p>
<pre>$ gem install jeweler</pre>
<p>Jeweler is a tool to create the basic skeleton for your Gem, as well as managing the gem.</p>
<h2>Creating your gem</h2>
<p>.. with your mighty companion <strong>Jeweler</strong></p>
<p>Once Jeweler is installed, you want to create your Gem skeleton. I&#8217;m going to create a simple Hello World gem for the sake of example, and later on explain a bit about how you could manage your own Gem (at the very least my 2 cents about how a gem should be done).</p>
<pre>$ jeweler helloworld # Should be all small letters</pre>
<pre>	create	.gitignore
	create	Rakefile
	create	LICENSE
	create	README.rdoc
	create	.document
	create	lib
	create	lib/helloworld.rb
	create	test
	create	test/helper.rb
	create	test/test_helloworld.rb
Jeweler has prepared your gem in helloworld</pre>
<p>Now your gem skeleton is ready! Let&#8217;s get in there and check it out.</p>
<pre>$ cd helloworld
$ ls
<span style="color: #008000;"><strong>lib/</strong></span>  LICENSE  Rakefile  README.rdoc  <span style="color: #008000;"><strong>test/</strong></span></pre>
<p>This structure might look familiar to you. (Assuming you are like me and have already stalked a few Gems&#8217; sources over at <a href="https://github.com/">Github</a>) Now I&#8217;ll attempt to explain what these files and folders are.</p>
<h3>lib/</h3>
<p>This is where your application lives, this is where you&#8217;ll probably spend the most of your time working on your gem. It is common to have a folder inside this folder called whatever your gem is called (in this example, that would be <strong>helloworld</strong>), in which your app. is split into a few files, for organizations sake. And then have<strong> lib/&lt;gem name&gt;.rb </strong>require these files (as <strong>/lib/&lt;gem name&gt;.rb </strong>is what is required by Ruby whenever somebody requires your gem in their own project).</p>
<h4><strong>My 2 cents on organizing stuff in here <em>(skippable)</em></strong></h4>
<p>As said, I am in no way an expert. But this is how I would do it.</p>
<p>My first gem is a gem for a file storage service (<a href="http://anyhub.net/">Anyhub</a>) which should do two things:</p>
<ul>
<li>Create a library for easy Ruby interaction with Anyhub</li>
<li>Contain a small CLI for Anyhub based on it&#8217;s own library</li>
</ul>
<p>So I figured I would have a module, containing a few classes:</p>
<ul>
<li>Upload (for uploading files to Anyhub)</li>
<li>Account (to manage ones Anyhub account)</li>
<li>Runner (to manage the CLI)</li>
</ul>
<p>The Upload class would simply be able to use the account class, to check if an account was configured in a config file (f.e. <em>account_config.yaml</em>). If a config file was present, it would upload the file(s) specified in arguments to the script. Otherwise, it would return an error. Runner (the CLI) would respond to this error, allowing the user to type in his details so they could be used for the ongoing upload, as well as any following uploads (by saving the details to <em>account_config.yaml </em>via the Account class).</p>
<p>Now, I had made a perfectly good module. The only thing it needed was arguments send to Runner, which would activate it all. By doing a little research I figured if I created the directory <strong>bin/ </strong>and threw in a file here, this file would automatically be inserted into the installers own bin (f.e. <strong>/usr/bin</strong> on Linux if installed for all users). So I created the <strong>bin/</strong> directory, and a file in here called <strong><a href="http://github.com/Sirupsen/Anyhub/blob/master/bin/anyhub">anyhub</a></strong><strong> </strong>with a Ruby shebang at the top. This file simply instanced the Runner class with ARGV.</p>
<p>Now this is just my little not-so-fancy gem theory. It&#8217;s not exactly done this way (yet) because Anyhub didn&#8217;t have an API at first &#8211; so I created the first version without the Account class, so it might not be exactly like this at the Github repo. just yet.</p>
<p><a href="http://github.com/Sirupsen/Anyhub">Anyhub gem @ Github.</a></p>
<h3>LICENSE</h3>
<p>Simply a file which contains the license for your project. By default MIT with Jeweler.</p>
<h3>Rakefile</h3>
<p>Rake configuration for your project. It is here you can define rake tasks, and configure your project (in terms of the name of it, dependencies, description and similar).</p>
<h3>Readme.rdoc</h3>
<p>The Readme file for your project. If you create a Github repo. it&#8217;ll show up there. It is also &#8220;the index&#8221; for your Gems&#8217; documentation.</p>
<h3>test/</h3>
<p>It is here you create your tests.</p>
<h2>Configuring your Gem</h2>
<p>Remember a few lines ago, I told you how you could configure your Gem via <strong>Rakefile</strong>? As you might have already guessed, we&#8217;re going to open that very file now, to configure our example Gem.</p>
<p>After <strong>rubygems</strong> and <strong>rake </strong>has been required by <strong>Rakefile </strong>we see some fancy code, and then something which looks like some configuration. This is indeed where we configure our example Gem. You mostly only need to configure the summary and description the first time, I did it like this:</p>
<pre>begin
  require 'jeweler'
  Jeweler::Tasks.new do |gem|
    gem.name = "helloworld"
    gem.summary = %Q{I'm a helloworld gem! I like to hello the world.}
    gem.description = %Q{This is a fancy little test gem.}
    gem.email = "sirup@sirupsen.dk"
    gem.homepage = "http://github.com/Sirupsen/helloworld"
    gem.authors = ["Sirupsen"]
    gem.add_development_dependency "thoughtbot-shoulda", "&gt;= 0"
    # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/  20 for additional settings
  end
  Jeweler::GemcutterTasks.new
rescue LoadError
  puts "Jeweler (or a dependency) not available. Install it with: gem install   jeweler"
end</pre>
<h3>A little something more on configuring</h3>
<p>.. which can be skipped.</p>
<p>If your gem has any dependencies, you can add them here. Dependencies in this context mean<em> &#8220;gems which my gem depends on&#8221;</em>. You <strong>should</strong> add them, because if you do they are automatically installed along with your Gem whenever somebody tries to install your Gem. If you don&#8217;t, they&#8217;ll just get a good ton of errors when they try using your gem.</p>
<p>Do add dependencies, simply add this to your <strong>Rakefile</strong>:</p>
<pre>gem.add_dependency "gem", "version"</pre>
<p>For example, in my gem I used the <strong>Curb </strong>Gem, and therefore I added this to my <strong>Rakefile</strong>:</p>
<pre>gem.add_dependency "curb", "&gt;= 0"</pre>
<p>(<strong>&gt;= 0</strong> just means &#8220;I don&#8217;t care about which version of the Gem it is, as long as it&#8217;s there&#8221;, mostly because I couldn&#8217;t find much version-specific documentation Curb, otherwise I would have done this properly.)</p>
<h2>Let&#8217;s add some sample code</h2>
<p>Now it&#8217;s time to add some code to our <strong>helloworld </strong>Gem. I simply open <strong>/lib/helloworld.rb</strong>, and add these few lines of code:</p>
<pre>module HelloWorld
  def self.do
    "Hello World from the all mighty helloworld Gem!"
  end
end</pre>
<p>So <strong>HelloWorld.do</strong> would return the string <em>&#8220;Hello World from the all mighty helloworld Gem!&#8221;. </em>Great, so far, so good.</p>
<h2>Version</h2>
<p>In order to finish our Gem, we need a version file. Now because Jeweler is so awesome, we don&#8217;t even need to use our editor to do this, simply execute the following command:</p>
<pre>$ rake version:write</pre>
<p>And the VERSION file is created. It&#8217;s not <em>that</em> fancy though.</p>
<pre>$ cat VERSION
0.0.0</pre>
<p>But that seems correct. This is our first Gem build, so of course, the version is 0.0.0 as of now!</p>
<h2>Install it!</h2>
<p>Now you can install the Gem. It&#8217;s very easy:</p>
<pre>$ rake install
Password:
(in /home/sirup/Code/Ruby/helloworld)
Generated: helloworld.gemspec
helloworld.gemspec is valid.
WARNING:  no rubyforge_project specified
  Successfully built RubyGem
  Name: helloworld
  Version: 0.0.0
  File: helloworld-0.0.0.gem
Executing "gem install ./pkg/helloworld-0.0.0.gem":
gem install ./pkg/helloworld-0.0.0.gem
Successfully installed helloworld-0.0.0
1 gem installed
Installing ri documentation for helloworld-0.0.0...
Updating class cache with 1983 classes...
Installing RDoc documentation for helloworld-0.0.0...</pre>
<h2>Moment of truth</h2>
<pre>irb --simple-prompt
&gt;&gt; require 'helloworld'
=&gt; true
&gt;&gt; HelloWorld.do
=&gt; "Hello World from the all mighty helloworld Gem!"</pre>
<p>(<strong>Note</strong>: If you are <strong>not</strong> using Ruby 1.9, you might need to <em>require &#8216;rubygems&#8217;</em> before requiring <strong>helloworld</strong>)</p>
<p>Awesome, it works. I hope this has helped you towards creating your first gem. You are welcome to leave a comment, or contact me if you run into any trouble.</p>
<p>You should follow me on Twitter <a href="http://twitter.com/Sirupsen">here</a>.</p>
<h2>Further information</h2>
<p>You&#8217;ll find it all if you visit <a href="http://github.com/technicalpickles/jeweler">Jeweler at Github</a>. Below is for quick reference.</p>
<h3>Github</h3>
<p>I advice you to commit all your code, and push it to Github. Makes it easy for other people to view the source, post issues, and participate in your project.</p>
<p>Github because it&#8217;s sort of the standard for Ruby open source projects.</p>
<h3>Releasing Gem at Gemcutter</h3>
<p>If you feel like sharing your Gem to the world (and you probably do). Register an account at <a href="http://rubygems.org/">Gemcutter</a>.</p>
<p>And now you are ready to release your Gem. Simply run:</p>
<pre>$  rake gemcutter:release</pre>
<p>To release your gem. (You can also release it at RubyForge instead if you wish so, see <a href="http://github.com/technicalpickles/jeweler/blob/master/README.markdown">the Jeweler readme</a>) You might be asked to sign in to your account, simply do so whenever prompted.</p>
<h3>Workflow</h3>
<p>.. taken directly from the <a href="http://wiki.github.com/technicalpickles/jeweler/workflow">Jeweler Wiki.</a></p>
<ol>
<li><code>gem install jeweler</code></li>
<li><a href="http://wiki.github.com/technicalpickles/jeweler/create-a-new-project">Create a new project</a> and customize it, or <a href="http://wiki.github.com/technicalpickles/jeweler/configure-an-existing-project">configure an existing project</a></li>
<li>Write good code, and commit it</li>
<li>Bump the version with one of the rake tasks:
<ul>
<li><code>rake version:bump:patch</code> 1.5.3 → 1.5.4</li>
<li><code>rake version:bump:minor</code> 1.5.3 → 1.6.0</li>
<li><code>rake version:bump:major</code> 1.5.3 → 2.0.0</li>
<li><code>rake version:write MAJOR=2 MINOR=3 PATCH=6</code> 1.5.3 → 2.3.6</li>
</ul>
</li>
<li>Release it
<ul>
<li><code>rake release</code></li>
<li>Optionally release it to <a href="http://wiki.github.com/technicalpickles/jeweler/rubyforge">Rubyforge</a>: <code>rake rubyforge:release</code></li>
<li>Optionally release it to <a href="http://wiki.github.com/technicalpickles/jeweler/gemcutter">Gemcutter</a>: <code>rake gemcutter:release</code></li>
</ul>
</li>
<li>Go to #2</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/guides/create-your-first-ruby-gem-and-release-it-to-gemcutter/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Earphone controls stopped working with iPhone/iPod Touch</title>
		<link>http://blog.sirupsen.dk/guides/earphone-controls-stopped-working-with-iphoneipod-touch/</link>
		<comments>http://blog.sirupsen.dk/guides/earphone-controls-stopped-working-with-iphoneipod-touch/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 12:10:15 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Guides]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=280</guid>
		<description><![CDATA[A few weeks ago, I ran into some trouble with my earphone controls for my iPhone. They suddenly stopped working, meaning I could not go to the next song, or pause directly from the controls on the wire, as I was used to doing this, it frustrated me a lot. Luckily, the fix was extremely [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fearphone-controls-stopped-working-with-iphoneipod-touch%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fearphone-controls-stopped-working-with-iphoneipod-touch%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>A few weeks ago, I ran into some trouble with my earphone controls for my iPhone. They suddenly stopped working, meaning I could not go to the next song, or pause directly from the controls on the wire, as I was used to doing this, it frustrated me a lot. Luckily, the fix was extremely easy.</p>
<p>The reason that it had stopped working, is that I carry my iPhone a lot in my pocket. And thus lint sneaks into the jack. Apparently, if there&#8217;s too much lint in it, the controls will stop working, while sound still works. So basically just remove the lint from the hole with a thin item, like a needle or a toothpick, and try to carefully get the lint out of the hole. Be very careful as you do this.</p>
<p>Do this at your own risk.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/guides/earphone-controls-stopped-working-with-iphoneipod-touch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One terminal, just one</title>
		<link>http://blog.sirupsen.dk/script-fu/one-terminal-just-one/</link>
		<comments>http://blog.sirupsen.dk/script-fu/one-terminal-just-one/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 16:53:17 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Script-fu]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=274</guid>
		<description><![CDATA[Until not-so-long ago, I always had a million terminals open at the same time. I have this neat keyboard-shortcut (Alt-T) which opens a new terminal. That&#8217;s nice and all, but the problem is, that I can&#8217;t be arsed to alt-tab to my old terminals, leaving a million terminals open, making alt-tabbing between other applications a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fscript-fu%2Fone-terminal-just-one%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fscript-fu%2Fone-terminal-just-one%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Until not-so-long ago, I always had a million terminals open at the same time. I have this neat keyboard-shortcut (Alt-T) which opens a new terminal. That&#8217;s nice and all, but the problem is, that I can&#8217;t be arsed to alt-tab to my old terminals, leaving a million terminals open, making alt-tabbing between other applications a pain. And I rely quite a bit on Alt-tab, I don&#8217;t have any task bar, since I&#8217;d rather just alt-tab between stuff than clicking on a task bar (which also takes up precious screen space).</p>
<p><span id="more-274"></span></p>
<p>So yes, one day I realised I really had this problem. So I scaled it down, my goal was to: <em>Make a script that when launched, looks for terminals.</em> <em>If any terminal is found, this terminal should appear in front of all other windows, instead of launching a new terminal. If, however, no terminals are present, a new one should be launched. </em>That&#8217;s when I realised: <strong>&#8220;How-the-bob am I going to do this?&#8221;</strong> &#8211; Google to the rescue, and I eventually scaled down each problem in the application, and found a neat little application called <strong>wmctrl </strong>which (apparently) handles Windows. And by looking a bit at this application, I came up with this script, which handles the problem nicely:</p>
<p><script src="http://gist.github.com/341179.js?file=launch-sakura"></script></p>
<p>Just change the variables to reflect your environment, it should be rather obvious what to change. So yeah, you just c/p this script to a <strong>whatever.sh </strong>file, and put it in your <strong>bin </strong>and launch your terminal via this script from now on. It&#8217;s also in my <a href="http://github.com/Sirupsen/Kittybin">kittybin</a>, I might cover some of the other scripts from there in further blog posts. :)</p>
<p>And there we go. <strong>Problem solved.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/script-fu/one-terminal-just-one/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>My experience with Arch Linux</title>
		<link>http://blog.sirupsen.dk/me/my-experience-with-arch-linux/</link>
		<comments>http://blog.sirupsen.dk/me/my-experience-with-arch-linux/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 16:24:25 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[arch]]></category>
		<category><![CDATA[experience]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=270</guid>
		<description><![CDATA[After about 8 months with Ubuntu, I decided it was time for change. I had for a while wanted to switch to some other distribution, not really because I did not like Ubuntu, more because I wanted to learn more about Linux, and try something new. And I felt Ubuntu limited me in this matter. [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fme%2Fmy-experience-with-arch-linux%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fme%2Fmy-experience-with-arch-linux%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>After about 8 months with <a href="http://www.ubuntu.com/">Ubuntu</a>, I decided it was time for change. I had for a while wanted to switch to some other distribution, not really because I did not like Ubuntu, more because I wanted to learn more about Linux, and try something new. And I felt Ubuntu limited me in this matter. Furthermore, I wanted to have a system which I did not feel I had to reinstall whenever new major updates came out, I wanted a system I could improve over time. I wanted a system where I could switch desktop environment/window manager quickly, and without googling myself on how to then remove all the old, now useless, packages.</p>
<p><span id="more-270"></span></p>
<p>I quickly found a distro. which seemed to fit my requirements, <a href="http://www.archlinux.org/">Arch Linux</a>. Arch Linux is lightweight, and simple. I found a quote on the Wiki, which describes it quite good. &#8220;Linux, with a nice package manager.&#8221; I want to add something to that though: &#8220;Linux, with an awesome package manager (Pacman), and a kick-ass Wiki.&#8221; That Wiki seriously provides the best information on everything you&#8217;ll ever need to know &#8211; I have yet to run into a problem which is not described here.</p>
<p>So yeah, you basically start with bare-bones Linux, which can boot into a CLI, has the basic stuff like Vi, grep, and so on you&#8217;d install anyway. From there, you simply start building your system with the <a href="http://wiki.archlinux.org/index.php/Beginners'_Guide">Arch Linux beginner&#8217;s guide</a> (which is extremely good). You install Vim, Xorg, Drivers, and so on. As it was my first (and hopefully only on this computer) install, I took good time to do each step, to understand what I was installing, and why I was installing it. Once I had Xorg up (g, I already felt like I had learned a lot more about how Linux works at a lower level. I was already starting to really like Arch Linux.</p>
<p>At some point when Xorg was set up, I of course needed a <a href="http://wiki.archlinux.org/index.php/Window_manager">Window Manager</a>. I looked a lot around. There are hundreds of different Window Managers, tiling, not-tiling, and these big desktop environments (Gnome, KDE). I had already decided I didn&#8217;t want to go for a desktop environment, since then I&#8217;d have a shit load of gui-config tools, and not learn exactly where configuration files are located (<em>oh how I search the knowledge</em>). I quickly figured out that <a href="http://openbox.org/wiki/Main_Page">Openbox</a> was very popular on the Arch Linux forum. So I decided to install it, and found the neat <a href="http://rent0n86.deviantart.com/art/Arkid-148937983">Arkid theme</a>, somebody had posted it in a screenshot thread on the Arch Linux forums.</p>
<p>And then it was just a matter of setting up all the stuff I usually set up when I install Ubuntu: Vim, Chrome, Pidgin, Music player, Dropbox, and so on. And Pacman (the Arch Linux package manager) made this a pleasing experience. I ran into a few packages which I could not install with Pacman however. But, I quickly figured there was something called <a href="http://aur.archlinux.org/">AUR</a> (Arch User Repository), in which I have yet to not find a package, meaning I never have to compile anything. And of course, my fellow Arch Linux users have also provided me with tools which allows easy installation from AUR. I found a tool called <a href="http://bbs.archlinux.org/viewtopic.php?id=91860">Clyde</a>, which works nicely for me. Basically just a Pacman clone which can also install from <a href="http://bbs.archlinux.org/viewtopic.php?id=91860">AUR</a> as well.</p>
<p>And now, I&#8217;ve been running this system for a few weeks, and I feel at home. I love it really. If you are looking to try something new, and already got some Linux knowledge, then you should defiantly go and try Arch Linux! Oh yeah, and should you run into issues the people at #archlinux @ freenode are really nice, and helpful.</p>
<p>Here&#8217;s a screenshot of Archbox, because everyone loves screenshots.</p>
<p><a href="http://img202.imageshack.us/img202/8011/201004050121043200x1080.png"><img class="alignnone" title="Archbox Screenshot" src="http://img202.imageshack.us/img202/8011/201004050121043200x1080.png" alt="" width="1152" height="389" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/me/my-experience-with-arch-linux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>3 months of silence</title>
		<link>http://blog.sirupsen.dk/me/3-months-of-silence/</link>
		<comments>http://blog.sirupsen.dk/me/3-months-of-silence/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 18:37:32 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Me]]></category>
		<category><![CDATA[flimpl]]></category>
		<category><![CDATA[flying cat]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[turbsen]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=259</guid>
		<description><![CDATA[3 months have passed since I made my last post. Not really because I haven&#8217;t had time, not really because I haven&#8217;t wanted to either. I just felt like I had nothing to write about, while I in fact had a lot to write about. So, what have I been doing? First of all, I [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fme%2F3-months-of-silence%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fme%2F3-months-of-silence%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>3 months have passed since I made my last post. Not really because I haven&#8217;t had time, not really because I haven&#8217;t wanted to either. I just felt like I had nothing to write about, while I in fact had a lot to write about.</p>
<p>So, what have I been doing? First of all, I have been jumping around in languages. About 2 months ago, I felt like working with <a href="http://github.com/Sirupsen/Flying-Cat">Flimpl</a> was getting boring, very boring. I decided I needed to try something new, the last new language I had fun with was Javascript, using jQuery. First it was Python, I wrote some stuff in it, and it was great fun to develop simple command-line applications, but I didn&#8217;t quite feel it, while Python is a great language, I decided I wanted to try alternatives before settling. I had heard a lot about that evil thing called Ruby, but I had feared to touch it. Why? Because of all those smug fanboys, the end syntax &#8211; and o&#8217; so much to hate it for. I didn&#8217;t know what I hated though, so I decided to turn off the light, pull down the blinds, lock the door. And dive into it, without anyone knowing.</p>
<p><span id="more-259"></span></p>
<p>And fuck, yes. Ruby is me. Ruby has always been me. I am Ruby.</p>
<p>But no, I can&#8217;t be. I&#8217;ve always hated the fanboy I&#8217;m turning into. But really, I love Ruby. Ruby is an awesome language for me; in PHP I always searched for proper object-oriented programming, neat tricks and sex. But none of these were present, for me. I&#8217;ve always tried to do PHP more complicated than it is, because I liked that coding style better. In Ruby I can do the coding style I have always dreamed about, but never know what was.</p>
<p>So for christmas it was all Ruby books, and interface books. O&#8217; interface books. Interfaces. Oh yes, why interfaces? While I&#8217;m a developer, and we developers, are known for our ugly interfaces and designs, I actually enjoy designing interfaces, not designing designs, but designing interfaces. When I make a web applications, I admit, I don&#8217;t like the designing part, but it turns out to be fun drawing a mockup, and hackin&#8217; some HTML together. The interface part, however, is what I find the most fascinating. How people look at a page, what they look at first, how you can drag peoples eyes to that sign up button of yours &#8211; that&#8217;s fun.</p>
<p>I got two books on the subject, I almost finished one of them. I&#8217;ve already done some interface reviews for fun, and enjoyed it, to my surprise! One for <a href="http://www.charliesomerville.com/">Charlie Sommerville</a>, on his <a href="http://fuzzfriends.com.au/">FuzzFriend</a>s site. And a small one for <a href="http://www.projectbubble.com/">ProjectBubble</a>, however, I&#8217;ll poke the developer over there when he has time again, so I can help make that cool project management tool even better!</p>
<p>So, what about now? <a href="http://turbsen.info/">Charlie and I </a>came up with this crazy idea. &#8220;Let&#8217;s make an OS!&#8221; While I know it&#8217;s hardcore to develop so low-level, it&#8217;s turning out to be great fun, and a damn great experience. The codename for the project is <a href="http://github.com/Sirupsen/Flying-Cat">Flying Cat</a>.</p>
<p>I&#8217;m progressing on my path to conquer the world, one line of code at a time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/me/3-months-of-silence/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Slow internet under Ubuntu/Linux</title>
		<link>http://blog.sirupsen.dk/guides/slow-internet-under-ubuntulinux/</link>
		<comments>http://blog.sirupsen.dk/guides/slow-internet-under-ubuntulinux/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 07:06:52 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[opendns]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unstable]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=253</guid>
		<description><![CDATA[In both Ubuntu Jaunty and Ubuntu Karmic I&#8217;ve had trouble with the internet, actually also when I was running Fedora. It was unstable, I could go to sites, but it took a good while to look up the host (according to Chrome). It had periods where it was good, usually short ones, and periods where [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fslow-internet-under-ubuntulinux%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fslow-internet-under-ubuntulinux%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>In both Ubuntu Jaunty and Ubuntu Karmic I&#8217;ve had trouble with the internet, actually also when I was running Fedora. It was unstable, I could go to sites, but it took a good while to look up the host (according to Chrome). It had periods where it was good, usually short ones, and periods where it sucked like hell, and was almost unusable. Download speed, and everything else than the browser, seemed to work normally though. At first, I thought I had Ipv6 troubles, but this seemed to not solve my problem. At some point, randomly, I decided to switch to OpenDNS, since I had been using it before, on other platforms, and I noticed it made those a bit faster, so it was worth the try!</p>
<p>And<strong> it worked.</strong> It worked really good. A lot of people might face this problem too, and I advise them to try out OpenDNS, and see if that fixes their problem. :)</p>
<p><a href="https://store.opendns.com/setup/device/ubuntu/">Here&#8217;s a guide</a> from OpenDNS on how to set up OpenDNS on your Linux machine!</p>
<p>Good luck. :)</p>
<p><strong>Edit: </strong>As of Ubuntu Karmic, it seemed that the OpenDNS thing didn&#8217;t solve it properly, therefore <a href="http://superuser.com/questions/67921/slow-website-loading-on-ubuntu-karmic">I asked for help at SuperUser</a>, if you still have the problem after switching DNS, I advice you to <a href="http://superuser.com/questions/67921/slow-website-loading-on-ubuntu-karmic">go there</a> and read the answers to my question.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/guides/slow-internet-under-ubuntulinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Become a Dropbox ninja!</title>
		<link>http://blog.sirupsen.dk/guides/become-a-dropbox-ninja/</link>
		<comments>http://blog.sirupsen.dk/guides/become-a-dropbox-ninja/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 13:08:33 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[dropbox]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[sync]]></category>

		<guid isPermaLink="false">http://blog.sirupsen.dk/?p=245</guid>
		<description><![CDATA[I&#8217;ve known Dropbox for very long. I found it nice that it provided the service it did, however &#8211; I like to have things automated, I didn&#8217;t want to &#8220;Drop&#8221; my files there manually all the time. That was time consuming, and I would forget to do it &#8211; and then when I&#8217;d need that [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fbecome-a-dropbox-ninja%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fbecome-a-dropbox-ninja%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve known Dropbox for very long. I found it nice that it provided the service it did, however &#8211; I like to have things automated, I didn&#8217;t want to &#8220;Drop&#8221; my files there manually all the time. That was time consuming, and I would forget to do it &#8211; and then when I&#8217;d need that file somewhere else, I would be fucked since the chance my recent &#8220;Drop&#8221; was the latest update of that file, would be low.</p>
<p>I wanted my Dropbox to sync everything automatically, I wanted to still have my files where they would originally be on my Desktop. On my Laptop, that didn&#8217;t matter &#8211; since I only use it for browsing the web. On my Desktop, I have all my Photos, configuration files, and programming. I wanted to have these files available everywhere, anytime.</p>
<p><span id="more-245"></span></p>
<p>The solution to this was simple, very simple. Apparently Dropbox understands symbolic links, under Linux (my desktop, and main computer) I&#8217;d just Download dropbox, and put it in my home folder, then start linking everything together, by creating symbolic links. I started with my Photos.</p>
<p><a href="https://www.getdropbox.com/static/images/tour_4.jpg"><img class="alignleft" title="Dropbox backup" src="https://www.getdropbox.com/static/images/tour_4.jpg" alt="" width="441" height="304" /></a></p>
<pre>sirupsen@rawr:~$ ln -s Photos Dropbox/Photos</pre>
<p>Then all my local programming:</p>
<pre>sirupsen@rawr:~$ ln -s /var/www Dropbox/Programming</pre>
<p>Then my &#8220;Dumper&#8221; which is basically anything else than videos, photos, music and programming:</p>
<pre>sirupsen@rawr:~$ ln -s Dumper Dropbox/Dumper</pre>
<p>In my dumper I even did symbolic links to some of the configuration directories (i.e. Vim configuration, .bashrc etc)</p>
<p>It started syncing, and the magic of Dropbox was a lot more tempting to me. I now have everything, in the newest version, available everywhere (iPhone, Laptop, Web), and it&#8217;s securely backed up.</p>
<p>If Dropbox seems tempting to you (now?), be sure to sign up at <a href="https://www.getdropbox.com/">Getdropbox.com!</a> If you&#8217;d like to help me, and yourself actually, you can signup via <a href="https://www.getdropbox.com/referrals/NTgzODk4OTk">my referral link</a> and get 250 mb extra to the 2gb which are default! (And give me the same extra, at a limit of 3 free gb)</p>
<p>Also, Dropbox has <a href="http://wiki.getdropbox.com/">a great wiki</a> with <a href="http://wiki.getdropbox.com/DropboxAddons">various addons</a> and <a href="http://wiki.getdropbox.com/TipsAndTricks">tips &amp; tricks!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/guides/become-a-dropbox-ninja/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dual booting Windows and Linux</title>
		<link>http://blog.sirupsen.dk/guides/dual-booting-windows-and-linux/</link>
		<comments>http://blog.sirupsen.dk/guides/dual-booting-windows-and-linux/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 09:01:49 +0000</pubDate>
		<dc:creator>Sirupsen</dc:creator>
				<category><![CDATA[Guides]]></category>
		<category><![CDATA[dual boot]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.blog.sirupsen.dk/?p=234</guid>
		<description><![CDATA[When I for the first time wanted to try out Linux, I couldn&#8217;t at first glance find a simple guide on how to dual-boot Windows and Linux. So I decided to write a quick simple guide for you, to give an overview of how to create your own dual boot system. You should have the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fdual-booting-windows-and-linux%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fblog.sirupsen.dk%2Fguides%2Fdual-booting-windows-and-linux%2F&amp;source=Sirupsen&amp;style=normal&amp;service=ow.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>When I for the first time wanted to try out Linux, I couldn&#8217;t at first glance find a simple guide on how to dual-boot Windows and Linux. So I decided to write a quick simple guide for you, to give an overview of how to create your own dual boot system. You should have the following stuff solved before you try this out:</p>
<ul>
<li>Windows CD
<ul>
<li>Be sure you have a valid serial for it, and so on</li>
</ul>
</li>
<li>Linux CD
<ul>
<li>Ubuntu, Fedora, Mint or whatver you might prefer</li>
<li>Check out <a href="http://distrowatch.com/">distrowatch</a> if you have yet to decide</li>
</ul>
</li>
<li>Backup of <strong>all</strong> your important files
<ul>
<li>Also configuration files are handy to have</li>
<li>.. and plugins!</li>
</ul>
</li>
</ul>
<p>When this is solved, you should be ready to get started.</p>
<p><span id="more-234"></span>What you do when you want two operation systems, is basically you have a partition for each. Linux requires an additional swap partition, Windows requires only one partition for the entire system. You can even share a partition between both operation systems. However, if you want Windows to be able to read it, you&#8217;ll need it to be FAT32 (both Windows and Linux handles this filesystem fine!), and you need to create the shared partition, when you install Windows. (I.e. if you have Windows installed now, and would like to have an extra shared drive with Linux, you can&#8217;t create it when you install Linux, since then Windows won&#8217;t find it).</p>
<p>You might not know what a partition is, but it&#8217;s quite simple. Imagine you have your harddisk, and you split it into smaller chunks, and store stuff here. As humans remember, and learn better by illustrations, I made one (bear with me, I&#8217;m bad at drawing):</p>
<p><a href="http://img42.imageshack.us/img42/6572/partitions.png"><img style="border: 0px initial initial;" title="Paritions" src="http://img42.imageshack.us/img42/6572/partitions.png" alt="" width="500" height="200" /></a></p>
<p>Imagine partition 1 being Windows, partition 2 Linux and partition 3 the shared drive. (I didn&#8217;t include the swap one here, as it would be pretty small on the scale, but<strong> it is</strong> a partition like the other ones)</p>
<p>Now, you should decide how your partition scheme should be like. There&#8217;s tons of options, for this example (to keep it simple) we&#8217;ll go with this, please check the comments for other ways to do it:</p>
<ul>
<li>Windows partition (partition we install Windows on) [NTFS]</li>
<li>Linux Partition (partition we install Linux on) [EXT4]
<ul>
<li>Swap partition (partition we install swap for linux on) [swap]</li>
</ul>
</li>
<li>Shared Partition (partition we want Linux and Windows to share) [FAT]</li>
</ul>
<p>Alright, let&#8217;s get to it. For this &#8220;guide&#8221; I assume we are working on a 500 gb harddrive (plan how you partition your own harddrive). And we want a shared partition between the two systems. This should give a basic knowledge of what you need to do.</p>
<ul>
<li>Boot from Windows CD
<ul>
<li>If you happen to not being able to boot from it, go into your BIOS and set CD as first for boot priority
<ul>
<li>Should you have trouble doing this, google your way around for it. There&#8217;s <strong>plenty</strong> of articles on that subject</li>
</ul>
</li>
</ul>
</li>
<li>Create two partitions in Windows partition manager
<ul>
<li>Partition to install Windows on [100 GB]</li>
<li>Partition we share between Linux and Windows, which we format to Fat32 later [300 GB]</li>
</ul>
</li>
<li>Install Windows on the first partition
<ul>
<li>Format it with NTFS (not quick, since quick doesn&#8217;t examine for bad stuff)</li>
</ul>
</li>
<li>Now wait a while for Windows to install
<ul>
<li>Enter your valid serial when prompted</li>
</ul>
</li>
<li>When your done it should boot</li>
<li>Install your drivers
<ul>
<li>You&#8217;ll probably have to restart a few times</li>
</ul>
</li>
<li>Go to &#8220;My Computer&#8221;, and open the D:/ drive (the shared partition)
<ul>
<li>It&#8217;ll ask you to format</li>
<li>Do so, and pick FAT32 as the filesystem</li>
</ul>
</li>
<li>Boot up in Windows, and take out the Windows CD
<ul>
<li>Then put in the Linux CD (Ubuntu, Fedora or whatever distroration you picked)</li>
</ul>
</li>
<li>Restart your computer</li>
<li>Now, there&#8217;s two kind of installation cd&#8217;s:
<ul>
<li>LiveCD: (Fedora has this), it&#8217;ll boot into the Fedora system. On the desktop there&#8217;ll be a shortcut named something like &#8220;Install on your system&#8221;, click this and you&#8217;ll get into the installation</li>
<li>Normal: (Ubuntu has this), you&#8217;ll be greeted by a screen where you can pick install, check disc etc. Pick install.</li>
</ul>
</li>
<li>Now you should be taken through some installation stuff, time, location, etc.</li>
<li>At some point, you&#8217;ll be at a partition manager.
<ul>
<li>Ubuntu (Maybe Mint, and other ubuntu based systems too, not sure): You have an option to install the system side by side with the Windows system, do this. Does all the partitioning stuff for you! This will take the rest of the space, ~ 100 GB.</li>
<li>Fedora (And probably any other system): Create a new partition named: &#8220;/&#8221; (this is the Linux system) [93 GB]. And a &#8220;/boot&#8221; partition [200 mb] (This is probably for Fedora only, never tried any other system than Ubuntu and Fedora, check your systems installation guide). And then you need the swap one, just pick swap from the dropdown of filesystems. To figure your size, follow this guideline [6 GB for me, as I have 4 GB ram]:</li>
</ul>
<ul style="padding-left: 1,6em; list-style-image: url(http://docs.fedoraproject.org/install-guide/f11/en-US/html/Common_Content/images/dot.png); list-style-type: circle;">
<li style="line-height: 1,29em; padding-top: 0px; margin-top: 0em; padding-bottom: 0px; margin-bottom: 0,4em;">
<div style="line-height: 1,29em; padding-top: 0px; margin-top: 0em; padding-bottom: 0px; margin-bottom: 0,3em;">M = Amount of RAM in GB, and S = Amount of swap in GB:</div>
</li>
</ul>
<ul style="padding-left: 1,6em; list-style-image: url(http://docs.fedoraproject.org/install-guide/f11/en-US/html/Common_Content/images/dot.png); list-style-type: circle;">
<li style="line-height: 1,29em; padding-top: 0px; margin-top: 0em; padding-bottom: 0px; margin-bottom: 0,4em;">
<pre style="line-height: 1,29em; font-family: 'liberation mono', 'bitstream vera mono', 'dejavu mono', monospace; display: block; background-color: #eeeeee; margin-bottom: 0,3em; padding-top: 0,5em; padding-right: 1em; padding-bottom: 0,5em; padding-left: 1em; white-space: pre-wrap; word-wrap: break-word;">If M &lt; 2
	S = M *2
Else
	S = M + 2</pre>
</li>
</ul>
</li>
<li>Follow the last configuration</li>
<li>Now, your system restarts and you should see a list of different systems to choose from (remember to take our your CD, so you don&#8217;t boot the installation CD again), when you boot (i.e. Windows and Linux distroration):
<ul>
<li>Try to boot Windows
<ul>
<li>Test shared drive</li>
</ul>
</li>
<li>Restart</li>
<li>Boot Linux
<ul>
<li>Test shared drive</li>
</ul>
</li>
</ul>
</li>
<li>And everything should be working great! You should be able to access the shared drive on both systems!</li>
</ul>
<p>I can <strong>not</strong> take any responsibility for <strong>any</strong> damage you may cause to your system, while following this guide. It&#8217;s written only to give a overview of what you need to do, in order to create a dual boot system.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sirupsen.dk/guides/dual-booting-windows-and-linux/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
