<?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>Virtual Clouds &#187; linux</title>
	<atom:link href="http://www.virtual-clouds.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.virtual-clouds.com</link>
	<description>Erlang and Other Animals</description>
	<lastBuildDate>Mon, 19 Jul 2010 17:42:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>perl one liners = magic</title>
		<link>http://www.virtual-clouds.com/2009/10/81/magic-perl-one-liners/</link>
		<comments>http://www.virtual-clouds.com/2009/10/81/magic-perl-one-liners/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 22:41:24 +0000</pubDate>
		<dc:creator>ofer affias</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.virtual-clouds.com/?p=81</guid>
		<description><![CDATA[a word about the power of unix shell commands: perl one liners, i.e. one line of perl that can save you hours of error-prone hand changes. when i want to do some massive changes in my code this is what i use. say you need replcae a record name from abc_record to xyz_record, first if <a href='http://www.virtual-clouds.com/2009/10/81/magic-perl-one-liners/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.virtual-clouds.com/wp-content/uploads/2009/10/perl-150x150.jpg" alt="perl" title="perl" width="150" height="150" class="alignleft size-thumbnail wp-image-89" />a word about the power of unix shell commands: perl one liners, i.e. one line of <a href="http://www.perl.org/">perl</a> that can save you hours of error-prone hand changes. when i want to do some massive changes in my code this is what i use.</p>
<p>say you need replcae a record name from abc_record to xyz_record, first if you use perl recursivlly it will touch all files and revision control will makr them for commit. you don&#8217;t want that. so use grep to filter the relevant files:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;#abc_record\b&quot;</span> . <span style="color: #660033;">-rl</span></pre></div></div>

<p>next, do the replace:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-pe</span> s<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;#abc_record\b&quot;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;xyz_record&quot;</span><span style="color: #000000; font-weight: bold;">/</span>g <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;#abc_record\b&quot;</span> src -rl<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>note the use of \b to mark a word boundary.</p>
<p>a more complex replace is if you need to change the code from using a record to use a wrapper function. so for exmaple we have the record:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #014ea4;">-</span><span style="color: #5400b3;">record</span><span style="color: #109ab8;">&#40;</span><span style="color: #d400ed;">abc_record</span><span style="color: #6bb810;">,</span> <span style="color: #109ab8;">&#123;</span>fld<span style="color: #109ab8;">&#125;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span></pre></div></div>

<p>and we want to start use a wrapper module:</p>

<div class="wp_syntax"><div class="code"><pre class="erlang" style="font-family:monospace;"><span style="color: #014ea4;">-</span><span style="color: #5400b3;">module</span><span style="color: #109ab8;">&#40;</span>rtools<span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
<span style="color: #014ea4;">-</span><span style="color: #5400b3;">export</span><span style="color: #109ab8;">&#40;</span><span style="color: #109ab8;">&#91;</span>fld<span style="color: #014ea4;">/</span><span style="color: #ff9600;">1</span><span style="color: #109ab8;">&#93;</span><span style="color: #109ab8;">&#41;</span><span style="color: #6bb810;">.</span>
&nbsp;
<span style="color: #ff3c00;">fld</span><span style="color: #109ab8;">&#40;</span><span style="color: #45b3e6;">R</span><span style="color: #109ab8;">&#41;</span> <span style="color: #6bb810;">-&gt;</span> <span style="color: #45b3e6;">R</span><span style="color: #ff9600;">#</span><span style="color: #d400ed;">abc_record</span><span style="color: #6bb810;">.</span>fld<span style="color: #6bb810;">.</span></pre></div></div>

<p>so we can do it instantly like that:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-pe</span> s<span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;\b(\w+)#abc_record\.fld&quot;</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #ff0000;">&quot;rtools:fld(\1)&quot;</span><span style="color: #000000; font-weight: bold;">/</span>g <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;#abc_record\.fld&quot;</span> src -rl<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>here we have switched from using A#abc_record.fld to record_tools:fld(A)</p>
<p>another trick is to remove complete lines (!), so for exmaple you can get rid of all the -compile(export_all) you have fullishly inserted into your code:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-i</span> <span style="color: #660033;">-nle</span> <span style="color: #ff0000;">'print if !/-compile\(export_all\)/'</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">grep</span> export_all src -rl<span style="color: #000000; font-weight: bold;">`</span></pre></div></div>

<p>one safty tip, omit the -i first to try before you actuall change files.</p>
<p>this was just a learn-by-example, more info can be found at:<br />
<a href="http://sial.org/howto/perl/one-liner">http://sial.org/howto/perl/one-liner</a><br />
<a href="http://www.unixguide.net/unix/perl_oneliners.shtml">http://www.unixguide.net/unix/perl_oneliners.shtml</a>	</p>
]]></content:encoded>
			<wfw:commentRss>http://www.virtual-clouds.com/2009/10/81/magic-perl-one-liners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>yet another colinux instructions</title>
		<link>http://www.virtual-clouds.com/2009/02/54/yet-another-colinux-instructions/</link>
		<comments>http://www.virtual-clouds.com/2009/02/54/yet-another-colinux-instructions/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 23:57:15 +0000</pubDate>
		<dc:creator>ofer affias</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.virtual-clouds.com/?p=54</guid>
		<description><![CDATA[i hope this is my last post on colinux and erlang, but although i had written several time about it, i will do it once more, to sum up a little guide to setup a new colinux with the correct way to set erlang on it. i also added few words on adding the nitrogen <a href='http://www.virtual-clouds.com/2009/02/54/yet-another-colinux-instructions/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.virtual-clouds.com/wp-content/uploads/2009/02/colinux-smalllogo1.png" alt="colinux" title="colinux" width="150" height="150" class="alignleft size-full wp-image-94" />i hope this is my last post on colinux and erlang, but although i had written several time about it, i will do it once more, to sum up a little guide to setup a new colinux with the correct way to set erlang on it. i also added few words on adding the <strong>nitrogen</strong> web framework.</p>
<p><em>&gt; is used for windows command prompt</em><br />
<em>$ is used for linux shell prompt</em></p>
<h3> ubuntu 8.04 server </h3>
<ul>
<li> direct download &#8211; <a href="http://ie.releases.ubuntu.com/hardy/ubuntu-8.04.2-server-i386.iso"> http://ie.releases.ubuntu.com/hardy/ubuntu-8.04.2-server-i386.iso</a></li>
<li> or using bittorrent &#8211; <a href="http://releases.ubuntu.com/8.04.2/ubuntu-8.04.2-server-	i386.iso.torrent">http://releases.ubuntu.com/8.04.2/ubuntu-8.04.2-server-i386.iso.torrent</a></li>
<li> put the final iso file on a new directory c:\linux\distro</li>
</ul>
<h3> qemu </h3>
<ul>
<li> direct download &#8211; <a href="http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-0.9.0-windows.zip">http://www.h6.dion.ne.jp/~kazuw/qemu-win/qemu-0.9.0-windows.zip</a></li>
<li> extract qemu into a new directory c:\linux\qemu</li>
<li> start windows command prompt</li>
<li> make a 3gb image:

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"> &gt; fsutil file createnew c:\linux\distro\qemu_ubuntu_3gb <span style="color: #cc66cc;">3221257728</span></pre></div></div>

</li>
<li> make a image for a 512mb swap file:

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"> &gt; fsutil file createnew c:\linux\distro\qemu_swap_512mb <span style="color: #cc66cc;">536903168</span></pre></div></div>

</li>
<li> on c:\linux\qemu create the next batch file: install.bat, whith the following content:

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"><span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">ECHO</span> OFF
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">qemu_dir</span>=C:\linux\distro
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">hd</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">qemu_dir</span><span style="color: #33cc33;">%</span>\qemu_ubuntu_3gb
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">swap</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">qemu_dir</span><span style="color: #33cc33;">%</span>\qemu_swap_512mb
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">cdrom</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">qemu_dir</span><span style="color: #33cc33;">%</span>\ubuntu-8.04.2-server-i386.iso
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">mem</span>=<span style="color: #cc66cc;">384</span>
qemu -hda <span style="color: #33cc33;">%</span><span style="color: #448888;">hd</span><span style="color: #33cc33;">%</span> -hdb <span style="color: #33cc33;">%</span><span style="color: #448888;">swap</span><span style="color: #33cc33;">%</span> -cdrom <span style="color: #33cc33;">%</span><span style="color: #448888;">cdrom</span><span style="color: #33cc33;">%</span> -m <span style="color: #33cc33;">%</span><span style="color: #448888;">mem</span><span style="color: #33cc33;">%</span> -boot d -L .
<span style="color: #b1b100; font-weight: bold;">pause</span></pre></div></div>

</li>
<li> run the batch file you have just created: install.bat</li>
<li> go through the linux installation, select manually partition when asked, and do the following:
<ul>
<li>create new partitionchoose /dev/sda</li>
<li>choose create as: primary partition</li>
<li>choose file system: ext3</li>
<li>create new partitionchoose /dev/sdb</li>
<li>choose create as: primary partition</li>
<li>choose file system: linux-swap</li>
</ul>
</li>
<li> install, and when you get to the point it asks for restart &#8211; you have finished. it takes some time, so be patient.</li>
</ul>
<h3> colinux </h3>
<ul>
<li> direct download &#8211; <a href="http://downloads.sourceforge.net/colinux/coLinux-0.7.3.exe">http://downloads.sourceforge.net/colinux/coLinux-0.7.3.exe</a></li>
<li> run and install on c:\colinux</li>
<li> don&#8217;t use or download any of the suggested distributions on the install process</li>
<li> download and install unxutils &#8211; <a href="http://gnuwin.epfl.ch/apps/unxutils/en/install/">http://gnuwin.epfl.ch/apps/unxutils/en/install/</a></li>
<li> convert qemu ubuntu image to colinux image

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"> &gt; <span style="color: #b1b100; font-weight: bold;">cd</span> c:\linux\distro
 &gt; dd <span style="color: #00b100; font-weight: bold;">if</span>=qemu_ubuntu_3gb of=ubuntu_3gb.img bs=<span style="color: #cc66cc;">512</span> skip=<span style="color: #cc66cc;">63</span></pre></div></div>

</li>
<li> you only need the file ubuntu_3gb.img the other 2 files (qemu_swap_512mb and qemu_ubuntu_3gb) can be removed</li>
<li> create new swap file:

<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:monospace;"> &gt; fsutil file createnew c:\linux\distro\swap_512mb <span style="color: #cc66cc;">536870912</span></pre></div></div>

</li>
<li> create a file on c:\linux\distro named ubuntu8.04.conf, and paste the following into it:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">kernel=vmlinux
sda1=&quot;c:\linux\distro\ubuntu-8.04.2-server-i386.ext3.3gb.img&quot;
sdb1=&quot;c:\linux\distro\swap_512mb&quot;
root=/dev/sda1 fastboot 3
ro
mem=384
eth0=slirp
eth1=tuntap</pre></div></div>

</li>
<li> create a shortcut for colinux-daemon.exe, right click on it and edit its properties, to add the following parameters (on the shortcut target field):<br />
c:\colinux\colinux-daemon.exe -t nt @c:\linux\distro\ubuntu8.04.conf</li>
<li> start this new shortcut, running the colinux the first time</li>
<li> edit /etc/network/interfaces and the windows tap connection, see my previous post named colinux</li>
<li> install ssh and update:

<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: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade
$ <span style="color: #c20cb9; font-weight: bold;">chsh</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> user_name</pre></div></div>

</li>
<li> connect using putty to 192.168.37.20:22</li>
</ul>
<h3> compress and backup the colinux image </h3>
<ul>
<li> to determine the free space in megabytes

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">df</span> <span style="color: #660033;">-m</span></pre></div></div>

</li>
<li> fill image with zeros

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;"><span style="color: #000000; font-weight: bold;">if</span></span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>zero <span style="color: #007800;">of</span>=foobar <span style="color: #007800;">bs</span>=1M <span style="color: #007800;">count</span>=<span style="color: #ff0000;">'above result less 5'</span>
$ <span style="color: #c20cb9; font-weight: bold;">rm</span> foobar</pre></div></div>

</li>
<li> logout, and compress from windows using a compression app, should get around 100MB file</li>
</ul>
<h3> install erlang from source </h3>

<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: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libncurses5-dev
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">m4</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libssl-dev
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> openssl
&nbsp;
$ <span style="color: #7a0874; font-weight: bold;">cd</span>; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> workspace; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">!</span>
$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.erlang.org<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>otp_src_R12B-5.tar.gz
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz otp_src_R12B-5.tar.gz
$ <span style="color: #7a0874; font-weight: bold;">cd</span> otp_src_R12B-<span style="color: #000000;">5</span>
$ .<span style="color: #000000; font-weight: bold;">/</span>configure
$ <span style="color: #c20cb9; font-weight: bold;">make</span>
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

<h3> install some basics </h3>

<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: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> git subversion ctags <span style="color: #c20cb9; font-weight: bold;">vim</span></pre></div></div>

<h3> setup environment</h3>
<p>edit .bash_profile, and add the following at the bottom</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ERL_LIBS</span>=<span style="color: #800000;">${HOME}</span><span style="color: #000000; font-weight: bold;">/</span>erlang<span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

<h3> download and install nitrogen </h3>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span>; <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> erlang<span style="color: #000000; font-weight: bold;">/</span>lib; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">!</span>$
$ git clone git:<span style="color: #000000; font-weight: bold;">//</span>github.com<span style="color: #000000; font-weight: bold;">/</span>rklophaus<span style="color: #000000; font-weight: bold;">/</span>nitrogen.git
$ <span style="color: #7a0874; font-weight: bold;">cd</span> nitrogen
$ <span style="color: #c20cb9; font-weight: bold;">make</span></pre></div></div>

<p></br>done</p>
]]></content:encoded>
			<wfw:commentRss>http://www.virtual-clouds.com/2009/02/54/yet-another-colinux-instructions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>colinux strikes back</title>
		<link>http://www.virtual-clouds.com/2009/01/49/colinux-strikes-back/</link>
		<comments>http://www.virtual-clouds.com/2009/01/49/colinux-strikes-back/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 23:30:38 +0000</pubDate>
		<dc:creator>ofer affias</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.virtual-clouds.com/?p=49</guid>
		<description><![CDATA[because the colinux images are very old, i have decided to build one of my own, based on ubuntu 8.10. so, i followed this post, to create my colinux image. keep in mind installing ubuntu using qemu on windows takes ages (really, few hours, so schedule it to an hour before you go to sleep). <a href='http://www.virtual-clouds.com/2009/01/49/colinux-strikes-back/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>because the colinux images are very old, i have decided to build one of my own, based on ubuntu 8.10. so, i followed this <a href="http://colinux.wikia.com/wiki/Ubuntu61">post</a>, to create my colinux image. keep in mind installing ubuntu using qemu on windows takes ages (really, few hours, so schedule it to an hour before you go to sleep).</p>
<p>later, i just added another conf file to start this colinux, see more details on me previous post:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">kernel=vmlinux
sda1=&quot;c:\linux\distro\ubuntu_8.10.ext3.3gb.img&quot;
sda2=&quot;c:\linux\distro\ext3_disk_1gb.img&quot;
sdb1=&quot;c:\linux\distro\swap_512mb&quot;
root=/dev/sda1 fastboot 3
ro
mem=384
eth0=slirp
eth1=tuntap</pre></div></div>

<p>moreover, i edited the network and samba, again, as i posted before. afterward i have installed erlang and yaws. finally, few fixes and tweaks i have encountered.</p>
<p>because i want it as a server:</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: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> linux-headers-server linux-image-server linux-server</pre></div></div>

<p>to solve and odd error message on startup (mmap: Bad address):</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: #c20cb9; font-weight: bold;">apt-get</span> remove dmidecode <span style="color: #660033;">--purge</span></pre></div></div>

<p>to prevent yaws, and few other services i don&#8217;t need to start after boot:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> bluetooth remove
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> gdm remove
$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d <span style="color: #660033;">-f</span> yaws remove</pre></div></div>

<p>that&#8217;s it! if you got so far, you are now officialy an uber-geek <img src='http://www.virtual-clouds.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.virtual-clouds.com/2009/01/49/colinux-strikes-back/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>colinux</title>
		<link>http://www.virtual-clouds.com/2008/11/35/colinux/</link>
		<comments>http://www.virtual-clouds.com/2008/11/35/colinux/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 23:15:01 +0000</pubDate>
		<dc:creator>ofer affias</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.virtual-clouds.com/?p=35</guid>
		<description><![CDATA[every now and then i want the linux power on my windows. i tried all the workarounds: cygwin, unix-tools, vmware, virtual box, even the new microsoft powershell. then i found colinux. colinux actually runs a linux os as a windows program. i am not so strong on how it works, but i do use it <a href='http://www.virtual-clouds.com/2008/11/35/colinux/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>every now and then i want the linux power on my windows. i tried all the workarounds: cygwin, unix-tools, vmware, virtual box, even the new microsoft powershell.</p>
<p>then i found colinux.</p>
<p>colinux actually runs a linux os as a windows program. i am not so strong on how it works, but i do use it and enjoy it, especially now when i develop on linux, and i don&#8217;t want to be remotely connected to another server all the time. i decided to share the setup i did for a colinux on my vista machine. here is the how-to, basically i followed the instructions at the <a href="http://colinux.wikia.com/wiki/Getting_Started_with_coLinux_-_Long_manual">colinux wiki</a>:</p>
<ol>
<li> download colinux-stable from:<br />
<a href="http://sourceforge.net/projects/colinux/files"> http://sourceforge.net/projects/colinux/files</a></li>
<li> download ubuntu distribution from the same address.</li>
<li> install colinux c:\colinux, don&#8217;t download any distribution from the installer.</li>
<li> unzip distribution files into c:\colinux.</li>
<li> download 324Mb swap file from:<br />
<a href="http://gniarf.nerim.net/colinux/swap"> http://gniarf.nerim.net/colinux/swap</a>.</li>
<li> unzip swap file into c:\colinux.</li>
<li> edit c:\colinux\example.conf:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cobd0=&quot;c:\colinux\Ubuntu-7.10.ext3.2gb.fs&quot;
cobd1=&quot;c:\colinux\swap_384Mb&quot;
root=/dev/cobd0
ro
initrd=initrd.gz
mem=384
eth0=slirp
eth1=tuntap</pre></div></div>

</li>
<li> create and run batch file, with this content:<br />
colinux-daemon.exe -t nt @example.conf</li>
<li> login using id: root, password: root.</li>
<li> edit /etc/network/interfaces:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">auto eth0
iface eth0
inet staticaddress 10.0.2.15
network 10.0.2.0
broadcast 10.0.2.255
netmask 255.255.255.0
gateway 10.0.2.2
&nbsp;
auto eth1
iface eth1
inet staticaddress 192.168.37.20
network 192.168.37.0
netmask 255.255.255.0
broadcast 192.168.37.255
&nbsp;
&lt;li&gt; edit tap adapter on windows: control panel\network and internet\network connections:
&lt;pre lang=&quot;text&quot;&gt;properties, tcp/ipv4
static ip: 192.168.37.10
subnet mask: 255.255.255.0
gateway: leave blank</pre></div></div>

</li>
<li> add new user, as root:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user_name <span style="color: #660033;">-g</span> admin <span style="color: #660033;">-m</span> user_name 
<span style="color: #c20cb9; font-weight: bold;">passwd</span> user_name</pre></div></div>

</li>
<li> install ssh:

<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: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span></pre></div></div>

</li>
<li> login using putty, connect to 192.168.37.20:22</li>
<li> update system

<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: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade</pre></div></div>

</li>
<li> change basic shell to bash:

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chsh</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">bash</span> user_name</pre></div></div>

</li>
<li> use samba to access linux machine from windows:

<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: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> samba
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <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>samba stop</pre></div></div>

</li>
<li> edit /etc/samba/smb.conf:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">[global]
	workgroup = WORKGROUP
[homes]
	browseable=yes
	writeable=yes
	valid users = user_name
	path = /home/user_name</pre></div></div>

</li>
<li> start samba again

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo /etc/init.d/samba start</pre></div></div>

</li>
<li> add yourself as a samba user:

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">sudo smbpasswd -L -a your_username
sudo smbpasswd -L -e your_username</pre></div></div>

</li>
<li> on windows, right click on &#8216;my computer&#8217; and choose &#8216;map network drive&#8217;, then enter: \\host_name\user_name, and fill your samaba password when asked to. if you haven&#8217;t changes the default host name then it is &#8216;ubuntu&#8217;</li>
<p><br/>that&#8217;s it <img src='http://www.virtual-clouds.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.virtual-clouds.com/2008/11/35/colinux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
