<?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>Coding Friends &#187; Linux</title>
	<atom:link href="http://www.codingfriends.com/index.php/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codingfriends.com</link>
	<description>Coding Friends, place for developers.</description>
	<lastBuildDate>Sun, 04 Dec 2011 21:11:08 +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>Node &#8211; install and test</title>
		<link>http://www.codingfriends.com/index.php/2011/11/03/node-install-and-test/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=node-install-and-test</link>
		<comments>http://www.codingfriends.com/index.php/2011/11/03/node-install-and-test/#comments</comments>
		<pubDate>Thu, 03 Nov 2011 20:44:12 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[Windows install and configuration]]></category>
		<category><![CDATA[node]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=1752</guid>
		<description><![CDATA[One of my friends asked me what is Node and also how do you install and test to make sure it is working. Well, Node is in essence a javascript server side environment that allows you to write code that will allow the event model to handle requests very quickly since it does not handle [...]]]></description>
			<content:encoded><![CDATA[<p>One of my friends asked me what is Node and also how do you install and test to make sure it is working.</p>
<p>Well, <a href="http://nodejs.org/" title="Node" target="_blank">Node</a> is in essence a javascript server side environment that allows you to write code that will allow the event model to handle requests very quickly since it does not handle the I/O (well almost of all of the functions within node do not!) so there is no-blocking of code.</p>
<p>Node has a very quick and capable http class that allows for the user to create a server that is capable of doing some very quick responses to multiple connections.  </p>
<p>To install Node you just need to do this in ubuntu</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #660033;">-s</span>
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> python-software-properties
add-apt-repository ppa:chris-lea<span style="color: #000000; font-weight: bold;">/</span>node.js
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> nodejs
<span style="color: #7a0874; font-weight: bold;">exit</span></pre></div></div>

<p>the first line allows you to be the root and thus the next commands are as the user root.</p>
<p>Or if you are using windows just download the executable from <a href="http://nodejs.org/#download">here</a></p>
<p>To test the node to make sure it is working with a basic &#8220;Hello world!&#8221; example if you save this below as helloworld.js.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> http <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// create the http server function req'uest, res'ult</span>
http.<span style="color: #660066;">createServer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>req<span style="color: #339933;">,</span> res<span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// 200 = means http response code of found page, then a array of the content type</span>
    res.<span style="color: #660066;">writeHead</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'Content-Type'</span> <span style="color: #339933;">:</span> <span style="color: #3366CC;">'text/plain'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    res.<span style="color: #660066;">end</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hello world!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #006600; font-style: italic;">// write out the text</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">8080</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'127.0.0.1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// listen on port 8080 on the ip address 127.0.0.1</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'We have started, check your browser on http://127.0.0.1:8080/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>I am using a higher number than 1024 for the port because below that you need to be a root user or administrator on windows to allow anything to connect to those port numbers.  </p>
<p>So if you now run the program with the javascript file above as the second parameter</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">node helloworld.js</pre></div></div>

<p>and then if you open your browser at 127.0.0.1:8080  then you will see </p>
<p>Hello world!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2011/11/03/node-install-and-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu upgrade server to the latest version</title>
		<link>http://www.codingfriends.com/index.php/2011/11/02/ubuntu-upgrade-server-to-the-latest-version/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ubuntu-upgrade-server-to-the-latest-version</link>
		<comments>http://www.codingfriends.com/index.php/2011/11/02/ubuntu-upgrade-server-to-the-latest-version/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 20:20:19 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[Ubuntu/Kubuntu]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=1749</guid>
		<description><![CDATA[As normal with most of the ubuntu / linux setups, it is easy to upgrade to the latest version and with the ubuntu server being on the command line you just need to run the commmand do-release-upgrade and it will update to the latest version of ubuntu, how simple is that.]]></description>
			<content:encoded><![CDATA[<p>As normal with most of the ubuntu / linux setups, it is easy to upgrade to the latest version and with the ubuntu server being on the command line you just need to run the commmand</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">do-release-upgrade</pre></div></div>

<p>and it will update to the latest version of ubuntu, how simple is that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2011/11/02/ubuntu-upgrade-server-to-the-latest-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X session cannot start /tmp</title>
		<link>http://www.codingfriends.com/index.php/2011/03/08/x-session-cannot-start-tmp/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=x-session-cannot-start-tmp</link>
		<comments>http://www.codingfriends.com/index.php/2011/03/08/x-session-cannot-start-tmp/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 22:47:32 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux install and configurations]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=1561</guid>
		<description><![CDATA[If you get a error like Error: X session cannot start /tmp Error: unable to write to the /tmp or similar errors to the above when trying to log into KDE it could be because you have run out of inodes (the disk structure that allows you to create new files) or hard drive space. [...]]]></description>
			<content:encoded><![CDATA[<p>If you get a error like</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Error: X session cannot start <span style="color: #000000; font-weight: bold;">/</span>tmp 
Error: unable to <span style="color: #c20cb9; font-weight: bold;">write</span> to the <span style="color: #000000; font-weight: bold;">/</span>tmp</pre></div></div>

<p>or similar errors to the above when trying to log into KDE</p>
<p>it could be because you have run out of inodes (the disk structure that allows you to create new files) or hard drive space.</p>
<p>I had this same problem, and after doing</p>

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

<p>to clean out of the temporary files that apt-get has used</p>
<p>and also since I am compiling up my own kernels, I deleted some of the</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src 
&nbsp;
linux-source
linux-source-2.6.32</pre></div></div>

<p>directories and then I was able to start up X, which is great.. something of a better error would have been better.. cannot create file, make sure that you have the space!!. sort of thing..</p>
<p>also sometimes if your X session does not start, if you delete your home directory (The user&#8217;s home directory that you are trying to login to) .Xauthority</p>
<p>e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> ~<span style="color: #000000; font-weight: bold;">/</span>.Xauthority</pre></div></div>

<p>because that is sometimes a lock on the xsession.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2011/03/08/x-session-cannot-start-tmp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rewrite Engine</title>
		<link>http://www.codingfriends.com/index.php/2011/03/08/rewrite-engine/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rewrite-engine</link>
		<comments>http://www.codingfriends.com/index.php/2011/03/08/rewrite-engine/#comments</comments>
		<pubDate>Tue, 08 Mar 2011 22:45:32 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[RewriteEngine]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=1558</guid>
		<description><![CDATA[Because I own the codingfriends.co.uk, but would like to point that to the www.codingfriends.com Here is a good way to make it so that any requests to the domain name codingfriends.co.uk (rewrite condition of the host record) will redirect to www.codingfriends.com with a redirection of HTTP 301 (moved permanently). RewriteEngine On RewriteCond ${HTTP_HOST} !^(www)\.codingfriends\.co\.uk RewriteRule [...]]]></description>
			<content:encoded><![CDATA[<p>Because I own the codingfriends.co.uk, but would like to point that to the www.codingfriends.com </p>
<p>Here is a good way to make it so that any requests to the domain name codingfriends.co.uk (rewrite condition of the host record) will redirect to www.codingfriends.com with a redirection of HTTP 301 (moved permanently).</p>

<div class="wp_syntax"><div class="code"><pre class="script" style="font-family:monospace;">RewriteEngine On
RewriteCond ${HTTP_HOST} !^(www)\.codingfriends\.co\.uk 
RewriteRule (.*) http://www.codingfriends.com/$1 [L,R=301]</pre></div></div>

<p>Save that to the .htaccess root directory file.  Hope that helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2011/03/08/rewrite-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>upstart &#8211; emit &#8211; start on network</title>
		<link>http://www.codingfriends.com/index.php/2010/04/22/upstart-emit-start-on-network/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=upstart-emit-start-on-network</link>
		<comments>http://www.codingfriends.com/index.php/2010/04/22/upstart-emit-start-on-network/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 21:07:06 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[upstart]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=904</guid>
		<description><![CDATA[I have been reading some of the funky things in ubuntu implementations that has been happening in the distribution. One of the things that I like is the upstart, this changes the way that init (the process of the computer system from boot to console/GUI for creating the different runlevels ). In essence, it replaces [...]]]></description>
			<content:encoded><![CDATA[<p>I have been reading some of the funky things in <a href="http://www.ubuntu.com/">ubuntu</a> implementations that has been happening in the distribution.  One of the things that I like is the <a href="http://upstart.ubuntu.com">upstart</a>, this changes the way that init (the process of the computer system from boot to console/GUI for creating the different <a href="http://en.wikipedia.org/wiki/Runlevel">runlevels</a> ).</p>
<p>In essence, it replaces the /sys/init daemon which handles the start up and shutting down, looking after tasks/services during boot/running and shutdown.</p>
<p>One of the things that is great is that the upstart will &#8220;emit&#8221; and signal to other services to &#8220;start on&#8221; when that signal has been emitted, to demonstrate this when a network card is activated for the Ethernet (for example) in the &#8220;/etc/network/if-up.d/upstart&#8221;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">initctl emit <span style="color: #660033;">-n</span> net-device-up \</pre></div></div>

<p>which basically says when a network device because in a state of up emit a signal, the state of being up is when the device is active.  Then in the /etc/init/mountall-net.conf file</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">description     <span style="color: #ff0000;">&quot;Mount network filesystems&quot;</span>
&nbsp;
start on net-device-up</pre></div></div>

<p>is listening for the emitted signal of net-device-up and thus the upstart will start the networking filesystems.</p>
<p>Another example is within the /etc/init/mountall.conf there is the emitting of a signal</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mountall.conf:emits virtual-filesystems</pre></div></div>

<p>the signal is virtual-filesystems which is then picked up with the udev.conf with the</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">start on virtual-filesystems</pre></div></div>

<p>since udev is a virtual filesystem in the /dev and /sys directories.</p>
<p>I find the stuff that <a href="http://www.canonical.com/">Canonical</a> is doing with the ubuntu linux distribution is just great.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2010/04/22/upstart-emit-start-on-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone &#8211; Linux &#8211; iTunes it works</title>
		<link>http://www.codingfriends.com/index.php/2010/04/19/iphone-linux-itunes-it-works/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=iphone-linux-itunes-it-works</link>
		<comments>http://www.codingfriends.com/index.php/2010/04/19/iphone-linux-itunes-it-works/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 11:06:30 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[3GS]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[iTunes]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=891</guid>
		<description><![CDATA[I have been using gtkPod and also amarok, but sometimes I just missed that iTunes interface to sync with my iPhone 3GS (16GB). Well, with using the virtual box ( you will need to get the Sun version and not the OSE (open source edition) because the Sun edition has the USB parts) Then I [...]]]></description>
			<content:encoded><![CDATA[<p>I have been using <a href="http://www.gtkpod.org/about.html">gtkPod</a> and also <a href="http://amarok.kde.org/">amarok</a>, but sometimes I just missed that iTunes interface to sync with my iPhone 3GS (16GB).</p>
<p>Well, with using the <a href="http://www.virtualbox.org">virtual box</a> ( you will need to get the <a href="http://www.virtualbox.org/wiki/Linux_Downloads">Sun version</a> and not the OSE (open source edition) because the Sun edition has the USB parts)</p>
<p>Then I booted up the virtualbox with a Windows OS, and installed the <a href="http://www.apple.com/itunes/download/">iTunes</a>  I was able to sort out my iPhone in the apple way!!.</p>
<p>It is still kinder annoying that apple are not making iTunes for Linux, but with this setup at least I am able to still use the iTunes interface with my phone and sync correctly.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2010/04/19/iphone-linux-itunes-it-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mono &#8211; web development on Linux</title>
		<link>http://www.codingfriends.com/index.php/2010/04/14/mono-web-development-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mono-web-development-on-linux</link>
		<comments>http://www.codingfriends.com/index.php/2010/04/14/mono-web-development-on-linux/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 09:38:45 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[C Sharp (c#)]]></category>
		<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[Apache2]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[web server]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=873</guid>
		<description><![CDATA[It is really easy to get some web c# (csharp) (asp.net) development within a Linux setup, since I use kubuntu which is derived from ubuntu. All you need to do is to this installs the mono module for the apache2 aptitude install libapache2-mod-mono to enable the module to work within apache2 you have to update [...]]]></description>
			<content:encoded><![CDATA[<p>It is really easy to get some web c# (csharp) (asp.net) development within a Linux setup, since I use kubuntu which is derived from ubuntu.  All you need to do is to</p>
<p>this installs the mono module for the apache2</p>

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

<p>to enable the module to work within apache2 you have to update the mods-enabled directory and to do this, just use the</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">a2enmod mod_mono_auto</pre></div></div>

<p>which stands for apache2 (a2) enable (en) mod (module) and then the module name, you will need to restart apache2 for it to work</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></div></div>

<p>that is it., then if you look within the /etc/apache2/mods-enabled you will notice the</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mod_mono_auto.conf
mod_mono_auto.load</pre></div></div>

<p>of course you could symlink them yourself, but it is just easier to use the a2enmod script.</p>
<p>Within the .conf file it tells apache what extensions to &#8220;listen&#8221; to direct to the module mono instead of either php module or just a static html web page.</p>
<p>To test the setup, just create a directory within your hosting directory this is normally /var/www/ or just place a file in that base directory /var/www it is up to you, but within that file you could create a basic test file like.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;%</span>@ Page Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> <span style="color: #008000;">%&gt;</span>
<span style="color: #008000;">&lt;</span>html<span style="color: #008000;">&gt;</span>
  <span style="color: #008000;">&lt;</span>head<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;</span>title<span style="color: #008000;">&gt;</span>Apache2 Mod mono test page<span style="color: #008000;">&lt;/</span>title<span style="color: #008000;">&gt;</span>
  <span style="color: #008000;">&lt;/</span>head<span style="color: #008000;">&gt;</span>
  <span style="color: #008000;">&lt;</span>body<span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;</span>form id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;form1&quot;</span> runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>
          <span style="color: #008000;">&lt;</span>asp<span style="color: #008000;">:</span>label id<span style="color: #008000;">=</span><span style="color: #666666;">&quot;lbl1&quot;</span> runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>Apache2 Mod mono test page<span style="color: #008000;">&lt;/</span>asp<span style="color: #008000;">:</span>label<span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;/</span>form<span style="color: #008000;">&gt;</span>
  <span style="color: #008000;">&lt;/</span>body<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;/</span>html<span style="color: #008000;">&gt;</span></pre></div></div>

<p>the asp:label will be the main test, since that part of the csharp library as such. you should see something like</p>
<p>Apache2 Mod mono test page</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2010/04/14/mono-web-development-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

