<?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"
	>

<channel>
	<title>number 9</title>
	<atom:link href="http://number9.hellooperator.net/feed" rel="self" type="application/rss+xml" />
	<link>http://number9.hellooperator.net</link>
	<description>a bird to bring my message home</description>
	<pubDate>Sun, 06 Jul 2008 06:20:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Solaris Express ZFS root install</title>
		<link>http://number9.hellooperator.net/articles/2008/06/06/solaris-express-zfs-root-install</link>
		<comments>http://number9.hellooperator.net/articles/2008/06/06/solaris-express-zfs-root-install#comments</comments>
		<pubDate>Fri, 06 Jun 2008 14:00:53 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[howto]]></category>

		<category><![CDATA[install]]></category>

		<category><![CDATA[solaris]]></category>

		<category><![CDATA[zfs]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/?p=139</guid>
		<description><![CDATA[Finally!
 

 
ZFS root has been in Indiana (aka OpenSolaris 2008.05) for a while, but I prefer Solaris Express.
As of build 90, it’s supported by the installer.
I installed it on my crappy P4 test box : 1Gb Ram, twin 40Gb disks. Burn the DVD ISO and boot it if you want to play along.
the secret handshake
Choose ‘Solaris Express’ [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Finally!</strong></p>
<p> </p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/06/ufs-or-zfs.png"><img class="alignnone size-medium wp-image-141" title="ufs-or-zfs" src="http://number9.hellooperator.net/wp-content/uploads/2008/06/ufs-or-zfs-300x222.png" alt="About frigging time" width="300" height="222" /></a></p>
<p> </p>
<p><span class="caps">ZFS</span> root has been in Indiana (<em>aka OpenSolaris 2008.05</em>) for a while, but I prefer Solaris Express.<br />
As of build 90, it’s supported by the installer.</p>
<p>I installed it on my crappy P4 test box : 1Gb Ram, twin 40Gb disks. Burn the <a href="http://www.opensolaris.org/os/downloads/sol_ex_dvd_1/">DVD ISO</a> and boot it if you want to play along.</p>
<h2>the secret handshake</h2>
<p>Choose ‘<strong>Solaris Express</strong>’ <em>(</em><strong><em>not</em></strong><em> ‘Solaris Express Developer Edition)</em>, then &#8216;3<strong> . Solaris Interactive Text (Desktop Session)</strong>&#8216;</p>
<p>Only the ‘Interactive Text’ options have the <span class="caps">ZFS</span> root option.<br />
Running ‘Desktop’ not ‘Console’ session lets you start a Terminal<br />
to enable compression on the pool when its created (<em>40Gb disks, remember?</em>).</p>
<p>Enabling <span class="caps">ZFS</span> compression won’t convert blocks that have already been written <em>(</em><a href="http://blogs.sun.com/mmusante/entry/zfs_compression_and_you"><em>good explanation here</em></a><em>)</em>, so you want to do it before you populate the filesystem.</p>
<h2>you know the drill</h2>
<ul>
<li>Choose ‘English’</li>
<li><em>[X starts up]</em></li>
<li>rightclick the desktop and choose ‘programs -&gt; terminal’</li>
<li>system id
<ul>
<li>networked: yes</li>
<li><span class="caps">DHCP</span>: yes</li>
<li>IPv6: no</li>
<li><em>[it'll do a DHCP request]</em></li>
<li>Kerberos: no</li>
<li>Name service : None (no need if you’re on <span class="caps">DHCP</span>)</li>
<li><span class="caps">NFS</span> domain : Use NFSv4 domain derived by the system</li>
<li>Time Zone : Europe -&gt; Britain (UK)</li>
<li>root password : ‘secret’ (heh)</li>
</ul>
</li>
<li>F2. Standard install</li>
<li>Manually eject <span class="caps">DVD</span></li>
<li>Manually reboot</li>
<li>Choose Media : CD/DVD</li>
<li>Accept license</li>
<li>Geographic regions – leave all blank</li>
<li>System Locale : <span class="caps">POSIX C</span> (C)</li>
<li>Web Start : None</li>
<li><strong>Choose Filesystem Type : <span class="caps">ZFS</span></strong></li>
<li>Select Software : Entire Distribution</li>
<li>choose both disks (this makes a <span class="caps">ZFS</span> mirrored pool)</li>
<li>select ‘put /var on a separate dataset’ (personal choice, but stops / filling up)</li>
<li>Skip ‘Mount Remote File Systems’</li>
</ul>
<h2>fingers on buzzers</h2>
<p>In the Terminal you opened, create a script called &#8216;readysetgo.sh&#8217;</p>
<pre><code>
#! /bin/sh
until [ "`zpool list rpool`" ];
do
    :
done
</code></pre>
<p>Then just run</p>
<pre>sh readysetgo.sh ; pfexec zfs set compression=on rpool</pre>
<p>in the Terminal you opened earlier.<br />
You can now start the install. Once the pool is created, it&#8217;ll have compression<br />
enabled automatically.</p>
<h2>scrooged</h2>
<p>Let&#8217;s see how much benefit we got. The ‘Entire Distribution’ took about<br />
5Gb of disk without compression, looks to be about 3 Gb with..</p>
<pre><code>vera:~ $ zfs get -r compressratio rpool
NAME                    PROPERTY       VALUE                   SOURCE
rpool                   compressratio  1.62x                   -
rpool/ROOT              compressratio  1.74x                   -
rpool/ROOT/snv_90       compressratio  1.74x                   -
rpool/ROOT/snv_90/var   compressratio  2.60x                   -
rpool/dump              compressratio  1.00x                   -
rpool/swap              compressratio  1.37x                   -
vera:~ $</code></pre>
<p><em>(UPDATED -  thanks to <a href="http://blogs.sun.com/glagasse/entry/howto_enable_zfs_compression_when">Glenns blog</a></em><a href="http://blogs.sun.com/glagasse/entry/howto_enable_zfs_compression_when"></a> for the neater script)</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/06/06/solaris-express-zfs-root-install/feed</wfw:commentRss>
		</item>
		<item>
		<title>changing the default JVM on OSX Leopard</title>
		<link>http://number9.hellooperator.net/articles/2008/05/21/changing-the-default-jvm-on-osx-leopard</link>
		<comments>http://number9.hellooperator.net/articles/2008/05/21/changing-the-default-jvm-on-osx-leopard#comments</comments>
		<pubDate>Wed, 21 May 2008 06:53:52 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/?p=137</guid>
		<description><![CDATA[I’ve been using a bit of Java lately, and the OSX 1.6 JVM seemed pretty stable.
JRuby is the next thing on my geek list, and that runs best on Java 6.
Although the 1.6 JDK was installed in the last system update, it&#8217;s not the default:
 
hypnotoad:Desktop $ /usr/bin/java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve <a href="http://number9.hellooperator.net/articles/category/java">been using a bit of Java lately</a>, and the <span class="caps">OSX 1</span>.6 <span class="caps">JVM</span> seemed pretty stable.</p>
<p>JRuby is the next thing on my geek list, and that runs best on Java 6.</p>
<p>Although the 1.6 JDK was installed in the last system update, it&#8217;s not the default:<br />
 </p>
<pre><code>hypnotoad:Desktop $ /usr/bin/java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)
hypnotoad:Desktop $
hypnotoad:~ $ ls -l `which java`
lrwxr-xr-x  1 root  wheel  74 30 Apr 10:07 /usr/bin/java -&gt; /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java
hypnotoad:~ $ cd /System/Library/Frameworks/JavaVM.framework/Versions/
hypnotoad:Versions $ ls -ld Current*
lrwxr-xr-x  1 root  wheel    1 30 Apr 10:08 Current -&gt; A
lrwxr-xr-x  1 root  wheel    3 30 Apr 10:07 CurrentJDK -&gt; 1.5</code></pre>
<p>I know what you’re thinking. <strong>Don’t</strong>.<br />
Re-pointing those symlinks <em>seems</em> to work, but in fact<br />
it breaks all your <span class="caps">GUI</span> apps (the ‘A’ is for <span class="caps">AWT</span>)::</p>
<pre><code>hypnotoad:Versions $ jconsole
2008-05-20 23:26:20.524 jconsole[680:10b] Apple AWT Startup Exception : ** -[NSCFArray insertObject:atIndex:]: attempt to insert nil
2008-05-20 23:26:20.525 jconsole[680:10b] Apple AWT Restarting Native Event Thread</code></pre>
<p>Instead, you want to open<br />
<strong>/Applications/Utilities/Java/Java Preferences.App</strong><br />
and tell it you want to use 1.6:</p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/05/leopard-javaprefs.png"><img class="alignnone size-medium wp-image-138" title="leopard-javaprefs" src="http://number9.hellooperator.net/wp-content/uploads/2008/05/leopard-javaprefs-221x300.png" alt="" width="221" height="300" /></a></p>
<pre><code>hypnotoad:~ $ java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13-120)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_05-b13-52, mixed mode)
hypnotoad:~ $</code></pre>
<p><em>( ignore the text about ‘when an applet is executed in this browser’ - Intel Safari is 32-bit, and</em><a href="http://images.hellooperator.net/no_pony.jpg"><em> if you&#8217;re on PPC you don&#8217;t get JAVA 6 anyway </em></a><em>).</em></p>
<p>That Steve Jobs has a great sense of humour.</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/05/21/changing-the-default-jvm-on-osx-leopard/feed</wfw:commentRss>
		</item>
		<item>
		<title>Roller 4 on Glassfish v3</title>
		<link>http://number9.hellooperator.net/articles/2008/05/20/roller-4-on-glassfish-v3</link>
		<comments>http://number9.hellooperator.net/articles/2008/05/20/roller-4-on-glassfish-v3#comments</comments>
		<pubDate>Tue, 20 May 2008 11:12:56 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[glassfish]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/?p=136</guid>
		<description><![CDATA[I did Roller 3 on Glassfish 2 a while back
so thought that’d be the simplest thing to put on Glassfish3. The process has got quite a bit easier.
get roller
curl -O http://www.mirrorservice.org/sites/ftp.apache.org/roller/roller-4/v4.0.0/bin/apache-roller-4.0.zip
unzip apache-roller-4.0.zip
setup an empty database
Roller4 isn’t perfect, but it kicks ass when it comes to auto-generating its
own database tables. It still needs the actual database [...]]]></description>
			<content:encoded><![CDATA[<p>I did <a href="http://number9.hellooperator.net/roller-on-glassfish">Roller 3 on Glassfish 2 a while back</a><br />
so thought that’d be the simplest thing to put on Glassfish3. The process has got quite a bit easier.</p>
<h2>get roller</h2>
<pre><code>curl -O http://www.mirrorservice.org/sites/ftp.apache.org/roller/roller-4/v4.0.0/bin/apache-roller-4.0.zip
unzip apache-roller-4.0.zip</code></pre>
<h2>setup an empty database</h2>
<p>Roller4 isn’t perfect, but it kicks ass when it comes to auto-generating its<br />
own database tables. It still needs the <a href="http://number9.hellooperator.net/javadb-and-glassfish-v3-to-embed-or-not-to-embed">actual database</a> to exist, though:</p>
<pre><code>asadmin create-jdbc-connection-pool \
--datasourceclassname org.apache.derby.jdbc.EmbeddedDataSource \
--property databaseName=\$\{com.sun.aas.instanceRoot\}/databases/rollerdb:\
connectionAttributes=\;create\\=true rollerpool
asadmin ping-connection-pool rollerpool
asadmin create-jdbc-resource --connectionpoolid=rollerpool jdbc/rollerdb</code></pre>
<p><em>(those of you playing along at home on an embedded database should look at <a href="http://number9.hellooperator.net/articles/2008/05/20/passing-jvm-options-to-glassfish">upping your PermGen space</a> at this point).</em></p>
<h1>tweak roller</h1>
<p>Roller 4 uses <span class="caps">JNDI</span> to find its DB by default, so there isn’t much to tweak:</p>
<pre><code>cd ~/apache-roller-4.0/webapp/roller/WEB-INF/classes
curl -O http://files.hellooperator.net/glassfish/webapps/roller-custom.properties
</code></pre>
<p>You’ll want to change the mailserver to one you can use.</p>
<p>The full bewildering list of possible roller properties is in <a href="http://www.smudge-it.co.uk/pub/apache/roller/roller-4/v4.0.0/docs/roller-install-guide.pdf">the Install Guide</a></p>
<p>You should <a href="http://rollerweblogger.org/wiki/Wiki.jsp?page=ChangeSecurityKeys">make these changes to security.xml</a>, too <em>(<a href="http://www.schneier.com/blog/archives/2008/05/random_number_b.html">unless you’re on Debian</a> , hee hee)</em>.</p>
<h1>make and deploy a <span class="caps">WAR</span></h1>
<pre><code>cd ~/apache-roller-4.0/webapp/roller
jar cvf ~/roller.war *
asadmin deploy ~/roller.war</code></pre>
<p>Browse to <a href="http://localhost:8080/roller">http://localhost:8080/roller</a> and try it out.</p>
<p>The database is created when you first connect, and the first user you make is the site admin.</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/05/20/roller-4-on-glassfish-v3/feed</wfw:commentRss>
		</item>
		<item>
		<title>passing JVM options to Glassfish</title>
		<link>http://number9.hellooperator.net/articles/2008/05/20/passing-jvm-options-to-glassfish</link>
		<comments>http://number9.hellooperator.net/articles/2008/05/20/passing-jvm-options-to-glassfish#comments</comments>
		<pubDate>Tue, 20 May 2008 11:07:33 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[database]]></category>

		<category><![CDATA[glassfish]]></category>

		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/?p=134</guid>
		<description><![CDATA[One downside to embedding your database server is that Glassfish needs more memory.
I&#8217;d been messing around with a few webapps and yesterday got Roller4 running. After a few clicks around the app, I started to see &#8216;PermGen space: java.lang.OutOfMemoryError&#8217; errors. 
 
More power, Doctor
The fix is pretty obvious : have the JVM allocate more PermGen space.
It&#8217;s simple to do this [...]]]></description>
			<content:encoded><![CDATA[<p>One downside to <a href="http://number9.hellooperator.net/javadb-and-glassfish-v3-to-embed-or-not-to-embed">embedding your database server</a> is that Glassfish needs more memory.</p>
<p>I&#8217;d been messing around with a few webapps and yesterday got <a href="http://number9.hellooperator.net/roller-4-on-glassfish-v3">Roller4</a> running. After a few clicks around the app, I started to see <strong>&#8216;PermGen space: java.lang.OutOfMemoryError&#8217; <span style="font-weight: normal;">errors. </span></strong></p>
<p> </p>
<h2>More power, Doctor</h2>
<p>The fix is pretty obvious : have the JVM allocate more PermGen space.</p>
<p>It&#8217;s simple to do this through the admin UI<em> ( &#8216;Application Server&#8217; -&gt; &#8216;JVM Settings&#8217; -&gt; &#8216;JVM Options&#8217;).</em></p>
<p>Or you can do it on the command line:</p>
<pre><code> hypnotoad:~ $ asadmin create-jvm-options \-XX\\:MaxPermSize=128m
created 1 option(s)
Command create-jvm-options executed successfully.
hypnotoad:~ $ </code></pre>
<p>You need to restart the server for it to actually take effect.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/05/20/passing-jvm-options-to-glassfish/feed</wfw:commentRss>
		</item>
		<item>
		<title>JavaDB and Glassfish v3 : to embed or not to embed</title>
		<link>http://number9.hellooperator.net/articles/2008/05/15/javadb-and-glassfish-v3-to-embed-or-not-to-embed</link>
		<comments>http://number9.hellooperator.net/articles/2008/05/15/javadb-and-glassfish-v3-to-embed-or-not-to-embed#comments</comments>
		<pubDate>Thu, 15 May 2008 15:13:28 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[database]]></category>

		<category><![CDATA[glassfish]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/?p=133</guid>
		<description><![CDATA[Glassfish v3 ships with JavaDB (aka Apache Derby aka Cloudscape).
I’ll be using this for trying out Rails and JRuby, but it’s also handy
for things like authentication via JDBC Realms.
A JavaDB database is essentially a directory that only one process can access at a time. This can be Glassfish itself (an embedded database) or a standalone [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://number9.hellooperator.net/articles/2008/05/13/gf3-first-look">Glassfish v3</a> ships with JavaDB <em>(aka Apache Derby aka Cloudscape)</em>.<br />
I’ll be using this for trying out Rails and JRuby, but it’s also handy<br />
for things like authentication via JDBC Realms.</p>
<p>A JavaDB database is essentially a directory that only one process can access at a time. This can be Glassfish itself (an <em>embedded database</em>) or a standalone database process (<em>that serves SQL clients over </em><span class="caps"><em>TCP</em></span><em>/IP</em>).</p>
<p>Both have pros and cons. I’ll take you through creating both.</p>
<h2>option 1: standalone database server</h2>
<p>The main benefit to running a network server process is that<br />
it&#8217;s the only way for multiple clients to access the database simultaneously<br />
(it’s also the only option that makes sense if you were clustering Glassfish - personally <a href="http://number9.hellooperator.net/articles/category/postgresql">I’d use PostgreSQL</a> in that case).</p>
<p>If you need to create a schema before you deploy a webapp (with NetBeans or ‘rake migrate’)<br />
you&#8217;ll have to stop Glassfish first unless you go down this route.</p>
<pre><code>hypnotoad:databases $ asadmin start-database --dbhost 127.0.0.1
Database started in Network Server mode on host 127.0.0.1 and port 1527.
Could not connect to Derby Network Server on host 127.0.0.1 port 1527.
Starting database in the background.
Log redirected to /Users/dick/Applications/glassfishv3-tp2/glassfish/databases/derby.log.
Command start-database executed successfully.</code></pre>
<p>( <strong><em>&#8211;dbhost</em></strong><em> defaults to ‘0.0.0.0’ but this causes </em><a href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=5017"><em>problems if you change IP</em></a><em> . Stick to 127.0.0.1</em>).</p>
<p>Next, create the connection pool (and associated database - see later).<br />
It’s simplest to do this on the command line (partly due to <a href="https://glassfish.dev.java.net/issues/show_bug.cgi?id=4889">bug 4889</a> ):</p>
<pre><code>hypnotoad:databases $ asadmin create-jdbc-connection-pool \
--datasourceclassname=org.apache.derby.jdbc.ClientConnectionPoolDataSource\
--isconnectvalidatereq=true --validationmethod=meta-data \
--property user=GFv3:password=GFv3:databaseName=railsdb:\
connectionAttributes=\;create\\=true \
railspool
Command create-jdbc-connection-pool executed successfully.</code></pre>
<ul>
<li>The ’;create=true’ option tells JavaDB to create the ‘railsdb’ database on demand</li>
<li>host:port defaults to localhost:1527</li>
<li>username and password can be anything, but are required</li>
</ul>
<p>We now ‘ping’ the pool. This checks our network connection is good, and has the side-effect<br />
of creating the ‘railsdb’ database:</p>
<pre><code>hypnotoad:databases $ asadmin ping-connection-pool railspool
Command ping-connection-pool executed successfully.
hypnotoad:databases $ ls
derby.log railsdb</code></pre>
<h2>option 2. embed Derby in Glassfish</h2>
<p>This is my preferred option for several reasons:</p>
<ol>
<li>it saves having to run 2 JVMs</li>
<li>in development, I don’t mind stopping Glassfish</li>
<li>for production, I want webapps to create their own schema anyway</li>
<li>connection validation and authentication is no longer an issue</li>
</ol>
<p><em>One side effect is that Glassfish is going to use more memory (especially if you have several connection pools configured). You might want to </em><a href="http://number9.hellooperator.net/articles/2008/05/20/passing-jvm-options-to-glassfish"><em>tweak your JVM</em></a><em> .</em></p>
<p>There’s no need to ‘start-database’ in this case – just go ahead and make the pool:</p>
<pre><code>hypnotoad:glassfishv3-tp2 $ asadmin create-jdbc-connection-pool \
--datasourceclassname org.apache.derby.jdbc.EmbeddedDataSource \
--property databaseName=\$\{com.sun.aas.instanceRoot\}/databases/railsdb:\
connectionAttributes=\;create\\=true \
railspool
Command create-jdbc-connection-pool executed successfully.</code></pre>
<ul>
<li>the different DataSource class is what makes it embedded</li>
<li>provide a full path in the <strong>databaseName</strong> attribute to avoid current working directory hell</li>
<li>since Glassfish <strong>is</strong> the database server, we can skip username,password and connection validation options</li>
</ul>
<p>If we ping the pool, we can see Glassfish creates derby.log and the database dir</p>
<pre><code>hypnotoad:glassfishv3-tp2 $ asadmin ping-connection-pool railspool
Command ping-connection-pool executed successfully.
hypnotoad:glassfishv3-tp2 $ tail derby.log
2008-05-15 11:12:48.770 GMT:
Booting Derby version The Apache Software Foundation – Apache Derby – 10.2.2.1 – (538595): instance c013800d-0119-ec48-424c-000001a39158
on database directory /Users/dick/Applications/glassfishv3-tp2/glassfish/domains/domain1/databases/railsdb
Database Class Loader started – derby.database.classpath=’‘
hypnotoad:glassfishv3-tp2 $</code></pre>
<h2>Butler Lampsons mamma didn’t raise no fools</h2>
<p>Whichever option you choose, the command to give the pool a JNDI name is the same:</p>
<pre><code>hypnotoad:glassfishv3-tp2 $ asadmin create-jdbc-resource --connectionpoolid=railspool jdbc/railspool
Command create-jdbc-resource executed successfully.</code></pre>
<p>And we&#8217;re done. Next thing to do is write a webapp to use the damn thing. Stay tuned.</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/05/15/javadb-and-glassfish-v3-to-embed-or-not-to-embed/feed</wfw:commentRss>
		</item>
		<item>
		<title>first look at GF3</title>
		<link>http://number9.hellooperator.net/articles/2008/05/13/gf3-first-look</link>
		<comments>http://number9.hellooperator.net/articles/2008/05/13/gf3-first-look#comments</comments>
		<pubDate>Tue, 13 May 2008 15:44:49 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[glassfish]]></category>

		<category><![CDATA[java]]></category>

		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/?p=132</guid>
		<description><![CDATA[Fishes eyes
I’ve been following Glassfish with interest for a while now –
I want a Tomcat replacement: webapps, a connection pool and an admin
interface that doesn’t stink. Not much to ask.
Glassfish2 delivers all that in spades, plus clusters very nicely.
But it also has a lot of J(2)EE features that I’m not really interested in.
Glassfish v3s design follows a [...]]]></description>
			<content:encoded><![CDATA[<h2>Fishes eyes</h2>
<p>I’ve been following Glassfish with interest for a <a href="http://number9.hellooperator.net/articles/category/glassfish">while now</a> –<br />
I want a Tomcat replacement: webapps, a connection pool and an admin<br />
interface that doesn’t stink. Not much to ask.</p>
<p>Glassfish2 delivers all that in spades, plus clusters very nicely.<br />
But it also has a lot of J(2)EE features that I’m not really interested in.</p>
<p><a href="http://wiki.glassfish.java.net/Wiki.jsp?page=PlanForGlassFishV3">Glassfish v3s design </a>follows a ‘microkernel’ model, which should mean its<br />
a lot lighter, faster, and lets you mix and match the features you need.</p>
<p>It’s matured enough for me to give it a go.</p>
<p>Get it from <a href="https://glassfish.dev.java.net/downloads/v3-techPreview-2.html">https://glassfish.dev.java.net/downloads/v3-techPreview-2.html</a>. The same ZIPfile runs on all platforms (I&#8217;m on a Macbook Pro).</p>
<pre><code>cd ~/Applications
unzip ~/Downloads/gfv3-preview2.zip
PATH=$PATH:~/Applications/glassfishv3-tp2/bin
</code></pre>
<h2>nice feature #1 : typo detection</h2>
<pre><code>hypnotoad:glassfishv3-tp2 $ ./bin/asadmin list-domain
Closest matching command(s):
list-domains
Remote server does not listen for requests on [localhost:8080].
Is the server up?
Command list-domain failed.
hypnotoad:glassfishv3-tp2 $ ./bin/asadmin list-domains
domain1
Command list-domains executed successfully.</code></pre>
<h2>nice feature #2 : boot time</h2>
<pre><code>hypnotoad:glassfishv3-tp2 $ time asadmin start-domain domain1
Command start-domain executed successfully.
real  0m1.029s
user  0m0.456s
sys 0m0.091s</code></pre>
<h2>nice feature  #3 : not everyone needs an /admin webapp</h2>
<p>First nice feature: open <a href="http://localhost:8080">http://localhost:8080</a> and try<br />
‘to manage the server, click <a href="http://localhost:8080/admin">here</a> ‘. Glassfish gets the request for <strong>/admin</strong>,<br />
realises it doesn&#8217;t have an admin webapp, and offers to install it whle U wait:</p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/05/admin-not-there.png"></a><a href="http://number9.hellooperator.net/wp-content/uploads/2008/05/admin-install.png"><img class="alignnone size-medium wp-image-126" title="admin-install" src="http://number9.hellooperator.net/wp-content/uploads/2008/05/admin-install-300x168.png" alt="" width="300" height="168" /></a></p>
<p>Once <strong>admingui.war</strong> downloads, it&#8217;s deployed and you get a login prompt.<br />
Login as &#8216;anonymous&#8217; (no password) and you get the usual admin screen -<br />
as you can see there&#8217;s a lot less stuff in there by default.</p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/05/admin-webapp.png"><img class="alignnone size-medium wp-image-129" title="admin-webapp" src="http://number9.hellooperator.net/wp-content/uploads/2008/05/admin-webapp-300x242.png" alt="" width="300" height="242" /></a></p>
<h2>nice feature  #4 : you can deploy things to it</h2>
<p>(<em>In my experience, that’s not a given</em>).</p>
<p>Just knock up a stub webapp in Netbeans ( <a href="http://files.hellooperator.net/glassfish/webapps/hellonasty.war">here’s one I made earlier</a> ) and deploy it:</p>
<pre><code>hypnotoad:glassfishv3-tp2 $ time asadmin deploy ~/NetBeansProjects/hellonasty/dist/hellonasty.war
upload file successful: /private/tmp/gfv3/hellonasty.war
Command deploy executed successfully.
real  0m2.393s
user  0m0.288s
sys 0m0.071s</code></pre>
<p>And here it is:</p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/05/webapp.png"><img class="alignnone size-medium wp-image-131" title="webapp" src="http://number9.hellooperator.net/wp-content/uploads/2008/05/webapp-300x141.png" alt="" width="300" height="141" /></a></p>
<h2>nice feature #5 : finally a use for that OSX 1.6 JVM</h2>
<p>Guess you&#8217;ll need that admin webapp after all, as I couldn&#8217;t find the right<br />
options to <strong>asadmin set-jvm-options</strong> to switch the default JDK:</p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/05/set-to-use-jdk16.png"><img class="alignnone size-medium wp-image-130" title="set-to-use-jdk16" src="http://number9.hellooperator.net/wp-content/uploads/2008/05/set-to-use-jdk16-300x119.png" alt="Set Glassfish to use JDK 1.6" width="300" height="119" /></a> </p>
<p><em><br />
(That starred box should say:<br />
<strong>/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home</strong>)<br />
</em></p>
<pre><code>hypnotoad:glassfishv3-tp2 $ ps ax|grep 1.6/Hom[e]
14709 s001  <span class="caps">S      0</span>:11.40 /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java -cp /Users/dick/Applications/glassfishv3-tp2/glassfish/modules/glassfish-10.0-tp-2-SNAPSHOT.jar
&#8230;.
&#8230;.
&#8230;.
instancename server -embedded false -verbose false -domainname domain1
</code></pre>
<p><a href="http://number9.hellooperator.net/articles/2008/05/21/changing-the-default-jvm-on-osx-leopard">Making Java 6 the systemwide default</a> should work too.</p>
<h2>nice feature #6 : documentation</h2>
<p>is at : <a href="http://docs.sun.com/app/docs/coll/1343.7">http://docs.sun.com/app/docs/coll/1343.7</a></p>
<h2>next steps</h2>
<p>Seems to run OK to me, even though OS X isn’t listed as a supported platform yet.<br />
There are a few features missing <em>(</em><strong><em>asadmin list-commands</em></strong><em> is a lot shorter than on GFv2)</em><br />
but I’m pretty pleased with it.</p>
<p>Next on the list : hook up NetBeans and JRuby and try deploying a database-backed Rails app.<br />
I&#8217;ve just figured out <a href="http://number9.hellooperator.net/articles/2008/05/15/javadb-and-glassfish-v3-to-embed-or-not-to-embed">how to get JavaDB and Glassfish to play nice</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/05/13/gf3-first-look/feed</wfw:commentRss>
		</item>
		<item>
		<title>Get nekkid!</title>
		<link>http://number9.hellooperator.net/articles/2008/04/09/get-nekkid</link>
		<comments>http://number9.hellooperator.net/articles/2008/04/09/get-nekkid#comments</comments>
		<pubDate>Wed, 09 Apr 2008 15:24:11 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/articles/2008/04/09/get-nekkid</guid>
		<description><![CDATA[In case you were wondering, today is CSS Naked Day.  Wordpress holds up pretty well. By an amazing coincidence, I saw a fat monkey today. And he looked just like you.
]]></description>
			<content:encoded><![CDATA[<p>In case you were wondering, today is <a href="http://naked.dustindiaz.com/">CSS Naked Day</a>.  Wordpress holds up pretty well. By an amazing coincidence, I saw a fat monkey today. And he looked just like <a href="http://typo.submonkey.net">you.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/04/09/get-nekkid/feed</wfw:commentRss>
		</item>
		<item>
		<title>this site best viewed in&#8230;</title>
		<link>http://number9.hellooperator.net/articles/2008/03/27/this-site-best-viewed-in</link>
		<comments>http://number9.hellooperator.net/articles/2008/03/27/this-site-best-viewed-in#comments</comments>
		<pubDate>Thu, 27 Mar 2008 14:23:08 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[awesome]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[osx]]></category>

		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/articles/2008/03/27/this-site-best-viewed-in</guid>
		<description><![CDATA[This mornings WebKit nightly build rendering the Acid3 test:
  
 And look! Firefox painted me a beautiful picture too:
  
 That&#8217;s lovely, sweetheart. 
Guess who&#8217;s not regretting switching a couple of months back.To be fair, Opera apparently scores very highly too (both its users must be delighted). 
]]></description>
			<content:encoded><![CDATA[<p style="text-align: left">This mornings <a href="http://webkit.org">WebKit nightly build</a> rendering <a href="http://acid3.acidtests.org">the Acid3 test</a>:</p>
<p> <a href="http://number9.hellooperator.net/wp-content/uploads/2008/03/webkit-ftw.png" title="webkit r31370 FTW"><img src="http://number9.hellooperator.net/wp-content/uploads/2008/03/webkit-ftw.png" alt="webkit r31370 FTW" /></a> 
<p> And look! Firefox painted me a beautiful picture too:</p>
<p><a href="http://number9.hellooperator.net/wp-content/uploads/2008/03/firefox-fail.png" title="5/10 SEE ME"><img src="http://number9.hellooperator.net/wp-content/uploads/2008/03/firefox-fail.png" alt="5/10 SEE ME" /></a>  
<p style="text-align: left"> That&#8217;s lovely, sweetheart. </p>
<p style="text-align: left">Guess who&#8217;s not regretting <a href="http://number9.hellooperator.net/articles/2007/11/23/decent-firefox-keywords-on-safari">switching a couple of months back.</a>To be fair, Opera apparently scores very highly too (both its users must be delighted). </p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/03/27/this-site-best-viewed-in/feed</wfw:commentRss>
		</item>
		<item>
		<title>portal on OSX under Crossover</title>
		<link>http://number9.hellooperator.net/articles/2008/03/10/portal-on-osx-under-crossover</link>
		<comments>http://number9.hellooperator.net/articles/2008/03/10/portal-on-osx-under-crossover#comments</comments>
		<pubDate>Mon, 10 Mar 2008 23:47:47 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[awesome]]></category>

		<category><![CDATA[games]]></category>

		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/articles/2008/03/10/portal-on-osx-under-crossover</guid>
		<description><![CDATA[Unless you live under the sea, you know a few ways to run windows apps on a Mac. Obviously, the only &#8216;windows apps&#8217; worth having are games, which means DirectX support. Options include:

BootCamp is pretty fast, but rebooting into windows is no way to spend your time.
Parallels somehow trashed my BootCamp partition. We hates it.
VMware Fusion [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left">Unless you live under the sea, you know a few ways to run windows apps on a Mac. Obviously, the only &#8216;windows apps&#8217; worth having are games, which means DirectX support. Options include:</p>
<ol>
<li style="text-align: left">BootCamp is pretty fast, but rebooting into windows is no way to spend your time.</li>
<li style="text-align: left">Parallels somehow trashed my BootCamp partition. We hates it.</li>
<li style="text-align: left">VMware Fusion has DirectX support, and <a href="http://www.youtube.com/watch?v=JIApJMzGzDQ" target="_blank" title="unity video with awful soundtrack">Unity mode</a> (which lets apps run in &#8216;native&#8217; windows). </li>
</ol>
<h2>  a golden hammer to crack a nut</h2>
<p>VMware runs a full Windows install, which has plenty of downsides: 
<ul>
<li>you waste a windows install worth of disk space (a big deal on a laptop)</li>
<li>you waste a lot of ram running another OS</li>
<li>windows needs baby sitting : patching, virus scanning</li>
<li>you need a windows license</li>
<li>you need a VMware license</li>
<li><em>(pet hate)</em> my Dvorak keyboard layout, trackpad gestures etc. don&#8217;t carry over into VMware</li>
</ul>
<p style="text-align: left">The <em><strong>real</strong></em> problem here is that I&#8217;m using a virtualized OS to run 1 program. </p>
<p style="text-align: left"> I&#8217;d argue that most people don&#8217;t want a Windows installation, they just need to run a few Windows apps <em>(I&#8217;d also argue that&#8217;s true on non VMed Windows machines, but that&#8217;s another rant)</em>. </p>
<h2>merlot the magician </h2>
<p><a href="http://www.winehq.org/site/myths" title="WINE">WINE </a> is  an implementation of the win32 APIs on *<span class="caps">NIX</span>.  Instead of a VM, you just run  .EXEs on your UNIX machine. 
<p style="text-align: left">Back in my NetBSD days, I used it to run things like Morpheus and Kazaa - setup was a bit fiddly, but performance was good and it saved me having to reboot. </p>
<p style="text-align: left"><a href="http://www.codeweavers.com/products/cxmac/" target="_blank" title="Crossover mac homepage">Crossover</a> is a commercial app that lets you run multiple WINE &#8216;bottles&#8217; (essentially a directory tree and a config file). There&#8217;s a free 30 day trial and it supports Steam, so thought I&#8217;d try it out.  Choose &#8216;Steam&#8217; from the list of supported apps, Crossover makes a new bottle for it, installs some fonts and off we go: </p>
<p style="text-align: left"> <a href="http://number9.hellooperator.net/wp-content/uploads/2008/02/steaminstall.png" title="steam supported"><img src="http://number9.hellooperator.net/wp-content/uploads/2008/02/steaminstall.thumbnail.png" alt="steam supported" /></a> </p>
<p style="text-align: left">After creating a Steam account, it set off and downloaded Portal from the Net.  Installation couldn&#8217;t have been easier, and Crossover plays nicely with OSX - clicking links in the Steam app opens webpages in Safari, for example. Hardware support is impressive - the microphone works fine, for example :</p>
<p style="text-align: left"> <a href="http://number9.hellooperator.net/wp-content/uploads/2008/02/microphone.png" title="testing 1 2 3"><img src="http://number9.hellooperator.net/wp-content/uploads/2008/02/microphone.thumbnail.png" alt="testing 1 2 3" /></a> </p>
<h2><span class="Apple-style-span" style="font-size: 16px; font-weight: normal"> </span>cd install gotcha</h2>
<p style="text-align: left">When you insert a Windows CD, Crossover runs Setup.exe and builds a bottle for the app on the fly.</p>
<p style="text-align: left">You can get stuck at the ‘please insert disk 2’ messages; OSX can’t eject because Crossover has the disk in use.</p>
<p style="text-align: left">Just open Terminal.app and run <strong>‘sudo umount -f /Volumes/Orange\ Box’</strong>.Then hit <span class="caps">F12</span> to eject the disk, put in disk 2 and let <span class="caps">OSX</span> remount it. </p>
<h2>tweak settings</h2>
<p>I run it windowed because I want to see my desktop (otherwise I might as well BootCamp and be done). <a href="http://forums.macrumors.com/showthread.php?t=418295">A nice man</a> has some very useful launch options for Orange Box on a Macbook - my Macbook Pro seemed happy with :
<pre>-heapsize 512000 -width 1440 -height 900 –window -novid</pre>
<p><span style="font-size: 16px; white-space: normal; font-family: Georgia; line-height: 20px" class="Apple-style-span"><a href="http://number9.hellooperator.net/wp-content/uploads/2008/03/portal-money-shot.jpg" title="portal-money-shot.jpg"><img src="http://number9.hellooperator.net/wp-content/uploads/2008/03/portal-money-shot.thumbnail.jpg" alt="portal-money-shot.jpg" /></a></span><br />
<h2>you will be baked, and then there will be cake</h2>
<p style="text-align: left">Crossover costs around 30 quid with an education discount.</p>
<p>Civ4 for mac is 40 quid (and no cheaper on ebay). Windows Civ4 is about a tenner. So Crossover and Civ4 pays for itself, whether or not you get Windows for free. A few of my <a href="http://number9.hellooperator.net/wp-admin/supported%20apps" target="_blank" title="http://www.codeweavers.com/compatibility/">old PC games look like they&#8217;d work</a> too.
<p style="text-align: left">I’d rather buy native Mac games where possible, but this is seems like a good solid fallback.</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/03/10/portal-on-osx-under-crossover/feed</wfw:commentRss>
		</item>
		<item>
		<title>why I hate your freedom</title>
		<link>http://number9.hellooperator.net/articles/2008/01/21/why-i-hate-your-freedom</link>
		<comments>http://number9.hellooperator.net/articles/2008/01/21/why-i-hate-your-freedom#comments</comments>
		<pubDate>Mon, 21 Jan 2008 16:46:03 +0000</pubDate>
		<dc:creator>Dick</dc:creator>
		
		<category><![CDATA[apple]]></category>

		<category><![CDATA[drm]]></category>

		<category><![CDATA[osx]]></category>

		<category><![CDATA[rant]]></category>

		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://number9.hellooperator.net/articles/2008/01/21/why-i-hate-your-freedom</guid>
		<description><![CDATA[Happy New Thing. 


 So anyway, Adam Leventhal found out AAPL hamstrung DTrace w.r.t. certain apps on Leopard (iTunes at least).  Cue inevitable Slashdottian outrage.


When source code gets released under a license everyone (so long as they follow those terms) gets to port, extend, or shout about how your license isn&#8217;t free at all really. They can even choose to ignore [...]]]></description>
			<content:encoded><![CDATA[<p>Happy New Thing. 
</p>
<p>
 So anyway, <a href="http://blogs.sun.com/ahl/entry/mac_os_x_and_the">Adam Leventhal found out AAPL hamstrung DTrace w.r.t. certain apps on Leopard</a> (iTunes at least).  Cue inevitable Slashdottian outrage.
</p>
<p>
When source code gets released under a license everyone (so long as they follow those terms) gets to port, extend, or shout about how your license isn&#8217;t free at all really. They can even choose to ignore you, or to provide really shitty implementations. None of the above makes them &#8216;evil&#8217;.
</p>
<p>
Some of OS X is open source, some is  proprietary, and some is riddled with DRM. iTunes is in the last category. It&#8217;s Apples main cash cow; if it was reverse engineered they&#8217;d lose a competitive advantage, scare their movie/music business partners away, and the terrorists would win.
</p>
<p>
OSX ships with a full toolchain and part of that is Instruments - a GarageBand-like frontend to DTrace. It&#8217;ll probably be the first contact with DTrace a lot of coders get. I&#8217;ve only tinkered with it, but right away you can see why it&#8217;d make DRM fans twitchy. Running iPhoto under Instruments let me see down into the Cocoa API calls. I now know how atomic preference changes are implemented at the system call level.  Basically, it&#8217;s fucking great.
</p>
<p>
It was really nice of Apple to give it out for free, just like it was nice of Sun to give us DTrace, ZFS and NFS. Telling either company how they should release any of those products makes you a bit of a deRaadt in my book.</p>
]]></content:encoded>
			<wfw:commentRss>http://number9.hellooperator.net/articles/2008/01/21/why-i-hate-your-freedom/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
