<?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>non-random ramble &#187; sysadmin</title>
	<atom:link href="http://jimbarritt.com/non-random/category/devops/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimbarritt.com/non-random</link>
	<description>adventures in code</description>
	<lastBuildDate>Tue, 03 Aug 2010 19:57:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Install Oracle XE 10g On OS X with VMWare Fusion</title>
		<link>http://jimbarritt.com/non-random/2010/04/21/install-oracle-xe-10g-on-os-x-with-vmware-fusion/</link>
		<comments>http://jimbarritt.com/non-random/2010/04/21/install-oracle-xe-10g-on-os-x-with-vmware-fusion/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 13:40:09 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/?p=392</guid>
		<description><![CDATA[Oracle don&#8217;t yet provide a native OS X installer for XE but you can install it on a virtual machine running under OS X. I found a very detailed article here [1] but also found it quite hard to follow, so thought I would post my own experience here, referring back to that one where [...]]]></description>
			<content:encoded><![CDATA[<p><img alt="Oracle HQ" src="http://www.tonie.net/images/sanjose2001/siliconvalley/oracle1.jpg" title="Oracle HQ" class="aligncenter" width="400"  /></p>
<p>Oracle don&#8217;t yet provide a native OS X installer for XE but you can install it on a virtual machine running under OS X.</p>
<p>I found a very detailed article here <a href="#REF-1">[1]</a> but also found it quite hard to follow, so thought I would post my own experience here, referring back to that one where appropriate.</p>
<p>First you need <a href="http://www.vmware.com/products/fusion/">VMWare Fusion</a></p>
<p>I have installed Windows XP SP 2 on there.</p>
<p>The installation of Fusion and XP was pretty straightforward, just point and click. Once the windows guest machine is set up, fusion should prompt you to install VMWare tools which makes the graphics look much better. It will also ask you to install McAffee anti virus (its a free 12 month trial) which I did. </p>
<p>According to <a href="#REF-1">[1]</a>, it is important to set the computer name. In my case I set this to be &#8220;winxp-guest&#8221; (right click My Computer).</p>
<p>Next thing is to get the networking set up correctly. You have 3 options with VMWare Fusion:</p>
<ul>
<li>NAT &#8211; share the network adapter with the host machine</li>
<li>BRIDGED &#8211; VM appears to be a seperate machine to the host</li>
<li>PRIVATE &#8211; VM is only available within the host machine and not on the wider network</li>
</ul>
<p>PRIVATE networking means your VM cannot connect to the internet, so the best option is <b>NAT</b></p>
<p>When you change your network settings you need to renew your network config:</p>
<pre name='code' class='java:nogutter:nocontrols'>
ipconfig /release
ipconfig /renew
</pre>
<p>You should see your IP address like this:</p>
<pre name='code' class='java:nogutter:nocontrols'>
C:\Documents and Settings\Administrator>ipconfig /renew
Windows IP Configuration
Ethernet adapter Local Area Connection:
       Connection-specific DNS Suffix  . : localdomain
       IP Address. . . . . . . . . . . . : 192.168.xx.xxx
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 192.168.xx.xx
</pre>
<p>In order to be able to connect to your guest machine from outside, you need to configure firewalls&#8230;</p>
<p>Initially, I disabled McAffee. Once I got everything working, I re-enabled Mcaffee and found that when I tried to access using SqlDeveloper it automatically asked me if I wanted to allow this program.</p>
<p>To setup the windows firewall, you need to go to Control Panel -> Windows Firewall -> Exceptions -> Add Port&#8230;<br />
You&#8217;ll need to do this twice, one for http access to the admin tool (8080) and one for client access (1521 which is the default) </p>
<p>You also need to select Advanced -> ICMP -> Allow incoming echo request if you want to be able to ping it.</p>
<p>From the host:<br />
<pre name='code' class='java:nogutter:nocontrols'>
ping 192.168.xx.xxx
64 bytes from 192.168.xx.xxx: icmp_seq=0 ttl=128 time=0.290 ms
64 bytes from 192.168.xx.xxx: icmp_seq=1 ttl=128 time=0.498 ms
</pre></p>
<p>You should also setup your hosts file on the host computer:</p>
<pre name='code' class='java:nogutter:nocontrols'>
sudo vi /etc/hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost
192.168.xx.xxx winxp-guest winxp-guest.localdomain
</pre>
<p>The localdomain part I found out from installing apache. Note, I also ran &#8220;Network ID&#8221; wizard from the My Computer-> Computer Name screen, not sure if that made a difference.</p>
<p>Now you can <code>ping winxp-guest</code></p>
<p>To check that everything is in order, I installed <a href="http://www.apache.org/dist/httpd/binaries/win32/">apache</a> on the guest </p>
<p>I picked <code>httpd-2.2.15-win32-x86-no_ssl.msi</code> and within a few moments I can navigate to <code>http://winxp-guest</code>on the guest machine and see an apache &#8220;It Works!&#8221; page.</p>
<p>I can also do this from my host machine, so networking is all good.</p>
<p>In the reference it mentions setting up the windows hosts file aswell on the guest machine, this is so that everything works on the guest machine with the tnsnames.ora file (it get generated to point to whatever the hostname of your machine is). It is not important to connect from the host machine.</p>
<pre name='code' class='java:nogutter:nocontrols'>
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host
127.0.0.1       localhost
192.168.xx.xxx winxp-guest winxp-guest.localdomain
</pre>
<p>Next install Oracle XE itself. The only thing required to enter here is a password, which you will later use to log in to the web interface with the user &#8220;SYSTEM&#8221;</p>
<p>Once installed, you can launch the home page and log in as SYSTEM. The first thing to do is to change &#8220;Administration->Http Access&#8221; which will allow computers outside the machine to access the admin console.</p>
<p>Then you can try it out using sqlplus. I found there was a mistake in the Environment PATH variable &#8211; it had referred to the bin directory as &#8220;bin&#8221; but in windows it was actually &#8220;BIN&#8221;. Changing it made it work for me.</p>
<pre name='code' class='java:nogutter:nocontrols'>
sqlplus SYSTEM/{password}@XE
SQL> create table foo (bar number, baz varchar(255));
SQL> insert into foo VALUES (2, &#8216;blah&#8217;);
SQL> select * from foo;
       BAR
&#8212;&#8212;&#8212;-
BAZ
&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;
         2
blah
SQL> drop table foo;
</pre>
<p>Brilliant. You have an oracle database.</p>
<p>The connection XE is from your tnsnames.ora file which lives (in default install) at <code>C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN</code></p>
<p>and contains:</p>
<pre name='code' class='java:nogutter:nocontrols'>
XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = winxp-guest)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )
</pre>
<p>Notice the hostname in here. Presumably if you wanted to change this you could update this file and the computer name and your hosts file.</p>
<p>Next step is to try accessing from the host machine.</p>
<p>I used Oracle <a href="http://www.oracle.com/technology/software/products/sql/index.html">SQLDeveloper</a></p>
<p>I used a jdbc connection string of jdbc:oracle:thin:@winxp-guest:1521:xe</p>
<p>Note that as long as you update /etc/hosts on the host machine, you can call the computer whatever you like (e.g. oraclexe)</p>
<p>Something you might need to do is create a new tablespace. You can do this through the oracle administration console. Go to &#8220;home&#8221; and then SQL and you can execute sql like this:<br />
<pre name='code' class='java:nogutter:nocontrols'>
create tablespace
 datafile &#8216;/ORACLEXE/ORADATA/XE/{table_space_name}/{table_space_name}.dbf&#8217; size 500m;
</pre></p>
<p>References:</p>
<p><a name="REF-1">[1] http://blog.mclaughlinsoftware.com/how-to-configure-mac-os-x-as-an-oracle-client/</a></table_space_name>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2010/04/21/install-oracle-xe-10g-on-os-x-with-vmware-fusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passing System Properties and Environment Variables to unit tests in Maven &#8211; Update</title>
		<link>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/</link>
		<comments>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 18:53:19 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[build]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[thoughtblog]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/</guid>
		<description><![CDATA[Unfortunately there was an bug in my previous post. I had naively assumed that the syntax for environment variables was the same as for system properties but alas not. The correct code is:]]></description>
			<content:encoded><![CDATA[<p>Unfortunately there was an bug in my previous post.</p>
<p>I had naively assumed that the syntax for environment variables was the same as for system properties but alas not.</p>
<p>The correct code is:</p>
<pre name='code' class='xml:nogutter:nocontrols'>
<build>
    <defaultgoal>package</defaultgoal>
        &lt;plugins>
        &lt;plugin>
               <groupid>org.apache.maven.plugins</groupid>
               <artifactid>maven-surefire-plugin</artifactid>
               <version>2.4.2</version>
               <configuration>
                   <environmentvariables>
                       <some_env_variable>some value</some_env_variable>
                   </environmentvariables>
                   <systemproperties>
                       &lt;property>
                           <name>acceptance.test.host</name>
                           <value>${acceptance.test.host}</value>
                       &lt;/property>
                   </systemproperties>
                </configuration>
           &lt;/plugin>
       &lt;/plugins>
</build>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/09/15/passing-system-properties-and-environment-variables-to-unit-tests-in-maven-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if an command was successful in bash</title>
		<link>http://jimbarritt.com/non-random/2009/09/03/check-if-an-command-was-successful-in-bash/</link>
		<comments>http://jimbarritt.com/non-random/2009/09/03/check-if-an-command-was-successful-in-bash/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 17:21:03 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[linux commands]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2009/09/03/check-if-an-command-was-successful-in-bash/</guid>
		<description><![CDATA[When scripting gigantic build scripts with bash, its important that if anything fails you halt the script. Heres how: function checkResult() { RESULT=$1 if [ $RESULT -ne 0 ] ; then echo echo "!!!!!!!!!!! Build Failed !!!!!!!!!!!!!!!!!" echo exit $RESULT fi } You call it like this: ./someCommandOrScript.sh checkResult $?]]></description>
			<content:encoded><![CDATA[<p>When scripting gigantic build scripts with bash, its important that if anything fails you halt the script.</p>
<p>Heres how:</p>
<pre>
function checkResult() {
	RESULT=$1
	if [ $RESULT -ne 0 ] ; then
		echo
		echo "!!!!!!!!!!!  Build Failed !!!!!!!!!!!!!!!!!"
		echo
		exit $RESULT
	fi
}
</pre>
<p>You call it like this:</p>
<pre>
./someCommandOrScript.sh
checkResult $?
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2009/09/03/check-if-an-command-was-successful-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Edit GMail messages using Vim</title>
		<link>http://jimbarritt.com/non-random/2008/11/20/edit-gmail-messages-using-vim/</link>
		<comments>http://jimbarritt.com/non-random/2008/11/20/edit-gmail-messages-using-vim/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 13:45:29 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2008/11/20/edit-gmail-messages-using-vim/</guid>
		<description><![CDATA[Ok, why would you want to do this ? Because you can. 1) Install this add-on which allows you to edit text areas in firefox using an external editor: https://addons.mozilla.org/en-US/firefox/addon/4125 2) Install VIM ftp://ftp.vim.org/pub/vim/pc/gvim72.exe 3) Setup the plugin to use vim (addOns->its all text addon->options) 4) make sure gmail is using &#8220;plain text&#8221; as editing [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, why would you want to do this ?</p>
<p>Because you can.</p>
<p>1) Install this add-on which allows you to edit text areas in firefox using an external editor:</p>
<p><a href='https://addons.mozilla.org/en-US/firefox/addon/4125'>https://addons.mozilla.org/en-US/firefox/addon/4125</a></p>
<p>2) Install VIM</p>
<p><a href='ftp://ftp.vim.org/pub/vim/pc/gvim72.exe'>ftp://ftp.vim.org/pub/vim/pc/gvim72.exe</a></p>
<p>3) Setup the plugin to use vim (addOns->its all text addon->options)</p>
<p>4) make sure gmail is using &#8220;plain text&#8221; as editing &#8211; otherwise its not a text area, but some mad iframe.</p>
<p>6) Happy Days!</p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2008/11/20/edit-gmail-messages-using-vim/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Read in a list of files and loop over them in bash</title>
		<link>http://jimbarritt.com/non-random/2008/11/08/read-in-a-list-of-files-and-loop-over-them-in-bash/</link>
		<comments>http://jimbarritt.com/non-random/2008/11/08/read-in-a-list-of-files-and-loop-over-them-in-bash/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 12:10:09 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2008/11/08/read-in-a-list-of-files-and-loop-over-them-in-bash/</guid>
		<description><![CDATA[Needed to do this and after a bit of looking around (Bash scripting) came up with this: #!/bin/bash FILE_LIST_SOURCE=listoffiles.txt DEFAULT_FILE="some.default.file" [ -f $FILE_LIST_SOURCE ] &#038;&#038; LIST_OF_FILES=$(cat $FILE_LIST_SOURCE) LIST_OF_FILES=${LIST_OF_FILES:-$DEFAULT_FILE} #echo -e "\\nLIST_OF_FILES:\\n$LIST_OF_FILES" echo "List of files:" for i in $LIST_OF_FILES; do echo $i done]]></description>
			<content:encoded><![CDATA[<p>Needed to do this and after a bit of looking around (<a href='http://www.google.co.uk/url?sa=t&#038;source=web&#038;ct=res&#038;cd=1&#038;url=http%3A%2F%2Fwww.cv.nrao.edu%2F~jmalone%2Ftalks%2Fbash.pdf&#038;ei=XoMVScOHCZjy1gbz1dDsCg&#038;usg=AFQjCNFEf2kRUTBYObiCtfj8HtJWd4YyyQ&#038;sig2=ZQthS3itRMWZ7UENOwwC1w'>Bash scripting</a>) came up with this:</p>
<blockquote>
<pre>
<code>
#!/bin/bash

FILE_LIST_SOURCE=listoffiles.txt
DEFAULT_FILE="some.default.file"

[ -f $FILE_LIST_SOURCE ] &#038;&#038; LIST_OF_FILES=$(cat $FILE_LIST_SOURCE)

LIST_OF_FILES=${LIST_OF_FILES:-$DEFAULT_FILE}

#echo -e "\\nLIST_OF_FILES:\\n$LIST_OF_FILES"

echo "List of files:"
for i in $LIST_OF_FILES; do
    echo $i
done

</code>
</pre>
<p></blockqoute></p>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2008/11/08/read-in-a-list-of-files-and-loop-over-them-in-bash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fanout</title>
		<link>http://jimbarritt.com/non-random/2008/10/31/fanout/</link>
		<comments>http://jimbarritt.com/non-random/2008/10/31/fanout/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 09:34:40 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2008/10/31/fanout/</guid>
		<description><![CDATA[this utility allows you to execute the same command on multiple NIX servers via ssh terminals. Original article is at http://www.samag.com/documents/s=9365/sam0405g/0405g.htm Installing Fanout Fanout and fanterm are shell scripts and require no compiling or other building. Simply download the tarball from stearns.org (or one of its mirrors), extract it, and put the relevant scripts in [...]]]></description>
			<content:encoded><![CDATA[<p>this utility allows you to execute the same command on multiple NIX servers via ssh terminals.<br />
Original article is at <a href="http://www.samag.com/documents/s=9365/sam0405g/0405g.htm">http://www.samag.com/documents/s=9365/sam0405g/0405g.htm</a></p>
<blockquote><p>Installing Fanout</p>
<p>Fanout and fanterm are shell scripts and require no compiling or other building. Simply download the tarball from stearns.org (or one of its mirrors), extract it, and put the relevant scripts in one of the local bin directories in your PATH. The current version as of this writing is 0.6.1. The installation is as simple as the following (putting the relevant files in /opt/adm/bin):</p>
<pre>

<code>

[jd@dace] $ cd /tmp
[jd@dace] $ wget http://www.stearns.org/fanout/fanout-0.6.1.tar.gz
[download output]
[jd@dace] $ gzip -c fanout-0.6.1.tar.gz | tar xf -
[jd@dace] $ cd fanout-0.6.1
[jd@dace] $ cp fanout fanterm fanmux fanmux.sh /opt/adm/bin

</code>
</pre>
<p>There are also README, INSTALL, and other documentation files provided with fanout, which you should read and understand before proceeding.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2008/10/31/fanout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Boot / Startup Keys</title>
		<link>http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/</link>
		<comments>http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/#comments</comments>
		<pubDate>Sun, 02 Dec 2007 16:07:27 +0000</pubDate>
		<dc:creator>Jim Barritt</dc:creator>
				<category><![CDATA[os x]]></category>
		<category><![CDATA[sysadmin]]></category>

		<guid isPermaLink="false">http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/</guid>
		<description><![CDATA[So there are other places where these can be found but im always forgetting where they are. Here are a few choice ones. They all need to be held down after boot when the noise happens. Mouse down : eject media shift : disable login items cmd-v : show console cmd-s : single user mode [...]]]></description>
			<content:encoded><![CDATA[<p>So there are other places where these can be found but im always forgetting where they are. Here are a few choice ones.</p>
<p>They all need to be held down after boot when the noise happens.</p>
<ul>
<li>Mouse down : eject media</li>
<li>shift :  disable login items</li>
<li>cmd-v : show console</li>
<li>cmd-s : single user mode</li>
<li>c : boot from CD</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jimbarritt.com/non-random/2007/12/03/mac-os-x-boot-startup-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
