<?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>Steven Harms &#187; Linux</title>
	<atom:link href="http://www.sharms.org/blog/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharms.org/blog</link>
	<description>Life, Linux and Technology</description>
	<lastBuildDate>Sun, 28 Aug 2011 18:02:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ubuntu VS OS X</title>
		<link>http://www.sharms.org/blog/2011/07/ubuntu-vs-os-x/</link>
		<comments>http://www.sharms.org/blog/2011/07/ubuntu-vs-os-x/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 17:29:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=810</guid>
		<description><![CDATA[A few months back I wrote a post that had quite a few reactions, speculating on why open source developers run OS X. Recently I have been using the newest Macbook Pro 15&#8243;, and I thought I would update my direct experience on how Ubuntu and OS X stack up. Web Browsing On both platforms [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2008/11/workspaces/' rel='bookmark' title='Permanent Link: Workspaces'>Workspaces</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/the-cherokee-webserver/' rel='bookmark' title='Permanent Link: The Cherokee Webserver'>The Cherokee Webserver</a></li>
<li><a href='http://www.sharms.org/blog/2008/11/flash-64-bit-on-ubuntu-intrepid/' rel='bookmark' title='Permanent Link: Flash 64-bit on Ubuntu Intrepid'>Flash 64-bit on Ubuntu Intrepid</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A few months back I wrote a post that had quite a few reactions, speculating on <a href="http://www.sharms.org/blog/2010/12/on-why-open-source-developers-run-mac-os-x/">why open source developers run OS X</a>.</p>
<p>Recently I have been using the newest Macbook Pro 15&#8243;, and I thought I would update my direct experience on how Ubuntu and OS X stack up.</p>
<p><strong>Web Browsing</strong><br />
On both platforms Chrome, in my view, is the defacto standard for nerds and an ever increasing porportion of the general population. Having used Safari for the first month to try &#8216;the apple way&#8217;, I can say that Chrome feels faster, has better features, and was just really well thought out. Both platforms are a wash on this one.</p>
<p><strong>Flash Plugin</strong><br />
This one is also a wash, both platforms have support for flash &#8212; I actually think Ubuntu has an edge here since Flash can be installed via the package manager, instead of an entirely separate installer in OS X.</p>
<p><strong>Text Editing</strong><br />
Textmate is a very cool application, with tons of pre-defined bundles that allow for quick completion, and a great project view.  However for Java development, it seems that IDE autocompletion / debugger integration is hard to beat (Eclipse / Netbeans work on both platforms), while for Python / Ruby etc Vim was a better fit for both platforms, as an advanced user.  Definitely a great entry level editor that is an inbetween for Gedit / Vim.</p>
<p><strong>Terminals</strong><br />
I think here gnome-terminal blows away terminal.app &#8212; gnome-terminal is noticeably faster and the design was clearly by people using the terminal day in and out.  I think the Mac community feels the same way, and in general uses ITerm, or the recently released ITerm2 (not same authors as ITerm oddly enough).  ITerm2 does work well, but again it feels like the terminal lacks speed in comparison.</p>
<p><strong>Performance</strong><br />
One thing that struck me was the lack of responsiveness / speed.  This Macbook is a quad core with an ATI dedicated graphics card, but for most operations the OS feels quite sluggish.  Starting up iTunes or Safari takes much longer than you would expect for a $2000 USD piece of machinery.  I will however note that I only use Gnome 2, so Gnome 3 may suffer from a similar issue, but I am not experienced enough to write about it.</p>
<p><strong>Application Installation Method</strong><br />
I was able to install apps through the Mac App Store, in the same manner I do in Ubuntu using the Software Center.  The Mac App store has many more commercial applications, however most of them like Photoshop are just not needed for a Linux veteran as Gimp does everything needed.  I also purchased XCode 4, but was underwhelmed other than the Iphone emulator which ran awesome in comparison to the Android emulator I was previously used to.</p>
<p><strong>Email</strong><br />
I am sure a lot of people use Mail.app and like it, but I have always been a fan of the GMail interface.  I guess if we are comparing Apples to Apples, Evolution and Mail.app are both not very strong competitors (ie the rest of the world either runs on Outlook or Gmail).</p>
<p><strong>Photo Management</strong><br />
iPhoto is a strong point, it is very easy, intuitive and nice looking to manage photos.   Linux alternatives here are weak.</p>
<p><strong>Music Management</strong><br />
iTunes is a horrible, slow monster of expensive music.  One thing I miss is my Droid and the Amazon MP3 application, as that was by far a better deal, and my purchases went straight to the cloud.  iCloud is coming shortly, but Amazon is still my vendor of choice, and they already have proven to get the cloud right.</p>
<p><strong>Gaming</strong><br />
OS X and Ubuntu both have my favorite game, Heroes of Newerth.  Mac OS X has Steam, which is definitely a benefit and World of Warcraft.  Ubuntu can&#8217;t really compete in this arena, so it is something to consider.</p>
<p><strong>Conclusion</strong><br />
So, if you were like me, and curious about Mac OS X, you can see I am not overall impressed.  Maybe I am just biased towards Ubuntu, but I find overall it has favorable performance, and I can change out any pieces I don&#8217;t like.   I would recommend OS X if you wanted a generally worse experience but the ability to install Photoshop and a few more games (still nothing compared to Windows in this respect).</p>
<p>&nbsp;</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2008/11/workspaces/' rel='bookmark' title='Permanent Link: Workspaces'>Workspaces</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/the-cherokee-webserver/' rel='bookmark' title='Permanent Link: The Cherokee Webserver'>The Cherokee Webserver</a></li>
<li><a href='http://www.sharms.org/blog/2008/11/flash-64-bit-on-ubuntu-intrepid/' rel='bookmark' title='Permanent Link: Flash 64-bit on Ubuntu Intrepid'>Flash 64-bit on Ubuntu Intrepid</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2011/07/ubuntu-vs-os-x/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Gitorious and Fully Qualified Domain Names (FQDN)</title>
		<link>http://www.sharms.org/blog/2011/02/gitorious-and-fully-qualified-domain-names-fqdn/</link>
		<comments>http://www.sharms.org/blog/2011/02/gitorious-and-fully-qualified-domain-names-fqdn/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 15:08:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[gitorious]]></category>
		<category><![CDATA[installation]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=806</guid>
		<description><![CDATA[When you want to install your own version of gitorious, a lot of people seem to run into issues where they don&#8217;t have a real DNS name for their servers. This breaks the session code of gitorious. I just ran a &#8216;git diff&#8217; on my gitorious tree, and here are the changes I made to [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2010/07/sles-sp1-and-novell-suse-autoyast-with-intel-dell-raid-controllers/' rel='bookmark' title='Permanent Link: SLES 11 SP1 and Novell / SUSE Autoyast with Intel / Dell Raid Controllers'>SLES 11 SP1 and Novell / SUSE Autoyast with Intel / Dell Raid Controllers</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/finding-the-difference-between-two-files/' rel='bookmark' title='Permanent Link: Finding the difference between two files'>Finding the difference between two files</a></li>
<li><a href='http://www.sharms.org/blog/2009/06/installing-groupwise-8-client-in-ubuntu-jaunty-amd64/' rel='bookmark' title='Permanent Link: Installing Groupwise 8 Client in Ubuntu Jaunty AMD64'>Installing Groupwise 8 Client in Ubuntu Jaunty AMD64</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When you want to install your own version of gitorious, a lot of people seem to run into issues where they don&#8217;t have a real DNS name for their servers.  This breaks the session code of gitorious.</p>
<p>I just ran a &#8216;git diff&#8217; on my gitorious tree, and here are the changes I made to make it work:</p>
<pre class="brush: diff">

diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index 7384f93..2409810 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -8,7 +8,8 @@ gitorious_yaml = YAML::load_file(File.join(Rails.root, &quot;config/gitorious.yml&quot;))[
 ActionController::Base.session = {
   :key    =&gt; &#039;_gitorious_sess&#039;,
   :secret =&gt; gitorious_yaml[&#039;cookie_secret&#039;],
-  :domain =&gt; &quot;.#{gitorious_yaml[&quot;gitorious_host&quot;]}&quot;,
+#  :domain =&gt; &quot;.#{gitorious_yaml[&quot;gitorious_host&quot;]}&quot;,
+  :domain =&gt; &quot;10.80.21.73&quot;,
   :expire_after =&gt; 3.weeks,
 }
</pre>
<p>And also:</p>
<pre class="brush: diff">
diff --git a/app/models/repository.rb b/app/models/repository.rb
index c4fd612..1df689c 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -226,7 +226,7 @@ class Repository &lt; ActiveRecord::Base
   end

   def http_clone_url
-    &quot;http://git.#{GitoriousConfig[&#039;gitorious_host&#039;]}/#{gitdir}&quot;
+    &quot;http://#{GitoriousConfig[&#039;gitorious_host&#039;]}/#{gitdir}&quot;
   end

   def http_cloning?
</pre>
<p>If you change 10.80.21.73 to whatever your ip is, all of your troubles should go away.</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2010/07/sles-sp1-and-novell-suse-autoyast-with-intel-dell-raid-controllers/' rel='bookmark' title='Permanent Link: SLES 11 SP1 and Novell / SUSE Autoyast with Intel / Dell Raid Controllers'>SLES 11 SP1 and Novell / SUSE Autoyast with Intel / Dell Raid Controllers</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/finding-the-difference-between-two-files/' rel='bookmark' title='Permanent Link: Finding the difference between two files'>Finding the difference between two files</a></li>
<li><a href='http://www.sharms.org/blog/2009/06/installing-groupwise-8-client-in-ubuntu-jaunty-amd64/' rel='bookmark' title='Permanent Link: Installing Groupwise 8 Client in Ubuntu Jaunty AMD64'>Installing Groupwise 8 Client in Ubuntu Jaunty AMD64</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2011/02/gitorious-and-fully-qualified-domain-names-fqdn/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>On Why Open Source Developers Run Mac OS X</title>
		<link>http://www.sharms.org/blog/2010/12/on-why-open-source-developers-run-mac-os-x/</link>
		<comments>http://www.sharms.org/blog/2010/12/on-why-open-source-developers-run-mac-os-x/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 15:55:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[apple.programming]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=775</guid>
		<description><![CDATA[A common trend among many of the best developers is to see them posting screenshots running OS X. Many of the best developers, some my personal &#8216;developer heroes&#8217;, have made the switch to OS X. It&#8217;s All About the Mentality I respect and admire programmers like @migueldeicaza, @mitsuhiko, mandrake, @dhh for all they have accomplished. [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2008/10/open-source-radeonhd-driver-122-released/' rel='bookmark' title='Permanent Link: Open Source RadeonHD driver 1.2.2 released'>Open Source RadeonHD driver 1.2.2 released</a></li>
<li><a href='http://www.sharms.org/blog/2008/11/creative-open-sources-their-driver/' rel='bookmark' title='Permanent Link: Creative open sources their driver'>Creative open sources their driver</a></li>
<li><a href='http://www.sharms.org/blog/2007/11/howto-add-updated-e1000-driver-to-sled-10-sp1/' rel='bookmark' title='Permanent Link: Howto:  Add updated e1000 driver to SLED 10 SP1'>Howto:  Add updated e1000 driver to SLED 10 SP1</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A common trend among many of the best developers is to see them posting screenshots running OS X.  Many of the best developers, some my personal &#8216;developer heroes&#8217;, have made the switch to OS X.</p>
<p><strong>It&#8217;s All About the Mentality</strong><br />
I respect and admire programmers like <a href="http://twitter.com/#!/migueldeicaza">@migueldeicaza</a>, <a href="http://twitter.com/#!/mitsuhiko">@mitsuhiko</a>, <a href="http://www.mandrake.net">mandrake</a>, <a href="http://twitter.com/#!/dhh">@dhh</a> for all they have accomplished.  One thing they all have in common, present day, is running OS X.  Mandrake cowrote Enlightenment (which is the original really cool window manager for Linux), Miguel started Gnome, and the majority of code both Mitsuhiko (wrote almost every useful Python library ever) and DHH (Ruby on Rails) write run on Linux backends to say the least.</p>
<p>What are they most known for?  Problem solving skills mixed with actually producing / releasing.  </p>
<p><strong>Linux is Open Source</strong><br />
And this, I believe, is why great developers tend to move towards OS X (yes, there are plenty of exceptions).  A critical piece of writing software is focus.  When a problem solver uses a Linux desktop, they are immediately confronted with the possibility of being able to modify every part of their system.  When a problem solver runs OS X, their options are severely limited, by design.</p>
<p>I think all of us are guilty for hunting down PPAs to get a backported browser, or running &#8216;./configure &#038;&#038; make &#038;&#038; make install&#8217; at some point.  And when you have programming skills, source code can turn into a detriment to productivity when you start modifying projects outside of what you intended to accomplish.  All of a sudden you start hacking a project for a few minutes, and wake up days later in a coding haze with all of that time lost.</p>
<p>Personally I have had experience with this while using old Linux distributions.  We have SLES 9 systems and SLES 10 systems here at work, and in the past year I have spent countless hours hacking Sprint 3G wireless drivers, USB over IP, Firefox 3 and countless others to work on these older systems.  Why?  Not because they are the primary goal, but because I could, which in turn took up time from things I actually &#8220;wanted&#8221; to do.</p>
<p><strong>Time is Valuable</strong><br />
Watching one of Miguel&#8217;s presentations, he mentions that he does not have enough years left to &#8220;worry about memory management&#8221; and that they leave that to the younger folks.  This is the crux of the argument.  For programmers, there is far too much opportunity for distraction at every avenue.  We don&#8217;t know how long we will be here for, but certainly we know that nothing we care about will get done as long as our focus is spread so thin across the spectrum of Linux.</p>
<p><strong>Summary</strong><br />
This is all just food for thought, not a judgement against any form of desktop or usage pattern.  For reference, I am still running Ubuntu on my desktop, and being wildly unproductive on the tasks I want to finish.</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2008/10/open-source-radeonhd-driver-122-released/' rel='bookmark' title='Permanent Link: Open Source RadeonHD driver 1.2.2 released'>Open Source RadeonHD driver 1.2.2 released</a></li>
<li><a href='http://www.sharms.org/blog/2008/11/creative-open-sources-their-driver/' rel='bookmark' title='Permanent Link: Creative open sources their driver'>Creative open sources their driver</a></li>
<li><a href='http://www.sharms.org/blog/2007/11/howto-add-updated-e1000-driver-to-sled-10-sp1/' rel='bookmark' title='Permanent Link: Howto:  Add updated e1000 driver to SLED 10 SP1'>Howto:  Add updated e1000 driver to SLED 10 SP1</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2010/12/on-why-open-source-developers-run-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Tenda W322P Wireless N PCI Card</title>
		<link>http://www.sharms.org/blog/2010/05/tenda-w322p-wireless-n-pci-card/</link>
		<comments>http://www.sharms.org/blog/2010/05/tenda-w322p-wireless-n-pci-card/#comments</comments>
		<pubDate>Mon, 03 May 2010 15:46:39 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[wireless]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=705</guid>
		<description><![CDATA[Purchased this card at Microcenter (http://www.microcenter.com/single_product_results.phtml?product_id=0316296). Out of the box works on Ubuntu 9.10, supports WEP, WPA, WPA2 and has no stability issues transferring large files etc. Attempted to install the card under Windows 7 x64, x32, and Windows XP SP3, all of which did not recognize the card without additional drivers. Summary: PCI wireless [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/03/wireless-hackers/' rel='bookmark' title='Permanent Link: Wireless hackers'>Wireless hackers</a></li>
<li><a href='http://www.sharms.org/blog/2007/05/dell-latitude-d620-with-broadcom-wireless-on-feisty/' rel='bookmark' title='Permanent Link: Dell Latitude D620 with Broadcom Wireless on Feisty'>Dell Latitude D620 with Broadcom Wireless on Feisty</a></li>
<li><a href='http://www.sharms.org/blog/2008/06/secret-formula-of-linux-compatible-hardware/' rel='bookmark' title='Permanent Link: Secret Formula of Linux Compatible Hardware'>Secret Formula of Linux Compatible Hardware</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sharms.org/blog/wp-content/uploads/0316296_292524.jpg"><img src="http://www.sharms.org/blog/wp-content/uploads/0316296_292524.jpg" alt="" title="Tenda W322P" width="200" height="200" class="aligncenter size-full wp-image-706" /></a></p>
<p>Purchased this card at Microcenter (<a href="http://www.microcenter.com/single_product_results.phtml?product_id=0316296">http://www.microcenter.com/single_product_results.phtml?product_id=0316296</a>).  Out of the box works on Ubuntu 9.10, supports WEP, WPA, WPA2 and has no stability issues transferring large files etc.</p>
<p>Attempted to install the card under Windows 7 x64, x32, and Windows XP SP3, all of which did not recognize the card without additional drivers.</p>
<p><strong>Summary:</strong> PCI wireless N card that is Ubuntu compatible with a price under $25<br />
<strong>Grade:</strong> A+</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/03/wireless-hackers/' rel='bookmark' title='Permanent Link: Wireless hackers'>Wireless hackers</a></li>
<li><a href='http://www.sharms.org/blog/2007/05/dell-latitude-d620-with-broadcom-wireless-on-feisty/' rel='bookmark' title='Permanent Link: Dell Latitude D620 with Broadcom Wireless on Feisty'>Dell Latitude D620 with Broadcom Wireless on Feisty</a></li>
<li><a href='http://www.sharms.org/blog/2008/06/secret-formula-of-linux-compatible-hardware/' rel='bookmark' title='Permanent Link: Secret Formula of Linux Compatible Hardware'>Secret Formula of Linux Compatible Hardware</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2010/05/tenda-w322p-wireless-n-pci-card/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>5 Things I Have Learned About Corporations</title>
		<link>http://www.sharms.org/blog/2009/10/5-things-i-have-learned-about-corporations/</link>
		<comments>http://www.sharms.org/blog/2009/10/5-things-i-have-learned-about-corporations/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:12:18 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=639</guid>
		<description><![CDATA[When I was younger I would email successful people and ask how they got where they were, and how I could get there. Now I get paid to work with / on Linux, and figured I would share a few things. Age is a funny thing, and as much as I thought I knew when [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2006/07/we-can-build-it-bigger-faster-stronger/' rel='bookmark' title='Permanent Link: We can build it.  Bigger. Faster. Stronger.'>We can build it.  Bigger. Faster. Stronger.</a></li>
<li><a href='http://www.sharms.org/blog/2010/02/explaining-a-simple-argument/' rel='bookmark' title='Permanent Link: Explaining a simple argument'>Explaining a simple argument</a></li>
<li><a href='http://www.sharms.org/blog/2008/10/growing-foss-communities-through-eulas/' rel='bookmark' title='Permanent Link: Growing FOSS communities through EULA&#039;s'>Growing FOSS communities through EULA&#039;s</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When I was younger I would email successful people and ask how they got where they were, and how I could get there.  Now I get paid to work with / on Linux, and figured I would share a few things.  Age is a funny thing, and as much as I thought I knew when I was 18, 10 years later gives you a much better perspective.</p>
<ol>
<li><strong>You can&#8217;t be a expert in every field</strong><br />
My whole life I have been a &#8220;computer scientist&#8221;.  That meant I ran pretty much every operating system, and tried to program in as many languages possible.  However, in the professional world, your advice outside of your realm is seldomly used or even asked for.  Even if it is technically correct, team x does not want to have team y telling them how to do their job.  Swallow it up, not everything will go the way you want it.</li>
<li><strong>Communication is more important than technical expertise</strong><br />
If you look through the ranks of a corporation, you will notice that seldomly does the most technicially proficient employee ever even get to the &#8216;C&#8217; level (CTO, CIO etc).  In smaller companies, being the expert is important because everything is riding on you.  When your company has thousands of employees, communicating efficiently is worth much more.  Learn how to talk to non-technical people.</li>
<li><strong>Your manager is always right</strong><br />
Never be a martyr for a specific technical feature.  If your company needs something done a specific way, and you are against it, politely state your position.  If they are not interested, do it their way.  If the manager was wrong, they will take heat for it.  However, if you make a big issue about it, your manager is still the one at the end of the day who evaluates you on your performance review.</li>
<li><strong>Appearance matters</strong><br />
You are selling a complete package to a corporation.  It is important that your outward appearance is in line with the position you are  going for.  If there are two applicants of similar skill levels, the one who interviews that is well dressed and clean will get that position.  First impressions count, especially during interviews.</li>
<li><strong>Everyone has their reasons</strong><br />
No matter how bad you think a choice or decision was, everyone had a reason for doing it.  They thought it out, they presented it, and weighed the factors that matter to them.  It is very easy to point out how dumb you think something is, but likely you don&#8217;t have all the facts of the entire scenario.  If you do have all the facts, calling them out on it won&#8217;t fix anything and will likely create resentment.</li>
</ol>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2006/07/we-can-build-it-bigger-faster-stronger/' rel='bookmark' title='Permanent Link: We can build it.  Bigger. Faster. Stronger.'>We can build it.  Bigger. Faster. Stronger.</a></li>
<li><a href='http://www.sharms.org/blog/2010/02/explaining-a-simple-argument/' rel='bookmark' title='Permanent Link: Explaining a simple argument'>Explaining a simple argument</a></li>
<li><a href='http://www.sharms.org/blog/2008/10/growing-foss-communities-through-eulas/' rel='bookmark' title='Permanent Link: Growing FOSS communities through EULA&#039;s'>Growing FOSS communities through EULA&#039;s</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/10/5-things-i-have-learned-about-corporations/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Encrypted Swap</title>
		<link>http://www.sharms.org/blog/2009/09/encrypted-swap/</link>
		<comments>http://www.sharms.org/blog/2009/09/encrypted-swap/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 14:09:46 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[swap]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=590</guid>
		<description><![CDATA[This post was spawned from my own misconception that my swap partition contained no sensitive data on systems with a lot of ram. All of my systems I work with have atleast 4GB of ram, so my swap usage is usually under 2 megabytes. Why should I worry what&#8217;s in my swap partition? Instead of [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/03/resizing-a-ext23-partition/' rel='bookmark' title='Permanent Link: Resizing a EXT2/3 partition'>Resizing a EXT2/3 partition</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/python-commands-module/' rel='bookmark' title='Permanent Link: Python Commands Module'>Python Commands Module</a></li>
<li><a href='http://www.sharms.org/blog/2011/01/automatically-backup-blogs-websites-to-amazon-s3/' rel='bookmark' title='Permanent Link: Automatically Backup Blogs / Websites to Amazon S3'>Automatically Backup Blogs / Websites to Amazon S3</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This post was spawned from my own misconception that my swap partition contained no sensitive data on systems with a lot of ram.</p>
<p>All of my systems I work with have atleast 4GB of ram, so my swap usage is usually under 2 megabytes.  Why should I worry what&#8217;s in my swap partition?</p>
<p>Instead of going into it, just try it yourself. My swap partition is /dev/sda5.  Run the command:</p>
<pre class="brush: sh">
$ sudo strings /dev/sda5 | more
</pre>
<p>What came up was a ton of interesting data, from files I had looked at, print jobs, and bash scripts.  So yes, even if you have enough ram, your swap is still very vulnerable to storing <strong>a lot</strong> of data about you.</p>
<p>Good news is Ubuntu 9.10 / Karmic will have the option to encrypt swap, which <a href="https://wiki.edubuntu.org/ServerKarmicEncryptedSwap">is on the wiki</a>.</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/03/resizing-a-ext23-partition/' rel='bookmark' title='Permanent Link: Resizing a EXT2/3 partition'>Resizing a EXT2/3 partition</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/python-commands-module/' rel='bookmark' title='Permanent Link: Python Commands Module'>Python Commands Module</a></li>
<li><a href='http://www.sharms.org/blog/2011/01/automatically-backup-blogs-websites-to-amazon-s3/' rel='bookmark' title='Permanent Link: Automatically Backup Blogs / Websites to Amazon S3'>Automatically Backup Blogs / Websites to Amazon S3</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/09/encrypted-swap/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program</title>
		<link>http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/</link>
		<comments>http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 20:10:24 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=528</guid>
		<description><![CDATA[In this post we will cover how to make a basic GUI application using Mono along with Monodevelop. If you haven&#8217;t already, you will want to read part 1 and part 2 of this series before this article. Monodevelop Monodevelop is the tool we are using as our editor. This is Linux&#8217;s equivalent of Visual [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono'>Annoying people with code: A gentle introduction to C# and Mono</a></li>
<li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types'>Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types</a></li>
<li><a href='http://www.sharms.org/blog/2008/09/windows-to-linux-usb-key/' rel='bookmark' title='Permanent Link: Windows to Linux USB key'>Windows to Linux USB key</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In this post we will cover how to make a basic GUI application using Mono along with Monodevelop.  If you haven&#8217;t already, you will want to read <a href="http://www.sharms.org/blog/2009/07/16/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/">part 1</a> and <a href="http://www.sharms.org/blog/2009/07/17/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/">part 2</a> of this series before this article.</p>
<p><strong>Monodevelop</strong><br />
Monodevelop is the tool we are using as our editor.  This is Linux&#8217;s equivalent of Visual Studio.  It can be used to code, debug and design your application, and can link in with revision control systems.  This article was written using version 2.0, if your version is not 2.0 you may see slight differences.</p>
<p><strong>Create your project</strong><br />
After starting Monodevelop, go to <strong>File -> New -> Solution</strong>.  You will be presented with a prompt asking which kind of solution we are starting.  Click on <strong>C# -> Gtk# 2.0 Project</strong> as shown below:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/new-solution.jpg" alt="new-solution" title="new-solution" width="762" height="606" class="aligncenter size-full wp-image-531" /></p>
<p><span id="more-528"></span></p>
<p>Go ahead and click &#8220;Forward&#8221;.  This will drop us at the default Monodevelop screen, and bring up a boilerplate to work from.  For this guide we will mainly be working in the Designer mode.  In the above picture we named our project <b>helloWorldGraphical</b>.  I suggest you name yours the same unless you are already familiar with C#.  Navigate to <b>Solution helloWorldGraphical -> helloWorldGraphical -> User Interface -> MainWindow</b>.  Here you will see the designer window.  If it shows source code, click the Designer tab as shown:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/designer.jpg" alt="designer" title="designer" width="795" height="648" class="aligncenter size-full wp-image-532" /></p>
<p>So now we have a window.  By default, there does not appear to be any buttons to do anything fun with it.  We need to change that by going to <b>View -> Toolbox</b>.  This will allow us to place buttons, boxes, whatever we want.</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/toolbox.jpg" alt="toolbox" title="toolbox" width="408" height="441" class="aligncenter size-full wp-image-534" /></p>
<p>Now that we have a bunch of different buttons, what we need is a VBox.  This is a vertical box that will help us position our elements.  Gtk graphical interfaces use containers to figure out what goes where.  For now lets just drag a VBox and leave it with the defaults (just click and drag it on to your window):</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/vbox.jpg" alt="vbox" title="vbox" width="650" height="318" class="aligncenter size-full wp-image-535" /></p>
<p>Now that we have a container, we can drag a Label.  A label just allows us to display some arbitrary text, nothing too special.  Go ahead and drag it inside the VBox we just dragged:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/label.jpg" alt="label" title="label" width="600" height="254" class="aligncenter size-full wp-image-537" /></p>
<p>Now that we have a label we can set it&#8217;s text to HelloWorld and get a glympse of how to customize GUI elements.  To do this we need to open the properties window.  To open the properties window go to <b>View -> Properties</b> as shown below:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/properties.jpg" alt="properties" title="properties" width="287" height="590" class="aligncenter size-full wp-image-538" /></p>
<p>Properties is where the magic really happens in the designer.  You can click on your VBox or Label and set a bunch of different values that will change the way your program behaves.  For the purpose of this article, we just want to change the label text:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/label-edit.jpg" alt="label-edit" title="label-edit" width="650" height="233" class="aligncenter size-full wp-image-539" /></p>
<p>Where it says &#8216;label2&#8242; (yours may say different label #), go ahead and change the text to <i>&#8220;Hello World&#8221;</i>.  Your final dialog should look like this:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/final-designer.jpg" alt="final-designer" title="final-designer" width="755" height="401" class="aligncenter size-full wp-image-540" /></p>
<p>Now we are ready to test the program.  Navigate on the top toolbar to the gears icon, which should say &#8216;Debug&#8217;:<br />
<img src="http://www.sharms.org/blog/wp-content/uploads/buildit.jpg" alt="buildit" title="buildit" width="342" height="81" class="aligncenter size-full wp-image-541" /></p>
<p>After clicking the icon, your program will launch and you will see a window as below:</p>
<p><img src="http://www.sharms.org/blog/wp-content/uploads/final.jpg" alt="final" title="final" width="469" height="382" class="aligncenter size-full wp-image-542" /></p>
<p>And now you have your Hello World program.  It doesn&#8217;t do anything, but I am sure in future tutorials we will address that.  For now just play with the designer properties and keep clicking Debug to see your changes.  Good luck!</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono'>Annoying people with code: A gentle introduction to C# and Mono</a></li>
<li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types'>Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types</a></li>
<li><a href='http://www.sharms.org/blog/2008/09/windows-to-linux-usb-key/' rel='bookmark' title='Permanent Link: Windows to Linux USB key'>Windows to Linux USB key</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MMap to null</title>
		<link>http://www.sharms.org/blog/2009/07/fun-stuff/</link>
		<comments>http://www.sharms.org/blog/2009/07/fun-stuff/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 19:31:56 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=524</guid>
		<description><![CDATA[I was reading an lwn article about an exploit: http://lwn.net/Articles/341773/ Being that I am writing posts this week about programming, and about my Fedora run down, thought people might find this interesting. I wrote a little test code that fails on Ubuntu but works on Fedora 11 (based off lwn post): #include &#60;stdio.h&#62; #include &#60;sys/mman.h&#62; [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2008/12/why/' rel='bookmark' title='Permanent Link: Why?'>Why?</a></li>
<li><a href='http://www.sharms.org/blog/2009/11/python-and-real-time-graphical-analysis/' rel='bookmark' title='Permanent Link: Python and real time graphical analysis'>Python and real time graphical analysis</a></li>
<li><a href='http://www.sharms.org/blog/2010/06/programming-using-ioctl-to-interface-with-linux-kernel-drivers/' rel='bookmark' title='Permanent Link: Programming using IOCTL to interface with Linux kernel drivers'>Programming using IOCTL to interface with Linux kernel drivers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was reading an lwn article about an exploit: <a href="http://lwn.net/Articles/341773/">http://lwn.net/Articles/341773/</a></p>
<p>Being that I am writing posts this week <a href="http://www.sharms.org/blog/2009/07/16/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/">about programming</a>, and about <a href="http://www.sharms.org/blog/2009/07/16/fedora-11-vs-ubuntu-9-04/">my Fedora run down</a>, thought people might find this interesting.</p>
<p>I wrote a little test code that fails on Ubuntu but works on Fedora 11 (based off lwn post):</p>
<pre class="brush: c">
#include &lt;stdio.h&gt;
#include &lt;sys/mman.h&gt;

int main(int argc, char **argv)
{
    // Try to write to memory location 0
    void *mem;
    mem = mmap(NULL, 0x1000, PROT_READ | PROT_WRITE, MAP_FIXED | MAP_ANONYMOUS | MAP_PRIVATE, 0, 0);

    if(mem != NULL)
    {
        printf(&quot;Could not write to memory position 0\n&quot;);
    } else
    {
        printf(&quot;We can write to memory location 0\n&quot;);
    }

    sprintf((char *) mem, &quot; This is a test\n&quot;);
    printf(&quot;Memory contents: %s\n&quot;, (char *)(mem + (sizeof(char))));
    return 0;
}
</pre>
<p><strong>Fedora 11 results:</strong></p>
<pre class="brush: sh">
./a.out
We can write to memory location 0
Memory contents: This is a test
</pre>
<p><strong>Ubuntu 9.04 results:</strong></p>
<pre class="brush: sh">
./a.out
Could not write to memory position 0
Segmentation fault
</pre>
<p><strong>What does this mean?</strong><br />
As far as I can understand it, userspace programs segfault when trying to access data in the NULL (or 0) memory region.  The kernel does not have this limitation.  The author of the exploit said this is because GCC optimises out the null check.  So if there is kernel code which references a pointer to 0, then you can have it run whatever you want.  And in atleast 2.6.30, there is kernel code that does that.</p>
<p>Ubuntu does not let the userspace programs write to 0, but in F11 you can.  Interesting stuff.</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2008/12/why/' rel='bookmark' title='Permanent Link: Why?'>Why?</a></li>
<li><a href='http://www.sharms.org/blog/2009/11/python-and-real-time-graphical-analysis/' rel='bookmark' title='Permanent Link: Python and real time graphical analysis'>Python and real time graphical analysis</a></li>
<li><a href='http://www.sharms.org/blog/2010/06/programming-using-ioctl-to-interface-with-linux-kernel-drivers/' rel='bookmark' title='Permanent Link: Programming using IOCTL to interface with Linux kernel drivers'>Programming using IOCTL to interface with Linux kernel drivers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/07/fun-stuff/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types</title>
		<link>http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/</link>
		<comments>http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 15:07:57 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=496</guid>
		<description><![CDATA[In part one of this series we covered making a basic &#8220;Hello World&#8221; plugin in Mono / C#. Today we are going to dive into different types of data, and how to define them. Show me part 1! Also if you thought part 1 was ugly, I added a new javascript syntax highlighter so I [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono'>Annoying people with code: A gentle introduction to C# and Mono</a></li>
<li><a href='http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program'>Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program</a></li>
<li><a href='http://www.sharms.org/blog/2009/05/creating-graphs-in-python/' rel='bookmark' title='Permanent Link: Creating graphs in python'>Creating graphs in python</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In part one of this series we covered making a basic &#8220;Hello World&#8221; plugin in Mono / C#.  Today we are going to dive into different types of data, and how to define them.   <a href="http://www.sharms.org/blog/2009/07/16/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/">Show me part 1!</a>  Also if you thought part 1 was ugly, I added a new javascript syntax highlighter so I recommend you read it on my blog instead of planet.ubuntu.com.</p>
<p><strong>Variables</strong><br />
A variable is something that stores a value.  In different programming languages, these are handled differently.  C# is called a static / strongly typed language as you have to tell it what variables are.  To explain, I will use python in comparison:</p>
<p><strong>Python Example</strong></p>
<pre class="brush: python">
x = &quot;This is a string&quot;
y = 5
</pre>
<p>As you can see, we didn&#8217;t have to tell Python anything about what type of variables they are.  In C# / Mono, we would do this like this:</p>
<p><strong>C# Example</strong></p>
<pre class="brush: csharp">
string x = &quot;This is a string&quot;;
int y = 5;
</pre>
<p>I will tell you, after my years of development, that I program a ton of stuff in PHP / Python today.  One of the worst and best parts of these languages is that they are dynamically typed.  The fact that C# requires variables to be declared with a type before using makes life easier for testing and reading.  There is a stack overflow post on what static typing gives you: <a href="http://stackoverflow.com/questions/859186/why-is-c-statically-typed">Read the stack overflow post.</a></p>
<p><strong>Variable Naming</strong><br />
Before we continue, you will notice in the top example I used the variable names x and y <em>(to illustrate that the variable names really mean nothing to the compiler / interpreter.  If I named them myString you might have been confused)</em>.  If you do this in real life, I will find you and give you a thorough verbal lashing.  I generally use camel case to name variables.  Just do not abbreviate them as it really serves no purpose, and makes a lot of pain for people besides yourself maintaining code.</p>
<p>You can read about <a href="http://en.wikipedia.org/wiki/CamelCase">camel case at wikipedia.</a></p>
<p><strong>The Source</strong><br />
For this program, I copied our HelloWorld.cs, and just modified it.  I also have a modified makefile.</p>
<p><strong>dataTypes.cs</strong></p>
<pre class="brush: csharp">
using System;

// We create a class to contain it
class dataTypes
{
    static void Main(string[] args)
    {
        // The type &#039;bool&#039; is always true or false
        bool isMonoTheOnlyPatentRisk = false;

        // To check if it is true or false in program code,
        // we can use an &#039;if statement&#039;
        if(isMonoTheOnlyPatentRisk)
        {
            Console.WriteLine(&quot;isMonoTheOnlyPatentRisk was set to true&quot;);
        } else
        {
            Console.WriteLine(&quot;isMonoTheOnlyPatentRisk was set to false&quot;);
        }

        // Note how I named the variables -
        // lowercaseFirstThenCapitalizeEachWorld
        // this is called camel case -- I first read about it
        // in a Charles Petzold book, but I am sure it
        // probably didn&#039;t originate there.  Either way its
        // how I code, I recommend you name variables
        // as descriptive as possible.

        // Note to only kids:  You will have the initial
        // reaction of saying: Why should I name stuff long?
        // That takes time and is stupid!
        // I used to be you 10 years ago, the problem is if
        // you need to use your code in several years of not
        // using it.  Your time will be completely wasted
        // figuring out what the heck is going on, despite
        // seeming so intuitive / easy to understand when you
        // did it

        // Integers store numbers
        int ourNumber = 5;

        // In most langauges we can evaluate these in
        // &#039;if statements&#039; like bools above, but if we try in
        // C# this will fail.  In C# a bool can only be 0 for
        // false, 1 for true, or we can use the
        // Convert.ToBoolean function like this:
        if(Convert.ToBoolean(ourNumber))
        {
            Console.WriteLine(&quot;ourNumber was not 0!&quot;);
        } else
        {
            Console.WriteLine(&quot;ourNumber was 0&quot;);
        }

        // Lets see if we can compare this number
        if(ourNumber &gt; 4)
        {
            Console.WriteLine(&quot;ourNumber was greater than 4&quot;);
        } else
        {
            Console.WriteLine(&quot;ourNumber was less than or equal to 4&quot;);
        }

        // Make a string, and output it
        string helloWorldVariable = &quot;Hello World!&quot;;
        Console.WriteLine(helloWorldVariable);
    }
}
</pre>
<p><strong>Makefile</strong></p>
<pre class="brush: sh">
COMPILER=gmcs

all: helloWorld.exe dataTypes.exe

helloWorld.exe: helloWorld.cs
	$(COMPILER) helloWorld.cs

dataTypes.exe: dataTypes.cs
	$(COMPILER) dataTypes.cs
clean:
	rm -f helloWorld.exe dataTypes.exe

.PHONY: all clean
</pre>
<p><strong>Output from our terminal</strong></p>
<pre class="brush: sh">
[sharms@sparrow mono]$ make
gmcs helloWorld.cs
gmcs dataTypes.cs
[sharms@sparrow mono]$ mono dataTypes.exe
isMonoTheOnlyPatentRisk was set to false
ourNumber was not 0!
ourNumber was greater than 4
Hello World!
</pre>
<p><strong>Bonus Tip</strong><br />
Did you notice in the first part the way I named the bool?  If you are programming, generally, your bool&#8217;s should start with &#8216;is&#8217;.  This becomes very important once you start making complex &#8216;if statements&#8217;.  Trust me on this one, it&#8217;s a habit you want.</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono'>Annoying people with code: A gentle introduction to C# and Mono</a></li>
<li><a href='http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program'>Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program</a></li>
<li><a href='http://www.sharms.org/blog/2009/05/creating-graphs-in-python/' rel='bookmark' title='Permanent Link: Creating graphs in python'>Creating graphs in python</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Annoying people with code: A gentle introduction to C# and Mono</title>
		<link>http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/</link>
		<comments>http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 20:32:01 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=493</guid>
		<description><![CDATA[This is meant to be an introduction to C# and Mono. First, we need to download the mono runtime and compiler: sudo apt-get install monodevelop mono-devel For the purpose of this post, we are just going to create a simple program which prints out the text &#8220;Hello World&#8221;. Go ahead and make a directory for [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types'>Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types</a></li>
<li><a href='http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program'>Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/finding-the-difference-between-two-files/' rel='bookmark' title='Permanent Link: Finding the difference between two files'>Finding the difference between two files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is meant to be an introduction to C# and Mono.   First, we need to download the mono runtime and compiler:</p>
<pre class="brush: sh">
sudo apt-get install monodevelop mono-devel
</pre>
<p>For the purpose of this post, we are just going to create a simple program which prints out the text &#8220;Hello World&#8221;.  Go ahead and make a directory for our project so we don&#8217;t make our home directory entirely too messy.  I just make a directory called &#8216;mono&#8217; under /home/sharms/mono for the duration of this post.</p>
<p>Go ahead and create a file called &#8216;helloWorld.cs&#8217;, and paste the following:</p>
<pre class="brush: csharp">
// Declare which namespace we want to use.
// This allows us to use Console.WriteLine
// instead of System.Console.WriteLine
// Basically like a python &#039;import&#039; statement, or a
// php &#039;include&#039; statement
using System;

// We create a class to contain it
class HelloWorld
{
    // Must have a main function as this is what is
    // first called when executing this
    static void Main()
    {
         // C# requires ; after statements
         // Actually output &quot;Hello World&quot;
        Console.WriteLine(&quot;Hello World&quot;);
    }
}
</pre>
<p>To compile it, run:</p>
<pre class="brush: sh">
gmcs helloWorld.cs
</pre>
<p>This will generate a file called &#8216;helloWorld.exe&#8217;.  To run it, type:</p>
<pre class="brush: sh">
mono helloWorld.exe
Hello World
</pre>
<p>And there you have it.  I also stumbled on a Makefile tutorial today, so we can make a simple make file (I won&#8217;t describe all of this, just look at how it&#8217;s used).  The tutorial is at: <a href="http://www.wlug.org.nz/MakefileHowto">http://www.wlug.org.nz/MakefileHowto</a></p>
<pre class="brush: sh">
[sharms@sparrow mono]$ cat Makefile
COMPILER=gmcs

all: helloWorld.exe

helloWorld.exe: helloWorld.cs
	$(COMPILER) helloWorld.cs

clean:
	rm -f helloWorld.exe

.PHONY: all clean
[sharms@sparrow mono]$ make
gmcs helloWorld.cs
[sharms@sparrow mono]$ make clean
rm -f helloWorld.exe
</pre>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono-part-2-data-types/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types'>Annoying people with code: A gentle introduction to C# and Mono Part 2 &#8211; Data Types</a></li>
<li><a href='http://www.sharms.org/blog/2009/07/creating-a-gui-graphical-mono-c-program/' rel='bookmark' title='Permanent Link: Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program'>Annoying people with code: A gentle introduction to C# and Mono Part 3: Creating a GUI (Graphical) Mono / C# Program</a></li>
<li><a href='http://www.sharms.org/blog/2009/02/finding-the-difference-between-two-files/' rel='bookmark' title='Permanent Link: Finding the difference between two files'>Finding the difference between two files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/07/annoying-people-with-code-a-gentle-introduction-to-c-and-mono/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

