<?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>Obsessive Coder</title>
	<atom:link href="http://obsessivecoder.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://obsessivecoder.com</link>
	<description>....</description>
	<lastBuildDate>Fri, 07 Jan 2011 12:51:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>SMS Gateway with Kanneland Huawei 3G Modem on Ubuntu</title>
		<link>http://obsessivecoder.com/2010/12/08/sms-gateway-with-kanneland-huawei-3g-modem-on-ubuntu/</link>
		<comments>http://obsessivecoder.com/2010/12/08/sms-gateway-with-kanneland-huawei-3g-modem-on-ubuntu/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 06:05:19 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[10.04]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[gsm]]></category>
		<category><![CDATA[huawei]]></category>
		<category><![CDATA[kannel]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[sms]]></category>
		<category><![CDATA[sms center]]></category>
		<category><![CDATA[sms gateway]]></category>
		<category><![CDATA[smsc]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=94</guid>
		<description><![CDATA[Source: Setting Up an SMS Gateway with Ubuntu 8.04, Kannel and Huawei E220 GSM Modem I&#8217;ve used the link above as a guide to how I did my installation. The one I did was way easier though, as I didn&#8217;t have to compile the source anymore. It might have been the version of Kannel that [...]]]></description>
			<content:encoded><![CDATA[<p>Source: <a href="http://kerneltrap.org/node/17017" target="_blank">Setting Up an SMS Gateway with Ubuntu 8.04, Kannel and Huawei E220 GSM Modem</a></p>
<p>I&#8217;ve used the link above as a guide to how I did my installation. The one I did was way easier though, as I didn&#8217;t have to compile the source anymore. It might have been the version of Kannel that we used that is different. The above guide used 1.4.1 whereas I used 1.4.3 that came with Ubuntu&#8217;s packages.</p>
<p>Anyway, the model I used for the GSM Modem is a Huawei E156C HSDPA USB Stick, not a E220 GSM Modem. I used the same identifier as the E220 though, and so far no problems. Should work just fine.</p>
<p>First off, let&#8217;s install Kannel.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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> kannel</div></div>
<p>Next, configure Kannel by editing the configuration file found in /etc/kannel/kannel.conf. My configuration file is shown below</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">group = core<br />
admin-port = 13000<br />
admin-password = ourkannelpassword<br />
admin-deny-ip = &quot;*.*.*.*&quot;<br />
admin-allow-ip = &quot;127.0.0.1&quot;<br />
wapbox-port = 13002<br />
smsbox-port = 13003<br />
wdp-interface-name = &quot;*&quot;<br />
log-file = &quot;/var/log/kannel/bearerbox.log&quot;<br />
box-deny-ip = &quot;*.*.*.*&quot;<br />
box-allow-ip = &quot;127.0.0.1&quot;<br />
unified-prefix = &quot;+&quot;<br />
<br />
group = wapbox<br />
bearerbox-host = localhost<br />
log-file = &quot;/var/log/kannel/wapbox.log&quot;<br />
<br />
group = modems<br />
id = huawei_e220_00<br />
name = &quot;Huawei E220&quot;<br />
detect-string = &quot;huawei&quot;<br />
init-string = &quot;AT+CNMI=2,1,2,2,0&quot;<br />
message-storage = sm<br />
speed = 460800<br />
<br />
group = smsc<br />
smsc = at<br />
smsc-id = smsc-smart-bro<br />
port = 10000<br />
modemtype = huawei_e220_00<br />
device = /dev/ttyUSB1<br />
sms-center = &quot;+XXXXXXXXXXXX&quot;<br />
connect-allow-ip = &quot;127.0.0.1&quot;<br />
log-file = &quot;/var/log/kannel/smsc.log&quot;<br />
<br />
group = smsbox<br />
bearerbox-host = localhost<br />
smsbox-id = smsbox-smart-bro<br />
log-file = &quot;/var/log/kannel/smsbox.log&quot;<br />
<br />
group = smsbox-route<br />
smsbox-id = smsbox-smart-bro<br />
smsc-id = smsc-smart-bro<br />
<br />
group = sms-service<br />
keyword = default<br />
text = &quot;No service defined&quot;<br />
catch-all = true</div></div>
<p>There are a bazillion ways to configure Kannel, and since I&#8217;m new at this, I just used the barebones minimum for receiving and processing SMS messages. The important part here is how to configure the <strong>modem</strong>, and the <strong>smsc</strong> (Defined by the group setting) to work together. </p>
<p>Lucky for us that Ubuntu ships with drivers for this modem. Once you connect the modem on a USB port, you can check it with the following command:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">lsusb</div></div>
<p>You should see something like this. As you can see, even if I used a E156C model, it detects it as the E220 HSDPA Modem.</p>
<div class="codecolorer-container text twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub<br />
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub<br />
Bus 001 Device 006: ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E270 HSDPA/HSUPA Modem<br />
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub</div></div>
<p>It should also attach a tty onto it. In my case, it attaches to both /dev/ttyUSB0, and /dev/ttyUSB1. </p>
<p>To make sure where that is attached to, run:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">udevadm info <span style="color: #660033;">-q</span> all <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyUSB0<br />
udevadm info <span style="color: #660033;">-q</span> all <span style="color: #660033;">-n</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyUSB1</div></div>
<p>You should be able to see on which device it is connected to.</p>
<p>Going back to Kannel configuration, we need to find out how to configure the modem in kannel.conf. Basically, it&#8217;s just knowing the right parameters to set. For the modem group, the important thing is the init-string. I&#8217;m not an expert on it, so I just copied it from the Huawei forums. Basically, it uses AT commands (you can try playing with it in minicom or in HyperTerminal if you are on Windows). </p>
<p>Next is to configure the smsc group. Here, we define the modemtype to use the modem that we just configured. This modem type is the id assigned to the modem. At the same time, we need to tell the smsc to connect to which device, in my case, it&#8217;s /dev/ttyUSB1. Check out the source link from above why we used ttyUSB1 instead of ttyUSB0. It has to do with the main loop and event handling where there will be no more delay because ttyUSB1 will fire an event whenever an SMS is received (or something like that).</p>
<p>Once that is done, I setup smsbox-route just to be sure that smsc forwards everything to the smsbox defined, as well as future proofing it if I add more smsbox, and smsc configurations in the future. This would avoid more confusion later.</p>
<p>Next, the tricky part. We restart the kannel service. Now, the kannel service will be starting 2 daemons by default. The bearerbox daemon, as wel as the wapbox daemon. But it only shows &#8216;Starting WAP gateway&#8217; as the message. I checked my processes, and then there it was, only the bearerbox and wapbox service. No smsbox. If you look into the init script, it will check for a $START_WAPBOX, $START_SMSBOX variable to start the daemons. I didn&#8217;t realize this until I dug deeper 2 hours since I started. Apparently, you need to edit /etc/default/kannel to set these environment variables. By default, you will see this:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">START_WAPBOX</span>=<span style="color: #000000;">1</span><br />
<span style="color: #666666; font-style: italic;">#START_SMSBOX=1</span></div></div>
<p>So to start the smsbox, you just edit that file, uncomment the 2nd line, and then restart the kannel service.</p>
<p>Once you start the service, the SMSC log will report a PERMISSION DENIED, and will not be able to start the service. This is because if you look at the permissions of /dev/ttyUSB1, it is owned by root:dialout. This is easy to fix. We just need to add the user kannel into the dialout group by running the following command:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> usermod <span style="color: #660033;">-G</span> dialout kannel</div></div>
<p>Then restart the kannel service:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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>kannel restart</div></div>
<p>That&#8217;s it!</p>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/12/08/sms-gateway-with-kanneland-huawei-3g-modem-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Philippines: GSM Frequency Band</title>
		<link>http://obsessivecoder.com/2010/09/19/philippines-gsm-frequency-band/</link>
		<comments>http://obsessivecoder.com/2010/09/19/philippines-gsm-frequency-band/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 09:10:00 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[globe]]></category>
		<category><![CDATA[gsm]]></category>
		<category><![CDATA[philippines]]></category>
		<category><![CDATA[smart]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=81</guid>
		<description><![CDATA[Been searching for GSM frequency in the Philippines, and up to now I&#8217;m still not sure which one it is. Anyway, here&#8217;s a table for your reference, I&#8217;ll be updating it if I get more information. Service Provider GSM Frequency Band 3G Standard 3G Frequency Band Globe Telecom 900 MHz/1800 MHz W-CDMA (UMTS) 2100 MHz [...]]]></description>
			<content:encoded><![CDATA[<p>Been searching for GSM frequency in the Philippines, and up to now I&#8217;m still not sure which one it is. Anyway, here&#8217;s a table for your reference, I&#8217;ll be updating it if I get more information.</p>
<table>
<tr>
<th>Service Provider</th>
<th>GSM Frequency Band</th>
<th>3G Standard</th>
<th>3G Frequency Band</th>
</tr>
<tr>
<th>Globe Telecom</th>
<td>900 MHz/1800 MHz</td>
<td>W-CDMA (UMTS)</td>
<td>2100 MHz</td>
</tr>
<tr>
<th>Smart Communications</th>
<td>900 MHz/1800 MHz</td>
<td>W-CDMA (UMTS)</td>
<td>2100 MHz</td>
</tr>
<tr>
<th>Sun Cellular</th>
<td>1800 MHz</td>
<td>-</td>
<td>-</td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/09/19/philippines-gsm-frequency-band/feed/</wfw:commentRss>
		<slash:comments>141</slash:comments>
		</item>
		<item>
		<title>China Travel Website Project</title>
		<link>http://obsessivecoder.com/2010/09/17/china-travel-website-project/</link>
		<comments>http://obsessivecoder.com/2010/09/17/china-travel-website-project/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 12:51:41 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=77</guid>
		<description><![CDATA[I&#8217;m currently working on this travel website. If you have time, please check it out at http://diychina.travel/ Feedback on the site would be helpful. Thanks.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on this <a title="DIY China Travel" href="http://diychina.travel" target="_blank">travel website</a>. If you have time, please check it out at http://diychina.travel/</p>
<p>Feedback on the site would be helpful.</p>
<p>Thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/09/17/china-travel-website-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Autorun Screen Sessions on an SSH Session</title>
		<link>http://obsessivecoder.com/2010/05/06/autorun-screen-sessions-on-an-ssh-session/</link>
		<comments>http://obsessivecoder.com/2010/05/06/autorun-screen-sessions-on-an-ssh-session/#comments</comments>
		<pubDate>Thu, 06 May 2010 04:01:04 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=58</guid>
		<description><![CDATA[Source: Automatic &#8216;screen&#8217; on remote logins It annoys me whenever an SSH session I have to a server drops, and I can&#8217;t reconnect to the session, especially when there&#8217;s a long running tasks that I need to know the status of. So anyway, the solution to this one is a project called GNU Screen. To [...]]]></description>
			<content:encoded><![CDATA[<p>Source: <a href="http://taint.org/wk/RemoteLoginAutoScreen" target="_blank">Automatic &#8216;screen&#8217; on remote logins</a></p>
<p>It annoys me whenever an SSH session I have to a server drops, and I can&#8217;t reconnect to the session, especially when there&#8217;s a long running tasks that I need to know the status of.</p>
<p>So anyway, the solution to this one is a project called <a href="http://www.gnu.org/software/screen/" target="_blank">GNU Screen</a>. To summarize, it creates a virtual terminal session for you that you can actually resume on if ever your connection (or whatever) was terminated.</p>
<p>The problem with it is that you have to manually invoke the screen command when you successfully login, like so:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-D</span> <span style="color: #660033;">-RR</span></div></div>
<p>To run it on every SSH session, you can a script it to your bashrc profile. Either with your own bashrc located in ~/.bashrc or a global profile in /etc/bash.bashrc for all users. I normally put it for all users.</p>
<p>The script to add is found below, and is taken from taint.org:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Auto-screen invocation. see: http://taint.org/wk/RemoteLoginAutoScreen</span><br />
<span style="color: #666666; font-style: italic;"># if we're coming from a remote SSH connection, in an interactive session</span><br />
<span style="color: #666666; font-style: italic;"># then automatically put us into a screen(1) session. &nbsp; Only try once</span><br />
<span style="color: #666666; font-style: italic;"># -- if $STARTED_SCREEN is set, don't try it again, to avoid looping</span><br />
<span style="color: #666666; font-style: italic;"># if screen fails for some reason.</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$PS1</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${STARTED_SCREEN:-x}</span>&quot;</span> = x <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${SSH_TTY:-x}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= x <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; <span style="color: #007800;">STARTED_SCREEN</span>=<span style="color: #000000;">1</span> ; <span style="color: #7a0874; font-weight: bold;">export</span> STARTED_SCREEN<br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>screen-logs <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>screen-logs<br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span><br />
&nbsp; <span style="color: #c20cb9; font-weight: bold;">screen</span> <span style="color: #660033;">-RR</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span><br />
&nbsp; <span style="color: #666666; font-style: italic;"># normally, execution of this rc script ends here...</span><br />
&nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Screen failed! continuing with normal bash startup&quot;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #666666; font-style: italic;"># [end of auto-screen snippet]</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/05/06/autorun-screen-sessions-on-an-ssh-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Oracle 10g on Ubuntu 9.10 (Karmic Koala) Server 64-bit</title>
		<link>http://obsessivecoder.com/2010/04/27/installing-oracle-10g-on-ubuntu-9-10-karmic-koala-server-64-bit/</link>
		<comments>http://obsessivecoder.com/2010/04/27/installing-oracle-10g-on-ubuntu-9-10-karmic-koala-server-64-bit/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 11:09:57 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[10g]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[karmic koala]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[oracle 10g]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu 9.10]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=42</guid>
		<description><![CDATA[Source: Installing Oracle 10g On Ubuntu Karmic 64 Bit or Otherwise, Installing Oracle 10g On Ubuntu Karmic 64 Bit Or Otherwise (Part 2) So apparently I needed to install Oracle 10g to Ubuntu, and ran through a lot of hassles. I found a guide that&#8217;s well written but had some trouble with 64-bit server, and am [...]]]></description>
			<content:encoded><![CDATA[<p>Source: <a href="http://excession.org.uk/blog/installing-oracle-on-ubuntu-karmic-64-bit.html" target="_blank">Installing Oracle 10g On Ubuntu Karmic 64 Bit or Otherwise</a>, <a href="http://excession.org.uk/blog/installing-oracle-10g-on-ubuntu-karmic-64-bit-part-2.html" target="_blank">Installing Oracle 10g On Ubuntu Karmic 64 Bit Or Otherwise (Part 2)</a></p>
<p>So apparently I needed to install Oracle 10g to Ubuntu, and ran through a lot of hassles. I found a guide that&#8217;s well written but had some trouble with 64-bit server, and am writing for this for others who will encounter some trouble as well.</p>
<p>I&#8217;m breaking this down the following sections:</p>
<ol>
<li><a href="#ubuntu-kk-oracle-required-libraries">Installing Required Libraries</a></li>
<li><a href="#ubuntu-kk-oracle-users-groups">Setting Up Users and Groups</a></li>
<li><a href="#ubuntu-kk-oracle-kernel-parameters">Setting Kernel Parameters</a></li>
<li><a href="#ubuntu-kk-oracle-emulate">Emulating SUSE and Red Hat</a></li>
<li><a href="#ubuntu-kk-oracle-environment">Setting Up the Oracle Environment</a></li>
<li><a href="#ubuntu-kk-oracle-install">Installing Oracle</a></li>
<li><a href="#ubuntu-kk-oracle-listener">Creating the Listener</a></li>
<li><a href="#ubuntu-kk-oracle-database">Creating a Database</a></li>
<li><a href="#ubuntu-kk-oracle-startup-script">Creating Startup/Shutdown Scripts</a></li>
</ol>
<h3 id="ubuntu-kk-oracle-required-libraries">Installing Required Libraries</h3>
<p>Since Ubuntu is not an officially supported OS, we need to emulate those that are, and since Oracle mixes 32-bit and 64-bit libraries, we need to install i386, and even ia32 libraries. Run the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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> libaio1 rpm gcc-multilib libc6-dev-i386 libc6-dev-i386 libc6-i386 ia32-libs</div></div>
<p>In addition, doesn&#8217;t come with LIBSTDC++5, so you have to install manually installing the package. Run the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #ff0000;">&quot;http://de.archive.ubuntu.com/ubuntu/pool/universe/g/gcc-3.3/libstdc++5_3.3.6-17ubuntu1_amd64.deb&quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">ar</span> vx libstdc++<span style="color: #000000;">5</span>_3.3.6-17ubuntu1_amd64.deb<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf data.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">file</span> usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libstdc++.so.5.0.7<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">install</span> usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libstdc++.so.5.0.7 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> libstdc++.so.5.0.7 libstdc++.so.5<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib32<span style="color: #000000; font-weight: bold;">/</span>libstdc++.so.5</div></div>
<h3 id="ubuntu-kk-oracle-users-groups">Setting Up Users and Groups</h3>
<p>We need to create the group oinstall, dba, and nobody, and create a user named oracle. Run the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> groupadd oinstall<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> groupadd dba<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> groupadd nobody<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> useradd <span style="color: #660033;">-m</span> oracle <span style="color: #660033;">-g</span> oinstall <span style="color: #660033;">-G</span> dba <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></div></div>
<p>And don&#8217;t forget to change the password.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">passwd</span> oracle</div></div>
<p>Take note of the oinstall group ID as you will need this in setting the Kernel Parameters later. Do this by running the code below:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>group <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> oinstall</div></div>
<p>The ID should be in the format 10XX. If it&#8217;s a newly installed system, it should be 1002.</p>
<h3 id="ubuntu-kk-oracle-kernel-parameters">Setting Kernel Parameters</h3>
<p>We need to override the kernel parameters by running the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>sysctl.conf</div></div>
<p>And add the settings below at the bottom of the file. Take note that the <em>[oinstall_group_id]</em> should be replaced with what you got in the steps above (1002).</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">vm.hugetlb_shm_group = <span style="color: #7a0874; font-weight: bold;">&#91;</span>oinstall_group_id<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
kernel.shmall = <span style="color: #000000;">2097152</span><br />
kernel.shmmax = <span style="color: #000000;">2147483648</span><br />
kernel.shmmni = <span style="color: #000000;">4096</span><br />
kernel.sem = <span style="color: #000000;">250</span> <span style="color: #000000;">32000</span> <span style="color: #000000;">100</span> <span style="color: #000000;">128</span><br />
fs.file-max = <span style="color: #000000;">65536</span><br />
net.ipv4.ip_local_port_range = <span style="color: #000000;">1024</span> <span style="color: #000000;">65000</span></div></div>
<p>Reload the parameters by running the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>sysctl <span style="color: #660033;">-p</span></div></div>
<p>We also need to edit limits of the system. Edit the limits.conf file by running:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>security<span style="color: #000000; font-weight: bold;">/</span>limits.conf</div></div>
<p>Add add the settings below to the bottom of the file.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">*</span> soft nproc <span style="color: #000000;">2047</span><br />
<span style="color: #000000; font-weight: bold;">*</span> hard nproc <span style="color: #000000;">16384</span><br />
<span style="color: #000000; font-weight: bold;">*</span> soft nofile <span style="color: #000000;">1024</span><br />
<span style="color: #000000; font-weight: bold;">*</span> hard nofile <span style="color: #000000;">65536</span></div></div>
<h3 id="ubuntu-kk-oracle-emulate-systems">Emulating SUSE and Red Hat</h3>
<p>We emulate SUSE by creating symbolic links of the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">awk</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;">awk</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rpm <span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rpm<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgcc_s.so.1 <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libgcc_s.so<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">basename</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;">basename</span></div></div>
<p>We emulate Red Hat by creating the redhat-release file to trick the Oracle Installer that we are using Red Hat. =) Edit the file:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>redhat-release</div></div>
<p>And add the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Red Hat Enterprise Linux AS release <span style="color: #000000;">3</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>Taroon<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<h3 id="ubuntu-kk-oracle-environment">Setting Up the Oracle Environment</h3>
<p>I normally install my oracle database inside <strong>/opt</strong> so from hereon, you have to take note that <strong>/opt/oracle/10g</strong> will be the oracle home, and <strong>/opt/oracle</strong> will be the oracle base. The SID I will be using here will be <strong>orcl</strong>. Run the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>10g<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> oracle:oinstall <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">775</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle</div></div>
<p>Update environment profile by editing the global profile.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>profile</div></div>
<p>And add the following settings at the bottom.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_BASE</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>10g<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_SID</span>=orcl<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin</div></div>
<h3 id="ubuntu-kk-oracle-install">Installing Oracle</h3>
<p>Proceed with installation. My install directory is in <strong>/home/installers</strong> Unpack the downloaded oracle installer:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">gunzip</span> <span style="color: #000000;">10201</span>_database_linux_x86_64.cpio.gz<br />
<span style="color: #c20cb9; font-weight: bold;">cpio</span> <span style="color: #660033;">-id</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000;">10201</span>_database_linux_x86_64.cpio<br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> oracle:oinstall .</div></div>
<p>Normally, Ubuntu Server doesn&#8217;t have X server installed, so you will have problems running the installer as it actuallly has GUI. The easiest way to install this is to access a desktop with X server, and create a connection with SSH forwarding.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-X</span> oracle<span style="color: #000000; font-weight: bold;">@</span>oracle-server</div></div>
<p>From there, fire up the installer:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>installers<span style="color: #000000; font-weight: bold;">/</span>database<br />
.<span style="color: #000000; font-weight: bold;">/</span>runInstaller</div></div>
<p>The GUI should come out on your client machine. Once the installer is up, uncheck the &#8220;<strong>Create Starter Database</strong>&#8221; option, and keep clicking on Next to accept the defaults.</p>
<p>If you encounter some error about the &#8220;<strong>collector</strong>&#8221; you can just ignore this as Ubuntu is not supported.</p>
<p>After the installation, the installer will ask you to run two scripts as root. Run them as is.</p>
<p><strong>Oracle is Installed! X_X</strong></p>
<h3 id="ubuntu-kk-oracle-listener">Creating the Listener</h3>
<p>We create the listener by running the Network Configuration Assistant (needs X server). As with the installer, we need to have X forwarding enabled. The command should be in the oracle path, if not, there might have been a problem with setting up the oracle environment. Run the following as oracle user:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netca</div></div>
<p>Just use the defaults and create the listener.</p>
<h3 id="ubuntu-kk-oracle-database">Creating the Database</h3>
<p>We create a database by running the Database Configuration Assistant (needs X). We also need X forwarding enabled here. Run the assistant with the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">dbca</div></div>
<p>Create the database as you please. Although you have to take note of the Database Name/SID, and it should match the ORACLE_SID environment variable you set on the /etc/profile file.</p>
<h3 id="ubuntu-kk-oracle-startup-script">Creating Startup/Shutdown Scripts</h3>
<p>First, we need to edit the /etc/oratab file.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>oratab</div></div>
<p>My oratab file contains the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">orcl:<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>10g:N</div></div>
<p>Change the last character, <strong>N</strong>, to <strong>Y</strong>.</p>
<p>Next, we edit dbstart as oracle user. Run the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dbstart</div></div>
<p>Look for the following line:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">ORACLE_HOME_LISTNER</span>=<span style="color: #000000; font-weight: bold;">/</span>ade<span style="color: #000000; font-weight: bold;">/</span>vikrkuma_new<span style="color: #000000; font-weight: bold;">/</span>oracle</div></div>
<p>Just change that to your ORACLE_HOME (/opt/oracle/10g) and save the file.</p>
<p>Create a startup script found in /etc/init.d/ named dbora. The following script is taken <a href="http://excession.org.uk/blog/installing-oracle-10g-on-ubuntu-karmic-64-bit-part-2.html" target="_blank">here</a>. Take note of the ORACLE_HOME and ORACLE_SID variables.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># /etc/init.d/dbora</span><br />
<span style="color: #666666; font-style: italic;">#</span><br />
<span style="color: #666666; font-style: italic;"># Startup script for Oracle databases</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_HOME</span>=<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>oracle<span style="color: #000000; font-weight: bold;">/</span>10g<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">ORACLE_SID</span>=orcl<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<br />
<br />
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span><br />
start<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Starting Oracle: &quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">su</span> oracle <span style="color: #660033;">-c</span> <span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dbstart<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>oracle<br />
<br />
<span style="color: #c20cb9; font-weight: bold;">su</span> oracle <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$ORACLE_HOME</span>/bin/emctl start dbconsole&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
stop<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;Shutdown Oracle: &quot;</span><br />
<span style="color: #c20cb9; font-weight: bold;">su</span> oracle <span style="color: #660033;">-c</span> <span style="color: #007800;">$ORACLE_HOME</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>dbshut<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>oracle<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span><br />
<span style="color: #000000; font-weight: bold;">;;</span><br />
<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: 'basename $0' start|stop&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">esac</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></div>
<p>Modify the file so it is executable</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</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>dbora</div></div>
<p>Register it in Ubuntu&#8217;s startup script by running the following:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> update-rc.d dbora defaults <span style="color: #000000;">99</span></div></div>
<p>Everything should be working as is. Try to access Enterprise Manager by accessing port 1158 (default) through HTTP.</p>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/04/27/installing-oracle-10g-on-ubuntu-9-10-karmic-koala-server-64-bit/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>OS X Terminal Keyboard Bindings</title>
		<link>http://obsessivecoder.com/2010/03/09/os-x-terminal-keyboard-bindings/</link>
		<comments>http://obsessivecoder.com/2010/03/09/os-x-terminal-keyboard-bindings/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 02:12:22 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[Whatever]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=36</guid>
		<description><![CDATA[OS X terminal Keyboard bindings for Home and End are messed up by default. Below is a guide to fix it. Go to Terminal &#62; Preferences, or better yet, Command + ,. On the Settings tab, choose the profile you use, and go to the Keyboard tab. Look for the home and end entry, edit [...]]]></description>
			<content:encoded><![CDATA[<p>OS X terminal Keyboard bindings for <strong>Home</strong> and <strong>End</strong> are messed up by default. Below is a guide to fix it.</p>
<p>Go to <strong>Terminal &gt; Preferences</strong>, or better yet, <strong>Command + ,</strong>.</p>
<p>On the <strong>Settings</strong> tab, choose the profile you use, and go to the <strong>Keyboard</strong> tab.</p>
<p>Look for the <strong>home</strong> and <strong>end</strong> entry, edit each of them with the following settings:</p>
<blockquote><p>Key: <strong>home</strong></p>
<p>Modifier: <strong>none</strong></p>
<p>Action: <strong>send string to shell:</strong></p>
<p>Text: <strong>\033OH</strong> (Press <strong>escape</strong> to show &#8216;\033&#8242;, then enter &#8216;O&#8217; as in Orange, not Zero, and &#8216;H&#8217;)</p></blockquote>
<blockquote><p>Key: <strong>end</strong></p>
<p>Modifier: <strong>none</strong></p>
<p>Action: <strong>send string to shell:</strong></p>
<p>Text: <strong>\033OF</strong> (Press <strong>escape</strong> to show &#8216;\033&#8242;, then enter &#8216;O&#8217; as in Orange, not Zero, and &#8216;F&#8217;)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/03/09/os-x-terminal-keyboard-bindings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PostgreSQL 8.4, PostGIS 1.4.1, and pgRouting 1.0.3 on Ubuntu 9.10 (Karmic Koala)</title>
		<link>http://obsessivecoder.com/2010/02/01/installing-postgresql-8-4-postgis-1-4-1-and-pgrouting-1-0-3-on-ubuntu-9-10-karmic-koala/</link>
		<comments>http://obsessivecoder.com/2010/02/01/installing-postgresql-8-4-postgis-1-4-1-and-pgrouting-1-0-3-on-ubuntu-9-10-karmic-koala/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 09:04:28 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[karmic koala]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pgrouting]]></category>
		<category><![CDATA[postgis]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ubuntu 9.10]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=30</guid>
		<description><![CDATA[Go to the bathroom before we start this one! hehe I&#8217;m breaking this into the following 3 sections: Installing PostgreSQL 8.4 Installing PostGIS 1.4.1 Installing pgRouting 1.0.3 Installing PostgreSQL 8.4 Get a working copy of PostgreSQL running. At the time of this writing, Ubuntu has deprecated PostgreSQL 8.3, and has 8.4 as stable. So that&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Go to the bathroom before we start this one! hehe</p>
<p>I&#8217;m breaking this into the following 3 sections:</p>
<ol>
<li><a href="#installing-postgresql-84">Installing PostgreSQL 8.4</a></li>
<li><a href="#installing-postgis-141">Installing PostGIS 1.4.1</a></li>
<li><a href="#installing-pgrouting-103">Installing pgRouting 1.0.3</a></li>
</ol>
<h3 id="installing-postgresql-84">Installing PostgreSQL 8.4</h3>
<p>Get a working copy of PostgreSQL running. At the time of this writing, Ubuntu has deprecated PostgreSQL 8.3, and has 8.4 as stable. So that&#8217;s what aptitude will install here.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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> postgresql</div></div>
<p>Normally, you wouldn&#8217;t have access to the database right now. You need to use the postgres user to set up. I&#8217;d recommend not changing the password of the postgres user. Just create a PostgreSQL super user.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-l</span> postgres<br />
createuser <span style="color: #660033;">-E</span> <span style="color: #660033;">-P</span> <span style="color: #660033;">-s</span> dbsuperuser</div></div>
<p>Now, try to login to the database with the super user you just created.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-W</span> <span style="color: #660033;">-h</span> 127.0.0.1 postgres</div></div>
<p>You should come out with the following prompt:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #007800;">postgres</span>=<span style="color: #666666; font-style: italic;">#</span></div></div>
<h3 id="installing-postgis-141">Installing PostGIS 1.4.1</h3>
<p>We&#8217;re compiling PostGIS, so we gotta get compilers. Normally you&#8217;d have them, unless you made a minimal install. I usually just get the build-essential package to get it over with.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<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> libgeos-dev<br />
<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> proj<br />
<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> postgresql-server-dev-<span style="color: #000000;">8.4</span></div></div>
<p>You need the last one to be able to compile PostGIS. Had a lot of trouble without it, so I just added it. =)</p>
<p>Get the latest version of PostGIS <a href="http://postgis.refractions.net/download/">here</a>. At this time, PostGIS is at 1.4.1.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>postgis.refractions.net<span style="color: #000000; font-weight: bold;">/</span>download<span style="color: #000000; font-weight: bold;">/</span>postgis-1.4.1.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf postgis-1.4.1.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> postgis-1.4.1<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure<br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<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></div></div>
<p>Everything should be compiled. Now we need to create the PostGIS database template. I normally have the naming scheme of template_XXX, so I&#8217;m naming my database as template_postgis.</p>
<p>For the next few statements, you can either switch to the postgres user, so you don&#8217;t have to enter the password everytime. I normally use the super user I create to do this.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">createdb <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> <span style="color: #660033;">-E</span> UNICODE template_postgis<br />
createlang <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> <span style="color: #660033;">-d</span> template_postgis plpgsql<br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_postgis <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postgresql<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.4</span><span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span>postgis.sql<br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_postgis <span style="color: #000000; font-weight: bold;">&amp;</span>lt; <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postgresql<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">8.4</span><span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span>spatial_ref_sys.sql</div></div>
<p>Check your PostGIS installation with the following command:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;SELECT postgis_lib_version();&quot;</span> template_postgis</div></div>
<p>Should give you the version of your PostGIS.</p>
<h3 id="installing-pgrouting-103">Installing pgRouting 1.0.3</h3>
<p>You can follow the official guide <a href="http://pgrouting.postlbs.org/wiki/1.x/InstallationUbuntu904">here</a>.</p>
<p>Now it gets complicated. Stable version 1.0.3 of pgRouting as of the moment isn&#8217;t compatible to compile with 8.4. You have to edit some code&#8230; not really. Just add a few include headers in the C files. =)</p>
<p>Let&#8217;s begin by installing dependencies. First up, libboost&#8230; this is a huge library.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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> libboost-graph-dev<br />
<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> cmake</div></div>
<p>Next, gaul. Check out the latest ones <a href="http://sourceforge.net/projects/gaul/">here</a>. Right now, mine&#8217;s 0.1850-0.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>projects<span style="color: #000000; font-weight: bold;">/</span>gaul<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>gaul-devel<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.1850</span>-<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span>gaul-devel-<span style="color: #000000;">0.1850</span>-<span style="color: #000000;">0</span>.tar.gz<span style="color: #000000; font-weight: bold;">/</span>download<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> gaul-devel-<span style="color: #000000;">0.1850</span>-<span style="color: #000000;">0</span>.tar.gz <br />
<span style="color: #7a0874; font-weight: bold;">cd</span> gaul-devel-<span style="color: #000000;">0.1850</span>-<span style="color: #000000;">0</span><br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--disable-slang</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <br />
<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><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ldconfig</div></div>
<p>Get pgRouting <a href="http://pgrouting.postlbs.org/">here</a>. Now, I don&#8217;t use DD so I skipped installing CGAL and DD.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>files.postlbs.org<span style="color: #000000; font-weight: bold;">/</span>pgrouting<span style="color: #000000; font-weight: bold;">/</span>source<span style="color: #000000; font-weight: bold;">/</span>pgRouting-<span style="color: #000000;">1.03</span>.tgz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-zxvf</span> pgRouting-<span style="color: #000000;">1.03</span>.tgz <br />
<span style="color: #7a0874; font-weight: bold;">cd</span> pgrouting<span style="color: #000000; font-weight: bold;">/</span><br />
cmake -DWITH_TSP=on</div></div>
<p>At this point, if cmake spits out an error like this:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>dijkstra.c: In <span style="color: #000000; font-weight: bold;">function</span> ‘fetch_edge_columns’:<br />
core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>dijkstra.c:<span style="color: #000000;">98</span>: error: ‘INT4OID’ undeclared <span style="color: #7a0874; font-weight: bold;">&#40;</span>first use <span style="color: #000000; font-weight: bold;">in</span> this <span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>dijkstra.c:<span style="color: #000000;">98</span>: error: <span style="color: #7a0874; font-weight: bold;">&#40;</span>Each undeclared identifier is reported only once<br />
core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>dijkstra.c:<span style="color: #000000;">98</span>: error: <span style="color: #000000; font-weight: bold;">for</span> each <span style="color: #000000; font-weight: bold;">function</span> it appears in.<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>dijkstra.c:<span style="color: #000000;">100</span>: error: ‘FLOAT8OID’ undeclared <span style="color: #7a0874; font-weight: bold;">&#40;</span>first use <span style="color: #000000; font-weight: bold;">in</span> this <span style="color: #000000; font-weight: bold;">function</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>There&#8217;s an issue with PostgreSQL 8.4. v1.0.3 still doesn&#8217;t support 8.4 at the moment (<a href="http://pgrouting.postlbs.org/ticket/160">pgRouting Ticket #160</a>), so I have to edit the following files (Hat tip to thge on this one):</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>dijkstra.c<br />
<span style="color: #000000; font-weight: bold;">/</span>core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>astar.c<br />
<span style="color: #000000; font-weight: bold;">/</span>core<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>shooting_star.c</div></div>
<p>Just add the line:</p>
<div class="codecolorer-container c twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="c codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">#include &quot;catalog/pg_type.h&quot;</span></div></div>
<p>That&#8217;ll make pgRouting see PostgreSQL 8.4 data types.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cmake -DWITH_TSP=on<br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<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></div></div>
<p>pgRouting should now be installed in /usr/share/postlbs. As I said before, I like my database naming schemes, so I&#8217;m creating another template for pgRouting called template_pgrouting. Create the database with template_postgis as your base template.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">createdb <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> <span style="color: #660033;">-E</span> UNICODE <span style="color: #660033;">-T</span> template_postgis template_routing<br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_routing <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_core.sql <br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_routing <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_core_wrappers.sql <br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_routing <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_topology.sql <br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_routing <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_tsp.sql <br />
psql <span style="color: #660033;">-U</span> dbsuperuser <span style="color: #660033;">-h</span> 127.0.0.1 <span style="color: #660033;">-W</span> template_routing <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>postlbs<span style="color: #000000; font-weight: bold;">/</span>routing_tsp_wrappers.sql</div></div>
<p>We&#8217;re done!! Grab a coke and go pee! </p>
<p>Update: Fixed package name from build-essentials to build-essential; Added postgres to the psql command to connect to database; Thanks Thera</p>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/02/01/installing-postgresql-8-4-postgis-1-4-1-and-pgrouting-1-0-3-on-ubuntu-9-10-karmic-koala/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Setting Up an Ubuntu 9.10 (Karmic Koala) Linode VPS</title>
		<link>http://obsessivecoder.com/2010/01/21/setting-up-an-ubuntu-9-10-karmic-koala-linode-vps/</link>
		<comments>http://obsessivecoder.com/2010/01/21/setting-up-an-ubuntu-9-10-karmic-koala-linode-vps/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 12:29:20 +0000</pubDate>
		<dc:creator>dukz</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[9.10]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[karmic koala]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ufw]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://obsessivecoder.com/?p=4</guid>
		<description><![CDATA[So I was shopping for a VPS over the past week and decided that Linode would be a good choice. My deciding factor? Check out the benchmarks here by Eivind Uggedal (Thanks btw). So anyway, here&#8217;s a summary: Getting Started with Linode Setup SSH Setup Firewall Getting Started with Linode Now, basically, you&#8217;ll want to [...]]]></description>
			<content:encoded><![CDATA[<p>So I was shopping for a VPS over the past week and decided that Linode would be a good choice. My deciding factor? Check out the benchmarks <a title="VPS Performance Comparison" href="http://journal.uggedal.com/vps-performance-comparison">here</a> by Eivind Uggedal (Thanks btw).</p>
<p>So anyway, here&#8217;s a summary:</p>
<ol>
<li><a href="#getting-started-with-linode">Getting Started with Linode</a></li>
<li><a href="#setup-ssh">Setup SSH</a></li>
<li><a href="#setup-firewall">Setup Firewall</a></li>
</ol>
<h3 id="getting-started-with-linode">Getting Started with Linode</h3>
<p>Now, basically, you&#8217;ll want to follow the <a href="http://library.linode.com/getting-started/">Getting Started with Linode</a> guide&#8230; for me, just setup your default settings, and connect to the server through SSH.</p>
<p>Once in, you&#8217;ll want to secure your system. We&#8217;ll do an upgrade.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> update<br />
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> upgrade</div></div>
<p>Now, create your user, change the password, and add it as a sudoer.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">adduser <span style="color: #660033;">-m</span> john<br />
<span style="color: #c20cb9; font-weight: bold;">passwd</span> john<br />
<span style="color: #666666; font-style: italic;"># visudo uses nano or vi as the editor depending on your environment, normally it's nano on the first try</span><br />
<span style="color: #666666; font-style: italic;"># In case you aren't familiar with these, just use your favorite text editor and edit /etc/sudoers</span><br />
visudo</div></div>
<p>Look for the line:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root &nbsp; &nbsp;<span style="color: #007800;">ALL</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span> ALL</div></div>
<p>And add the following line below it:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">john &nbsp; &nbsp;<span style="color: #007800;">ALL</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>ALL<span style="color: #7a0874; font-weight: bold;">&#41;</span> ALL</div></div>
<p>Oh and btw, change john to whatever username you wish.</p>
<h3 id="setup-ssh">Setup SSH</h3>
<p>This is the most important. Brute force attackers will hit the port 22 first and run common usernames and passwords against. If they detect that port 22 is not open, they&#8217;ll just give up on your IP, and move on to the next. So this is very, VERY important. I make mine listen to&#8230; just kidding. I&#8217;m not telling you of course. Anyway, to change the port, edit /etc/ssh/sshd_config (Use whatever text editor you are comfortable with, mine&#8217;s VI):</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>sshd_config</div></div>
<p>Edit the following configurations:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Port <span style="color: #000000;">22</span><br />
PermitRootLogin <span style="color: #c20cb9; font-weight: bold;">yes</span></div></div>
<p>Change listening port to whatever port you might want to listen to (E.G. 22123), and disallow root login (change it to no). Save your file, and restart your SSH service by running:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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><span style="color: #c20cb9; font-weight: bold;">ssh</span> restart</div></div>
<p>You just made your server 10-fold more secure.</p>
<h3 id="setup-firewall">Setup Firewall</h3>
<p>So Ubuntu recommends ufw (Uncomplicated Firewall). This isn&#8217;t uncomplicated at all if you are used to iptables as you have to relearn the commands. No fear, it&#8217;s pretty simple. First up, let&#8217;s get it working:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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> ufw<br />
<span style="color: #666666; font-style: italic;"># Next line is depending on the SSH port that you allowed, very, Very, VERY important! =)</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ufw allow <span style="color: #000000;">22123</span><br />
<span style="color: #666666; font-style: italic;"># Next 2 lines is if you want HTTP/HTTPS, which you most probably will</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ufw allow <span style="color: #000000;">80</span><br />
<span style="color: #c20cb9; font-weight: bold;">sudo</span> ufw allow <span style="color: #000000;">443</span></div></div>
<p>That&#8217;s it. If you want to delete the rule again, just run:</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">sudo</span> ufw delete deny <span style="color: #000000;">80</span></div></div>
<p>And it&#8217;ll remove block the HTTP service.</p>
]]></content:encoded>
			<wfw:commentRss>http://obsessivecoder.com/2010/01/21/setting-up-an-ubuntu-9-10-karmic-koala-linode-vps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
