<?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; tutorial</title>
	<atom:link href="http://www.sharms.org/blog/tag/tutorial/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>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>
		<item>
		<title>Make your bash shell cool again</title>
		<link>http://www.sharms.org/blog/2009/03/make-your-bash-shell-cool-again/</link>
		<comments>http://www.sharms.org/blog/2009/03/make-your-bash-shell-cool-again/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 14:46:53 +0000</pubDate>
		<dc:creator>sharms</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=369</guid>
		<description><![CDATA[I originally wrote a spec in 2006, but it never actually made it in.Â  You can see it at https://wiki.ubuntu.com/Spec/EnhancedBash .Â  The good news is, it is just as relevant today. Hopefully these tips will make your life easier, I use them on all of my systems. Use the page up key to complete the [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/04/looking-for-help/' rel='bookmark' title='Permanent Link: Looking for help'>Looking for help</a></li>
<li><a href='http://www.sharms.org/blog/2008/04/bash-frequently-used-commands/' rel='bookmark' title='Permanent Link: Bash frequently used commands'>Bash frequently used commands</a></li>
<li><a href='http://www.sharms.org/blog/2009/03/quick-tip-counting-lines-of-code/' rel='bookmark' title='Permanent Link: Quick tip: Counting lines of code'>Quick tip: Counting lines of code</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I originally wrote a spec in 2006, but it never actually made it in.Â  You can see it at <a href="https://wiki.ubuntu.com/Spec/EnhancedBash" target="_blank">https://wiki.ubuntu.com/Spec/EnhancedBash</a> .Â  The good news is, it is just as relevant today.  Hopefully these tips will make your life easier, I use them on all of my systems.</p>
<p><strong>Use the page up key to complete the command</strong><br />
What this does is, if I type &#8216;ssh &#8216; then hit the page-up key, it will complete the line to the last time in my history file that I typed ssh.  Hitting page up again will go to the 2nd to last time I typed it.  Incredibly handy if you ever type the same commands more than once.  This actually has been the default of SUSE based distributions for quite some time.</p>
<p><code><br />
echo "\"\e[5~\": history-search-backward" >> ~/.inputrc<br />
echo "\"\e[6~\": history-search-forward" >> ~/.inputrc<br />
</code></p>
<p><strong>Increase history size</strong><br />
Now that you have the pageup / pagedown bindings to auto-complete your history, you are going to want to store more of it.  You can store the previous 1000 commands using this.</p>
<p><code><br />
echo "export HISTSIZE=1000" >> ~/.bashrc<br />
echo "export HISTFILESIZE=1000" >> ~/.bashrc<br />
</code></p>
<p><strong>Color grep</strong><br />
Using the following bash alias, you can make grep highlight the word it is matching in color.  I grep about 10000 times a day, so this makes it a bit easier on my eyes to focus where I need to:</p>
<p><code><br />
echo "export GREP_OPTIONS='--color=auto'" >> ~/.bashrc<br />
</code></p>
<p><strong>Command matching</strong><br />
There was also someone who contributed more sane command matching (ie what happens when you hit the tab key a bunch).  I use these also, which tell it not to do stupid things like try to match hidden files and to display both files if they are ambiguous:</p>
<p><code><br />
echo "set match-hidden-files off" >> ~/.inputrc<br />
echo "set page-completions off" >> ~/.inputrc<br />
echo "set completion-query-items 350" >> ~/.inputrc<br />
echo "set show-all-if-ambiguous on" >> ~/.inputrc<br />
</code></p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/04/looking-for-help/' rel='bookmark' title='Permanent Link: Looking for help'>Looking for help</a></li>
<li><a href='http://www.sharms.org/blog/2008/04/bash-frequently-used-commands/' rel='bookmark' title='Permanent Link: Bash frequently used commands'>Bash frequently used commands</a></li>
<li><a href='http://www.sharms.org/blog/2009/03/quick-tip-counting-lines-of-code/' rel='bookmark' title='Permanent Link: Quick tip: Counting lines of code'>Quick tip: Counting lines of code</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2009/03/make-your-bash-shell-cool-again/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Old dog, new trick</title>
		<link>http://www.sharms.org/blog/2008/10/old-dog-new-trick/</link>
		<comments>http://www.sharms.org/blog/2008/10/old-dog-new-trick/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 01:15:30 +0000</pubDate>
		<dc:creator>Steven Harms</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.sharms.org/blog/?p=225</guid>
		<description><![CDATA[I commonly have 4-6 ssh sessions open at once, and when I lose my VPN connection, they just sit there until their timeout hits. I was looking for a way to stop the session, and CTRL-C, CTRL-D, CTRL-Z and everything inbetween didn&#8217;t work. I found salvation in: &#8216;~.&#8217; That will exit your session no problem. [...]


Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/04/motu/' rel='bookmark' title='Permanent Link: MOTU'>MOTU</a></li>
<li><a href='http://www.sharms.org/blog/2009/05/cherokee-django-tip-timeout-value/' rel='bookmark' title='Permanent Link: Cherokee / Django tip: Timeout value'>Cherokee / Django tip: Timeout value</a></li>
<li><a href='http://www.sharms.org/blog/2011/02/gitorious-and-fully-qualified-domain-names-fqdn/' rel='bookmark' title='Permanent Link: Gitorious and Fully Qualified Domain Names (FQDN)'>Gitorious and Fully Qualified Domain Names (FQDN)</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I commonly have 4-6 ssh sessions open at once, and when I lose my VPN connection, they just sit there until their timeout hits.  I was looking for a way to stop the session, and CTRL-C, CTRL-D, CTRL-Z and everything inbetween didn&#8217;t work.</p>
<p>I found salvation in: &#8216;~.&#8217;</p>
<p>That will exit your session no problem.</p>


<p>Related posts:<ol><li><a href='http://www.sharms.org/blog/2007/04/motu/' rel='bookmark' title='Permanent Link: MOTU'>MOTU</a></li>
<li><a href='http://www.sharms.org/blog/2009/05/cherokee-django-tip-timeout-value/' rel='bookmark' title='Permanent Link: Cherokee / Django tip: Timeout value'>Cherokee / Django tip: Timeout value</a></li>
<li><a href='http://www.sharms.org/blog/2011/02/gitorious-and-fully-qualified-domain-names-fqdn/' rel='bookmark' title='Permanent Link: Gitorious and Fully Qualified Domain Names (FQDN)'>Gitorious and Fully Qualified Domain Names (FQDN)</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.sharms.org/blog/2008/10/old-dog-new-trick/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

