<?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>Codedrop™ Weblog &#187; Linux</title>
	<atom:link href="http://www.codedrop.ca/blog/archives/category/os/linux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.codedrop.ca/blog</link>
	<description>Drop'n some code and other tech tidbits...</description>
	<lastBuildDate>Sun, 01 Jan 2012 07:48:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Enable ssh on your D-LINK DNS-323</title>
		<link>http://www.codedrop.ca/blog/archives/236</link>
		<comments>http://www.codedrop.ca/blog/archives/236#comments</comments>
		<pubDate>Tue, 30 Nov 2010 05:22:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[DNS-323]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/archives/236</guid>
		<description><![CDATA[Found this great article on how to enable ssh a DNS-323. The D-LINK DNS-323 runs Linux, which makes it hackable&#8230; this means good things&#8230; First Step – Installing fun_plug Installing fun_plug is simple. Download the fun_plug tar.gz file here and copy it to “volume_1” root (IE: dns-323/Volume_1/). Also download the “fun_plug” file (non tar-gz) and copy it to [...]]]></description>
			<content:encoded><![CDATA[<p>Found this great article on how to enable ssh a DNS-323. The D-LINK DNS-323 runs Linux, which makes it hackable&#8230; this means good things&#8230;</p>
<h3 style="border: 1px solid #dedbd1; margin: 0px 0px 15px; padding: 10px 18px 5px; color: #363636; font-size: 14px; font-weight: bold; background-color: #f5f4f0; text-align: left; height: 20px;">First Step – Installing fun_plug</h3>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;">Installing fun_plug is simple. Download the fun_plug <strong style="border-width: 0px; margin: 0px; padding: 0px;">tar.gz</strong> file <strong style="border-width: 0px; margin: 0px; padding: 0px;"><a style="border-width: 0px; margin: 0px; padding: 0px; color: #0095d3; text-decoration: none;" href="http://www.inreto.de/dns323/fun-plug/" target="_blank">here</a></strong> and copy it to “<em style="border-width: 0px; margin: 0px; padding: 0px;">volume_1</em>” root (IE: dns-323/Volume_1/). Also download the “<em style="border-width: 0px; margin: 0px; padding: 0px;">fun_plug</em>” file (non tar-gz) and copy it to the same location.</p>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">Reboot</strong> (From admin click on “tools” and then “system”) the DNS-323 and  on reboot  this file should expand and create a new directory: ffp. It also <strong style="border-width: 0px; margin: 0px; padding: 0px;">starts</strong> a telnet server (there is that out of the way).  In addition, the tarball contains these other packages:</p>
<ul style="border-width: 0px; margin: 0px 0px 15px; padding: 0px; font-size: 12px; line-height: 20px;">
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">Lighttpd Web Server</li>
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">OpenSSH Secure Shell</li>
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">Mediatomb UPnP Media Server</li>
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">NTP Network Time Daemon</li>
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">UNFS3 User-Space NFS Server</li>
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">NFS-Utils NFS Server (requires kernel support)</li>
<li style="border-width: 0px; margin: 0px 0px 0px 15px; padding: 3px 0px; list-style-type: circle ! important; list-style-position: inside ! important;">RSync File Transfer Utility</li>
</ul>
<h3 style="border: 1px solid #dedbd1; margin: 0px 0px 15px; padding: 10px 18px 5px; color: #363636; font-size: 14px; font-weight: bold; background-color: #f5f4f0; text-align: left; height: 20px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">Second Step – Enable SSH</strong></h3>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;">If all goes well you should be able to telnet into your d-link:</p>
<p style="border-width: 0px; margin: 5px 0px; padding: 5px 0px; line-height: 20px; text-align: left; font-size: 12px;">Last login: Sat Feb 28 19:32:18 on console<br style="border-width: 0px; margin: 0px; padding: 0px;" /> localhost:~ jordan$ telnet 192.168.0.198<br style="border-width: 0px; margin: 0px; padding: 0px;" /> Trying 192.168.0.198…<br style="border-width: 0px; margin: 0px; padding: 0px;" /> Connected to 192.168.0.198.<br style="border-width: 0px; margin: 0px; padding: 0px;" /> Escape character is ‘^]’.<br style="border-width: 0px; margin: 0px; padding: 0px;" /> / #</p>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;">Notice it asks for no username or password? No good. This is a big security  hole and we need to disable this and enable SSH. Since it is part of the tarball package fun_plug we only need to enable it.</p>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;">At the telnet prompt type:</p>
<ol style="border-width: 0px; margin: 0px 0px 15px; padding: 0px; font-size: 12px; line-height: 20px;">
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">pwconv </strong><strong style="border-width: 0px; margin: 0px; padding: 0px;"><br style="border-width: 0px; margin: 0px; padding: 0px;" /> </strong></li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">passwd </strong>- (this changes root password, enter twice)</li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">usermod -s /ffp/bin/sh root</strong> – (this will change the default shell of the user. Current shell for root is ASH)</li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">login </strong>- (test to make sure you can login)</li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">store-passwd.sh</strong></li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">chmod 766 /ffp/start/sshd.sh</strong> – (this allows everyone to read/execute the SSH startup script. It will also allow it to startup on boot).</li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;"> sh /ffp/start/sshd.sh start</strong> – (start the SSH service)</li>
</ol>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;">You should be able to SSH in. Try it now:</p>
<p style="border-width: 0px; margin: 5px 0px; padding: 5px 0px; line-height: 20px; text-align: left; font-size: 12px;">localhost:~ jordan$ ssh root@192.168.0.198<br style="border-width: 0px; margin: 0px; padding: 0px;" /> root@192.168.0.198’s password:<br style="border-width: 0px; margin: 0px; padding: 0px;" /> root@dlink-583ECB:~#</p>
<p style="border-width: 0px; margin: 0px; padding: 0px 0px 10px; line-height: 20px ! important; text-align: left; font-size: 12px;">If you can, disable telnet by executing:</p>
<ol style="border-width: 0px; margin: 0px 0px 15px; padding: 0px; font-size: 12px; line-height: 20px;">
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">/ffp/start/telnetd.sh stop<br style="border-width: 0px; margin: 0px; padding: 0px;" /> </strong></li>
<li style="border-width: 0px; margin: 0px; padding: 3px 0px; list-style-type: decimal ! important; list-style-position: inside ! important; font-size: 12px;"><strong style="border-width: 0px; margin: 0px; padding: 0px;">chmod 644 /ffp/start/telnetd.sh</strong></li>
</ol>
<p><strong>Installing Transmission</strong></p>
<ol><em></em></p>
<li>ssh as root</li>
<li>Type the command “cd /mnt/HD_a2” and hit &lt;Enter&gt;<br />
<em>The prompt should change to “/mnt/HD_a2 #”</em></li>
<li>Type the command “wget http://kylek.is-a-geek.org:31337/files/curl-7.18.1.tgz” and hit &lt;Enter&gt;</li>
<li>Type the command “wget http://kylek.is-a-geek.org:31337/files/Transmission-2.04-1.tgz” and hit &lt;Enter&gt;</li>
<li>Type the command “funpkg -i curl-7.18.1.tgz” and hit &lt;Enter&gt;</li>
<li>Type the command “funpkg -i Transmission-2.04-1.tgz” and hit &lt;Enter&gt;</li>
<li>Type the command “chmod a+x /ffp/start/transmission.sh;sh /ffp/start/transmission.sh start”<br />
<em>There would be a message like starting transmission</em></li>
<li>Type the command “sh /ffp/start/transmission.sh stop” and hit &lt;Enter&gt;<br />
<em>There would be a message like stopping transmission</em></li>
<li>Do not close the command prompt.</li>
</ol>
<p><strong>Updating the whitelist</strong></p>
<p>In this section we would be adding your local lan IP range (A.B.C.*)  to the whitelist. Assuming your NAS’s IP is 192.168.1.101, A.B.C.* would  simply mean 192.168.1.* where the last group of number becomes asterix  (*).</p>
<ol>
<li>Go back to the command prompt</li>
<li>Type the command “vi /mnt/HD_a2/.transmission-daemon/settings.json” and hit &lt;Enter&gt;</li>
<li>Edit the line with “rpc-whitelist”</li>
<li>Type the following “,A.B.C.*”<br />
<em>The entire line would read something like<br />
“rpc-whitelist”: “127.0.0.1,192.168.1.*”,<br />
</em></li>
</ol>
<p><strong>Starting Transmission</strong></p>
<ol>
<li>Type the command “sh /ffp/start/transmission.sh start”<br />
<em>There would be a message like starting transmission</em></li>
</ol>
<p>Give it sometime for transmission to startup before proceeding to the next section.</p>
<p><strong>Setting the download directory</strong></p>
<ol>
<li>Type the command “su nobody -c “mkdir -p /mnt/HD_a2/transmission-downloads”“</li>
<li>Type the command “transmission-remote 127.0.0.1 -w /mnt/HD_a2/transmission-downloads”<br />
<em>There would be a message like success</em></li>
</ol>
<p>It’s done! Direct your Internet browser to <strong>http://A.B.C.D:9091</strong> for the transmission web user interface.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=55f62387-b7d3-8cb1-9b96-79454f732b1e" alt="" /></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Enable+ssh+on+your+D-LINK+DNS-323+http%3A%2F%2Ftinyurl.com%2F5r5zung" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Enable+ssh+on+your+D-LINK+DNS-323+http%3A%2F%2Ftinyurl.com%2F5r5zung" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/236/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crontab Reference</title>
		<link>http://www.codedrop.ca/blog/archives/233</link>
		<comments>http://www.codedrop.ca/blog/archives/233#comments</comments>
		<pubDate>Wed, 29 Sep 2010 15:58:54 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Build Automation]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/archives/233</guid>
		<description><![CDATA[I continually forget the format for a crontab entry&#8230; here&#8217;s a quick reference for those of you who do too! Tweet This Post]]></description>
			<content:encoded><![CDATA[<p>I continually forget the format for a crontab entry&#8230; here&#8217;s a quick reference for those of you who do too!</p>
<p><img style="max-width: 800px;" src="http://blog.linuxvin.com/wp-content/uploads/2010/07/crontab-syntax-300x121.gif" /></p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=29a30767-9dc6-8500-a169-40c2834a6a03" /></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Crontab+Reference+http%3A%2F%2Ftinyurl.com%2F3zrywxb" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Crontab+Reference+http%3A%2F%2Ftinyurl.com%2F3zrywxb" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/233/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RHEL terminal closes after a period of inactivity.</title>
		<link>http://www.codedrop.ca/blog/archives/129</link>
		<comments>http://www.codedrop.ca/blog/archives/129#comments</comments>
		<pubDate>Wed, 26 Aug 2009 16:27:36 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/archives/129</guid>
		<description><![CDATA[After weeks of frustration with my RHEL terminal windows closing themselves after a small interval of inactivity, (go for lunch and my terminals were closed)&#8230; I finally found out the solution to prevent this &#8216;default&#8217; behaviour that comes in RHEL. The /etc/profile was the culprit.&#160; Simply remove the following lines or update them to a [...]]]></description>
			<content:encoded><![CDATA[<p>After weeks of frustration with my RHEL terminal windows closing themselves after a small interval of inactivity, (go for lunch and my terminals were closed)&#8230; I finally found out the solution to prevent this &#8216;default&#8217; behaviour that comes in RHEL.</p>
<p>The /etc/profile was the culprit.&nbsp; Simply remove the following lines or update them to a much more respectable time interval and restart your X windows.</p>
<p>TMOUT=3600<br />export TMOUT</p>
<p>Thats one I&#8217;ll not forget as its sure a pain when your in development mode with all your terminals set where you want them&#8230;. turn away for an hour and find them all closed!</p>
<p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" alt="" src="http://img.zemanta.com/pixy.gif?x-id=c2761770-58d1-8aa4-afcc-3ae3e7a20a41" /></div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=RHEL+terminal+closes+after+a+period+of+inactivity.+http%3A%2F%2Ftinyurl.com%2F4f8lyfs" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=RHEL+terminal+closes+after+a+period+of+inactivity.+http%3A%2F%2Ftinyurl.com%2F4f8lyfs" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/129/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to rename a vm (.vmdk) file for VMWare Server 1.0.4</title>
		<link>http://www.codedrop.ca/blog/archives/51</link>
		<comments>http://www.codedrop.ca/blog/archives/51#comments</comments>
		<pubDate>Thu, 28 Aug 2008 17:20:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VMWare]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=51</guid>
		<description><![CDATA[In Vmware server 1.04, you can use the following process to rename the vmdk files: 1. Copy folder, rename vmx file 2. Edit machine, change hostname 3. Rename vdmk 4. Edit settings and add disk you just renamed as existing disk (remove old one) 5. Start vm and check it works (don’t forget to use [...]]]></description>
			<content:encoded><![CDATA[<p>In Vmware server 1.04, you can use the following process to rename the vmdk files:</p>
<p>1. Copy folder, rename vmx file<br />
2. Edit machine, change hostname<br />
3. Rename vdmk<br />
4. Edit settings and add disk you just renamed as existing disk (remove old one)<br />
5. Start vm and check it works (don’t forget to use newsid)</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=How+to+rename+a+vm+%28.vmdk%29+file+for+VMWare+Server+1.0.4+http%3A%2F%2Ftinyurl.com%2F4mymbhf" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=How+to+rename+a+vm+%28.vmdk%29+file+for+VMWare+Server+1.0.4+http%3A%2F%2Ftinyurl.com%2F4mymbhf" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/51/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle 10.2.0.1 installation on Fedora 8</title>
		<link>http://www.codedrop.ca/blog/archives/49</link>
		<comments>http://www.codedrop.ca/blog/archives/49#comments</comments>
		<pubDate>Wed, 23 Jul 2008 01:53:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Fedora]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=49</guid>
		<description><![CDATA[Below are the installation note&#8217;s I captured in installing Oracle10.2.0.1 on a Fedora 8 workstation. For some reason installations ofOracle on Fedora linux in past never went as smooth as hoped.. I washowever relatively happy with how things turned out on F8 and its niceto see some of the old problems, like hanging during installation, [...]]]></description>
			<content:encoded><![CDATA[<p>Below are the installation note&#8217;s I captured in installing Oracle<br />10.2.0.1 on a Fedora 8 workstation.  For some reason installations of<br />Oracle on Fedora linux in past never went as smooth as hoped.. I was<br />however relatively happy with how things turned out on F8 and its nice<br />to see some of the old problems, like hanging during installation, went<br />away&#8230;  </p>
<p>##########################################<br /># Oracle 10g Standard &#8211; Fedora 8 Linux Installation Instructions<br /># Author: Greg Roll<br /># Date:   July 14th, 2008<br />#<br /># These instructions have been parsed down to the bare requirements to <br /># install Oracle 10g Standard on a typical Fedora 8 installation.<br />#<br />##########################################</p>
<p>##########################################<br />## Install / Update required system packages.<br />##########################################<br />yum install libaio<br />yum install libXp<br />yum update libxcb (must be 1.0-4 or greater!)</p>
<p>##########################################<br />## Configuring the Linux Kernel Parameters as per Oracle<br />## requirements.<br />##########################################</p>
<p>The Linux kernel is a wonderful thing. Unlike most other *NIX systems,<br />Linux allows modification of most kernel parameters while the system is<br />up and running. There&#8217;s no need to reboot the system after making<br />kernel parameter changes. Oracle Database 10g Release 2 requires the<br />kernel parameter settings shown below. The values given are minimums,<br />so if your system uses a larger value, don&#8217;t change it.</p>
<p>kernel.shmall = 2097152<br />kernel.shmmax = 536870912<br />kernel.shmmni = 4096<br />kernel.sem = 250 32000 100 128<br />fs.file-max = 65536<br />net.ipv4.ip_local_port_range = 1024 65000<br />net.core.rmem_default=262144<br />net.core.wmem_default=262144<br />net.core.rmem_max=262144<br />net.core.wmem_max=262144</p>
<p>On my base fedora 8 installation I found I only had to change a 2 options:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<br />/etc/sysctl.conf<br /> &#8212;&#8212;&#8212;&#8212;&#8212;<br />add:<br />net.ipv4.ip_local_port_range = 1024 65000<br />kernel.sem = 250 32000 100 128`</p>
<p>Execute the following command to change the current values of the kernel<br />parameters:<br />/sbin/sysctl -p</p>
<p>##########################################<br />## Setup required user / groups.<br />##########################################</p>
<p>/usr/sbin/groupadd oinstall<br />/usr/sbin/groupadd dba<br />/usr/sbin/useradd -g oinstall -G dba oracle<br />passwd oracle</p>
<p>[root@uberdev14 ~]# id oracle<br />uid=2090(oracle) gid=4001(oinstall) groups=4001(oinstall),4002(dba) context=unconfined_u:system_r:unconfined_t:s0<br />[root@uberdev14 ~]# id nobody<br />uid=99(nobody) gid=99(nobody) groups=99(nobody) context=unconfined_u:system_r:unconfined_t:s0<br />[root@uberdev14 ~]# </p>
<p>##########################################<br />## Update user limits.<br />##########################################</p>
<p>Oracle recommends setting limits on the number of processes and open files each Linux account may use.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />/etc/security/limits.conf<br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />Add the following 4 lines before the end of file comment:<br />oracle soft nproc 2047<br />oracle hard nproc 16384<br />oracle soft nofile 1024<br />oracle hard nofile 65536</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;-<br />/etc/pam.d/login<br />&#8212;&#8212;&#8212;&#8212;&#8212;-<br />Add the following 2 lines before the pame_selinux.so open rule<br />session    required     /lib/security/pam_limits.so<br />session    required     pam_limits.so  </p>
<p>##########################################<br /># Setup user profile.<br />##########################################</p>
<p># Backup the original system profile.<br />[root@udev10lin01 etc]# cp -p profile profile.ORIG</p>
<p># Modify the system files.<br />&#8212;&#8212;&#8212;&#8212;<br />/etc/profile<br />&#8212;&#8212;&#8212;&#8212;</p>
<p>Edit and add following to bottom:</p>
<p>if [ $USER = "oracle" ]; then<br />  if [ $SHELL = "/bin/ksh" ]; then<br />    ulimit -p 16384<br />    ulimit -n 65536<br />  else<br />    ulimit -u 16384 -n 65536<br />  fi<br />fi</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />/home/oracle/.bash_profile<br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Edit and add following:</p>
<p># .bash_profile</p>
<p># Get the aliases and functions<br />if [ -f ~/.bashrc ]; then<br />        . ~/.bashrc<br />fi</p>
<p># User specific environment and startup programs</p>
<p>set -o vi<br />export ORACLE_SID=IVSD1<br />export ORACLE_BASE=/opt/app/oracle<br />export ORACLE_HOME=${ORACLE_BASE}/product/10.2.0/DB1<br />export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:/usr/lib:/lib<br />export PATH=$PATH:${ORACLE_HOME}/bin:/sbin/:/usr/sbin</p>
<p>unset USERNAME</p>
<p>stty erase ^?</p>
<p>#LD_ASSUME_KERNEL=2.2.5; export LD_ASSUME_KERNEL<br />umask 022</p>
<p>##########################################<br /># Create directories for Oracle installation.<br />##########################################</p>
<p>¦ software directories:<br />cd /opt<br />mkdir -p app/oracle<br />chown -R oracle.oinstall app/oracle/<br />chmod -R 775 app/oracle/</p>
<p>ls -l app/<br />total 4<br />drwxrwxr-x  2 oracle oinstall 4096 Apr 13 13:16 oracle<br />[root@udev10lin01 opt]#</p>
<p>¦ Database file directory:<br />mkdir /u01/oradata<br />chown oracle:oinstall /u01/oradata<br />chmod 775 /u01/oradata</p>
<p>¦ Recovery file directory (flash recovery area):<br />mkdir /u01/flash_recovery_area<br />chown oracle:oinstall /u01/flash_recovery_area<br />chmod 775 /u01/flash_recovery_area</p>
<p>##########################################<br /># Install Oracle base software.<br />##########################################</p>
<p>[oracle@udev10lin01 ~]$ cd /opt/app/oracle/software/<br />[oracle@udev10lin01 software]$ ls -l<br />total 653712<br />-rw-r&#8211;r&#8211;  1 oracle oinstall 668734007 May 18 10:54 10201_database_linux32.zip</p>
<p>unzip 10201_database_linux32.zip</p>
<p>[oracle@udev10lin01 software]$ ls -l<br />total 653712<br />-rw-r&#8211;r&#8211;  1 oracle oinstall 668734007 May 18 10:54 10201_database_linux32.zip<br />drwxr-xr-x  6 oracle oinstall      4096 Jun 12 14:50 database<br />[oracle@udev10lin01 software]$</p>
<p>##########################################<br /># Run Oracle installer.<br />##########################################</p>
<p>** First disable X11 access controls by running xhost+ as your current gnome/kde<br />user.</p>
<p>cd /opt/app/oracle/software/database<br />    ./runInstaller -silent -responseFile /opt/app/oracle/software/uberdev-f8-oracle10.2.0.2-recorded.rsp  <br />                   -jreLoc /opt/jdk1.6.0_06 <br />                   -IgnoreSysPrereqs</p>
<p>    &#8211; Select default inventory directory and &#8216;oracle&#8217; user.<br />    &#8211; Select typical install.<br />    &#8211; Select Standard Edition.<br />    &#8211; Accept remaining defaults.<br />    &#8211; Accept warning on product specific prerequisite checks.<br />    &#8211; Select create a database.<br />    &#8211; Accept create general purpose database.<br />    &#8211; enter dbname &#8216;sample&#8217; sid &#8216;sample&#8217;, select Unicode format and enable create database with sample schemas.<br />    &#8211; accept defaults until you get to the password definition screen<br />    &#8211; define password of &#8216;password&#8217; for all default accounts (SYS, SYSTEM,<br />      SYSMAN, DBSNMP)<br />    &#8211; setup &#8216;dba&#8217; as privileged system groups.. if were not defined use<br />      default oracle group.</p>
<p>** NOTES **</p>
<p>=======================================<br />Creating an Oracle Response File for Automated Installs<br />=======================================<br />Response<br />files can be created by running the software in record mode or by<br />manually editing a sample response file. Here&#8217;s a basic demo:</p>
<p>   1. Start the OUI with this command to create the response file:<br />        ./runInstaller -IgnoreSysPrereqs <br />                  -jreLoc /opt/jdk1.6.0_06 <br />                  -record <br />                  -destinationFile /opt/app/oracle/software/uberdev-f8-oracle10.2.0.2-recorded.rsp<br />   2. Make all the selections you want to (source destination, home, home name, products).<br />   3. When you get to the Summary screen, instead of clicking on Install, click on Cancel.</p>
<p>4. Examine the resulting response file created in tmp/recorded.rsp. If<br />desired, you can manually edit this file as long as you adhere to the<br />prescribed format (see documentation).<br />   5. Now perform the silent installation like this:<br />        ./runInstaller -silent -responseFile /opt/app/oracle/software/uberdev-f8-oracle10.2.0.2-recorded.rsp</p>
<p>The progress of the installation will be reported as the script is being run.</p>
<p>If you have a problem with the installation due to incorrect entries in the response file, the installation will fail with a diagnostic message. Further information can be found in the oraInventory/logs directory. Logs with names in the format installActions-<date-timestamp>.log and silentInstall<date-timestamp>.log are created each time the OUI is run using a response file.</p>
<p>- Might need to increase available swap space.<br />Checking available swap space requirements &#8230;<br />Expected result: 8108MB<br />Actual Result: 2047MB</date-timestamp></date-timestamp></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Oracle+10.2.0.1+installation+on+Fedora+8+http%3A%2F%2Ftinyurl.com%2F4q3en5h" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Oracle+10.2.0.1+installation+on+Fedora+8+http%3A%2F%2Ftinyurl.com%2F4q3en5h" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/49/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating A Local Mirror (Fedora)</title>
		<link>http://www.codedrop.ca/blog/archives/36</link>
		<comments>http://www.codedrop.ca/blog/archives/36#comments</comments>
		<pubDate>Thu, 06 Sep 2007 17:54:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Fedora]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=36</guid>
		<description><![CDATA[Create a script that you&#8217;ll be able to setup as a cron entry to run daily. For a FC7 mirror I used the following: #!/bin/bash ARCH=i386 # Set to the architecture of your systems # Mirror found at: http://mirrors.fedoraproject.org/publiclist/Fedora/7/ # Be sure to include trailing slash. RELEASES_DIR=/clientdata/yum/fedora/releases/7/Fedora/$ARCH/ RELEASES_URL=rsync://mirrors.kernel.org/fedora/releases/7/Fedora/$ARCH/ CORE_DIR=/clientdata/yum/fedora/releases/7/Live/$ARCH/os/ CORE_URL=rsync://mirrors.kernel.org/fedora/releases/7/Live/i386/os/ UPDATES_URL=rsync://mirrors.kernel.org/fedora/updates/7/$ARCH/ UPDATES_DIR=/clientdata/yum/fedora/updates/7/$ARCH/ mkdir -p $RELEASES_DIR [...]]]></description>
			<content:encoded><![CDATA[<p>Create a script that you&#8217;ll be able to setup as a cron entry to run daily.  For a FC7 mirror I used the following:</p>
<pre>
#!/bin/bash
ARCH=i386   # Set to the architecture of your systems

# Mirror found at: http://mirrors.fedoraproject.org/publiclist/Fedora/7/
# Be sure to include trailing slash.
RELEASES_DIR=/clientdata/yum/fedora/releases/7/Fedora/$ARCH/
RELEASES_URL=rsync://mirrors.kernel.org/fedora/releases/7/Fedora/$ARCH/
CORE_DIR=/clientdata/yum/fedora/releases/7/Live/$ARCH/os/
CORE_URL=rsync://mirrors.kernel.org/fedora/releases/7/Live/i386/os/
UPDATES_URL=rsync://mirrors.kernel.org/fedora/updates/7/$ARCH/
UPDATES_DIR=/clientdata/yum/fedora/updates/7/$ARCH/

mkdir -p $RELEASES_DIR
cd $RELEASES_DIR || exit
rsync --recursive --delete -v $RELEASES_URL .

mkdir -p $CORE_DIR
cd $CORE_DIR || exit
rsync --recursive --delete -v $CORE_URL .

mkdir -p $UPDATES_DIR
cd $UPDATES_DIR || exit
rsync --recursive --delete -v $UPDATES_URL .</pre>
<p>Next you&#8217;ll have to configure your systems to use your local repository for updates by setting up a baseurl entry in /etc/yum.repos.d/fedora-updates.repo as described <a href="http://dailypackage.fedorabook.com/index.php?/archives/36-Package-Management-Week-Yum-Repositories-Plugins.html">here</a>.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Creating+A+Local+Mirror+%28Fedora%29+http%3A%2F%2Ftinyurl.com%2F43g7kph" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Creating+A+Local+Mirror+%28Fedora%29+http%3A%2F%2Ftinyurl.com%2F43g7kph" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/36/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remote Syncronization of Current Date/Time</title>
		<link>http://www.codedrop.ca/blog/archives/35</link>
		<comments>http://www.codedrop.ca/blog/archives/35#comments</comments>
		<pubDate>Fri, 22 Jun 2007 17:23:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=35</guid>
		<description><![CDATA[This is something I use quite often though always forget the host.. so thought to blog it here&#8230; To remotely sync your linux system time use the following command: rdate -s time-a.nist.gov Seems easy enough.. but I still manage to forget it!.. The old servers like clock.redhat.com don&#8217;t seem to work anymore. Tweet This Post]]></description>
			<content:encoded><![CDATA[<p>This is something I use quite often though always forget the host.. so thought to blog it here&#8230;   To remotely sync your linux system time use the following command:</p>
<pre>rdate -s time-a.nist.gov</pre>
<p>Seems easy enough.. but I still manage to forget it!.. The old servers like clock.redhat.com don&#8217;t seem to work anymore.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Remote+Syncronization+of+Current+Date%2FTime+http%3A%2F%2Ftinyurl.com%2F3zn4ald" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Remote+Syncronization+of+Current+Date%2FTime+http%3A%2F%2Ftinyurl.com%2F3zn4ald" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/35/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fedora Core 6 Tips</title>
		<link>http://www.codedrop.ca/blog/archives/25</link>
		<comments>http://www.codedrop.ca/blog/archives/25#comments</comments>
		<pubDate>Fri, 05 Jan 2007 04:22:35 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=25</guid>
		<description><![CDATA[Fedora&#8217;s latest release is proving really nice.&#160; Alot of work has gone into porting some of the cool XGL widgets into the native desktop using xorg extensions.&#160; For example the famous &#8216;cube&#8217; desktop switch&#8230; as simple as using the sytem preferences menu to enable desktop effects (at least assuming your video drivers are all supported!). [...]]]></description>
			<content:encoded><![CDATA[<p>Fedora&#8217;s latest release is proving really nice.&nbsp; Alot of work has gone into porting some of the cool XGL widgets into the native desktop using xorg extensions.&nbsp; For example the famous &#8216;cube&#8217; desktop switch&#8230; as simple as using the sytem preferences menu to enable desktop effects (at least assuming your video drivers are all supported!).</p>
<p>I found a very good reference page with <a href="http://www.gagme.com/greg/linux/fc6-tips.php">Tips &amp; Tricks</a> that helps identify alot of the things a typical user might want to install in addition to the core fc6 packages.</p>
<p>Also taking my first foray into using the <a href="http://www.beryl-project.org/">Beryl</a> window manager&#8230; so far so good!&#8230;&nbsp; If your interested in seeing it for yourself check out this <a href="http://www.youtube.com/watch?v=ZD7QraljRfM">video</a> on YouTube. I did have a slight problem at first with my menu bars not rendering, but a quick restart of X seemed to remedy that.&nbsp; The nice thing about Beryl is the beryl-manager lets me switch window managers on the fly.&nbsp; This is useful as there is still an outstanding <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6429775">bug</a> that prevents swing apps from rendering correctly while using xgl/compiz..&nbsp; So now, being an IntelliJ IDE user, which is swing based, I can effectively start up IntelliJ using the default gnome window manager, then switch to Beryl and still have it function. Still painful.. but worth it for all the candy that you get.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Fedora+Core+6+Tips+http%3A%2F%2Ftinyurl.com%2F3wa9rhq" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Fedora+Core+6+Tips+http%3A%2F%2Ftinyurl.com%2F3wa9rhq" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/25/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VMWare License Keys</title>
		<link>http://www.codedrop.ca/blog/archives/24</link>
		<comments>http://www.codedrop.ca/blog/archives/24#comments</comments>
		<pubDate>Fri, 15 Dec 2006 21:48:05 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=24</guid>
		<description><![CDATA[Stumbled across a good page with some information on obtaining vmware license keys.&#160; Essentially all that is really required is that you register.. but suprisingly this wasn&#8217;t very easy to get to from the website.click here to receive your free serial number(s). ( non-expiring license key) free vm license keys powered by performancing firefox Tweet [...]]]></description>
			<content:encoded><![CDATA[<p>Stumbled across a good page with some information on obtaining vmware license keys.&nbsp; Essentially all that is really required is that you register.. but suprisingly this wasn&#8217;t very easy to get to from the website.<br /><a href="http://register.vmware.com/content/registration.html">click here to receive your free serial number(s). ( non-expiring license key) free vm license keys</a> </p>
<p>
<p>powered by <a href="http://performancing.com/firefox">performancing firefox</a></p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=VMWare+License+Keys+http%3A%2F%2Ftinyurl.com%2F4238cxv" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=VMWare+License+Keys+http%3A%2F%2Ftinyurl.com%2F4238cxv" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/24/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running NSIS Natively On Linux</title>
		<link>http://www.codedrop.ca/blog/archives/9</link>
		<comments>http://www.codedrop.ca/blog/archives/9#comments</comments>
		<pubDate>Wed, 23 Mar 2005 00:33:41 +0000</pubDate>
		<dc:creator>groll</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.codedrop.ca/blog/?p=9</guid>
		<description><![CDATA[The NSIS source files are shipped with every official NSIS distribution as well with the development snapshots. The binary files distributed with the NSIS releases are compiled with the Microsoft Visual C++ 6.0 compiler. The source has also been tested to be compatible with the Microsoft Visual C++ .NET 2002/2003 compiler. The NSIS distribution includes [...]]]></description>
			<content:encoded><![CDATA[<p>The <span class="caps">NSIS</span> source files are shipped with every official <span class="caps">NSIS</span> distribution as well with the development snapshots. The binary files distributed with the <span class="caps">NSIS</span> releases are compiled with the Microsoft Visual C++ 6.0 compiler. The source has also been tested to be compatible with the Microsoft Visual C++ .NET 2002/2003 compiler. The <span class="caps">NSIS</span> distribution includes Microsoft Visual C++ 6.0 project files, Microsoft Visual C++ .NET 2002/2003 automatically convert these files to a new format.</p>
<p>As of <span class="caps">NSIS 2</span>.01, the compiler, makensis, also compiles on <span class="caps">POSIX</span> platforms. <span class="caps">POSIX</span> platforms include Linux, *BSD, Mac <span class="caps">OS X</span> and others. You must first compile the exeheads to be able to compile makensis. This can be done on Windows using the methods explained above, or using a cross compiler ().</p>
<p>To build the cross compiler create a cross-compiler-src ( ie: /opt/cross-compiler-src ) directory and place ths following script in it:</p>
<p><strong>build-cross.sh</strong></p>
<pre>#!/bin/sh

# This is my script for building a complete cross-compiler toolchain.
# It is based partly on Ray Kelm's script, which in turn was built on
# Mo Dejong's script for doing the same, but with some added fixes.
# The intent with this script is to build a cross-compiled version
# of the current MinGW environment.
#
# Updated by Sam Lantinga

# what flavor are we building?

TARGET=i686-mingw32msvc

# where does it go?

PREFIX=/opt/cross-tools

# you probably don't need to change anything from here down

TOPDIR=`pwd`
SRCDIR="$TOPDIR/source"

# These are the files from the MinGW 3.2.0 RC3 release

MINGW_URL=http://heanet.dl.sourceforge.net/sourceforge/mingw
GCC_VERSION=3.4.2-20040916-1
GCC=gcc-$GCC_VERSION
GCC_ARCHIVES="gcc-core-$GCC_VERSION-src.tar.gz gcc-g++-$GCC_VERSION-src.tar.gz"
GCC_PATCH=""
BINUTILS=binutils-2.15.91-20040904-1
BINUTILS_ARCHIVE=$BINUTILS-src.tar.gz
MINGW=mingw-runtime-3.7
MINGW_ARCHIVE=$MINGW.tar.gz
W32API=w32api-3.2
W32API_ARCHIVE=$W32API.tar.gz

# These are the files from the SDL website

SDL_URL=http://www.libsdl.org/extras/win32/common
OPENGL_ARCHIVE=opengl-devel.tar.gz
DIRECTX_ARCHIVE=directx-devel.tar.gz

# need install directory first on the path so gcc can find binutils

PATH="$PREFIX/bin:$PATH"

#
# download a file from a given url, only if it is not present
#

download_file()
{
cd "$SRCDIR"
if test ! -f $1 ; then
echo "Downloading $1"
wget "$2/$1"
if test ! -f $1 ; then
echo "Could not download $1"
exit 1
fi
else
echo "Found $1 in the srcdir $SRCDIR"
fi
cd "$TOPDIR"
}

download_files()
{
mkdir -p "$SRCDIR"

# Make sure wget is installed
if test "x`which wget`" = "x" ; then
echo "You need to install wget."
exit 1
fi
for file in $GCC_ARCHIVES; do
download_file "$file" "$MINGW_URL"
done
download_file "$BINUTILS_ARCHIVE" "$MINGW_URL"
download_file "$MINGW_ARCHIVE" "$MINGW_URL"
download_file "$W32API_ARCHIVE" "$MINGW_URL"
download_file "$OPENGL_ARCHIVE" "$SDL_URL"
download_file "$DIRECTX_ARCHIVE" "$SDL_URL"
}

install_libs()
{
echo "Installing cross libs and includes"
mkdir -p "$PREFIX/$TARGET"
cd "$PREFIX/$TARGET"
gzip <del>dc "$SRCDIR/$MINGW_ARCHIVE" | tar xf </del>
gzip <del>dc "$SRCDIR/$W32API_ARCHIVE" | tar xf </del>
gzip <del>dc "$SRCDIR/$OPENGL_ARCHIVE" | tar xf </del>
gzip <del>dc "$SRCDIR/$DIRECTX_ARCHIVE" | tar xf </del>
cd "$TOPDIR"
}

extract_binutils()
{
cd "$SRCDIR"
rm -rf "$BINUTILS"
echo "Extracting binutils"
gzip <del>dc "$SRCDIR/$BINUTILS_ARCHIVE" | tar xf </del>
cd "$TOPDIR"
}

configure_binutils()
{
cd "$TOPDIR"
rm <del>rf "binutils</del>$TARGET"
mkdir "binutils-$TARGET"
cd "binutils-$TARGET"
echo "Configuring binutils"
"$SRCDIR/$BINUTILS/configure" <del>-prefix="$PREFIX" </del>-target=$TARGET &amp;&gt; configure.log
cd "$TOPDIR"
}

build_binutils()
{
cd "$TOPDIR/binutils-$TARGET"
echo "Building binutils"
make &amp;&gt; make.log
if test $? -ne 0; then
echo "make failed <del> log available: binutils</del>$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}

install_binutils()
{
cd "$TOPDIR/binutils-$TARGET"
echo "Installing binutils"
make install &amp;&gt; make-install.log
if test $? -ne 0; then
echo "install failed <del> log available: binutils</del>$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}

extract_gcc()
{
cd "$SRCDIR"
rm -rf "$GCC"
echo "Extracting gcc"
for file in $GCC_ARCHIVES; do
gzip <del>dc "$SRCDIR/$file" | tar xf </del>
done
cd "$TOPDIR"
}

patch_gcc()
{
if [ "$GCC_PATCH" != "" ]; then
echo "Patching gcc"
cd "$SRCDIR/$GCC"
patch -p1 &lt; "$SRCDIR/$GCC_PATCH"
cd "$TOPDIR"
fi
}

configure_gcc()
{
cd "$TOPDIR"
rm <del>rf "gcc</del>$TARGET"
mkdir "gcc-$TARGET"
cd "gcc-$TARGET"
echo "Configuring gcc"
"$SRCDIR/$GCC/configure" -v
<del>-prefix="$PREFIX" </del>-target=$TARGET
<del>-with</del>headers="$PREFIX/$TARGET/include"
<del>-with</del>gnu-as <del>-with</del>gnu-ld
<del>-without</del>newlib <del>-disable</del>multilib &amp;&gt; configure.log
cd "$TOPDIR"
}

build_gcc()
{
cd "$TOPDIR/gcc-$TARGET"
echo "Building gcc"
make &amp;&gt; make.log
if test $? -ne 0; then
echo "make failed <del> log available: gcc</del>$TARGET/make.log"
exit 1
fi
cd "$TOPDIR"
}

install_gcc()
{
cd "$TOPDIR/gcc-$TARGET"
echo "Installing gcc"
make LANGUAGES="c c++" install &amp;&gt; make-install.log
if test $? -ne 0; then
echo "install failed <del> log available: gcc</del>$TARGET/make-install.log"
exit 1
fi
cd "$TOPDIR"
}

final_tweaks()
{
echo "Finalizing installation"

# remove gcc build headers
rm <del>rf "$PREFIX/$TARGET/sys</del>include"

# Add extra binary links
if [ ! -f "$PREFIX/$TARGET/bin/objdump" ]; then
ln "$PREFIX/bin/$TARGET-objdump" "$PREFIX/$TARGET/bin/objdump"
fi

# make cc and c++ symlinks to gcc and g++
if [ ! -f "$PREFIX/$TARGET/bin/g++" ]; then
ln "$PREFIX/bin/$TARGET-g++" "$PREFIX/$TARGET/bin/g++"
fi
if [ ! -f "$PREFIX/$TARGET/bin/cc" ]; then
ln -s "gcc" "$PREFIX/$TARGET/bin/cc"
fi
if [ ! -f "$PREFIX/$TARGET/bin/c++" ]; then
ln -s "g++" "$PREFIX/$TARGET/bin/c++"
fi

# strip all the binaries
ls "$PREFIX"/bin/* "$PREFIX/$TARGET"/bin/* | egrep -v '.dll$' |
while read file; do
strip "$file"
done

echo "Installation complete!"
}

download_files

install_libs

extract_binutils
configure_binutils
build_binutils
install_binutils

extract_gcc
patch_gcc
configure_gcc
build_gcc
install_gcc

final_tweaks</pre>
<p>Execute this script and the cross compiler will be downloaded and installed to /opt/cross-tools.</p>
<p><strong>Steps to compile NSIS using POSIX</strong></p>
<p>How to do it:</p>
<p>1. Download the <span class="caps">NSIS</span> source (I used nsis206 in this example) from <a href="http://sourceforge.net/project/showfiles.php?group_id=22049&amp;package_id=15374">here</a>.<br />
2. Make a backup of the original source (ie: cp <span class="caps">NSIS NSIS</span>.orig)<br />
3. cd <span class="caps">NSIS</span>/Source/exehead<br />
4. Next go to <span class="caps">NSIS</span>/Source/exehead and create cross-make.sh script in that will be used with the cross compilation tools.</p>
<p><strong>cross-make.sh</strong></p>
<pre>#!/bin/sh

PREFIX=/opt/cross-tools
TARGET=i686-mingw32msvc
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
export PATH
exec make $*</pre>
<p>5. chmod a+x /opt/nsis-src/NSIS/Source/exehead/cross-make.sh<br />
6. execute /opt/nsis-src/NSIS/Source/exehead/cross-make.sh<br />
7. cd ..<br />
8. make makensis<br />
9. cd ..<br />
10. cp -a . /opt/nsis/lib<br />
11. rm -Rf /opt/nsis/lib/Source<br />
12. create a shell script named /opt/nsis/makensis to run your native version.</p>
<p><strong>makensis</strong></p>
<pre>#!/bin/sh
/opt/nsis/lib/makensis $*</pre>
<p>13. chmod a+x /opt/nsis/lib/makensisThere were some issues with the cross-compiler header files. In linux the winnt.h header was not found as the code is looking for WinNT.h. I simply had to rename the file to have the appropriate title case.</p>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Running+NSIS+Natively+On+Linux+http%3A%2F%2Ftinyurl.com%2F6e286tr" title="Post to Twitter"><img class="nothumb" src="http://www.codedrop.ca/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Running+NSIS+Natively+On+Linux+http%3A%2F%2Ftinyurl.com%2F6e286tr" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.codedrop.ca/blog/archives/9/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

