<?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>Seb Maynard</title>
	<atom:link href="http://5eb.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://5eb.me</link>
	<description>software and web developer</description>
	<lastBuildDate>Tue, 10 Jan 2012 08:04:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Free cross-platform dynamic DNS with wildcards</title>
		<link>http://5eb.me/free-cross-platform-dynamic-dns-with-wildcards/</link>
		<comments>http://5eb.me/free-cross-platform-dynamic-dns-with-wildcards/#comments</comments>
		<pubDate>Tue, 11 Oct 2011 19:32:00 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[The Internet]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=156</guid>
		<description><![CDATA[This will roughly explain how to get wildcard DNS working for free (any-words-here.yoursubdomain.yourdomain.com) on a connection which gets assigned dynamic IPs. Goal To have subdomain.example.com always up to date with your home IP, and be able to request subdomains (like someword.subdomain.example.com) resolve to the same IP. These are useful if you want to use multiple [...]]]></description>
			<content:encoded><![CDATA[<p>This will roughly explain how to get wildcard DNS working for free (<em>any-words-here.yoursubdomain.yourdomain.com</em>) on a connection which gets assigned dynamic IPs.</p>
<h4>Goal</h4>
<p>To have <em>subdomain.example.com</em> always up to date with your home IP, and be able to request subdomains (like <em>someword.subdomain.example.com</em>) resolve to the same IP. These are useful if you want to use multiple virtual hosts in apache hosted from a machine on your home network, accessible to the outside world using a fixed hostname.</p>
<h4>Requirements</h4>
<p>Your own domain (<em>example.com</em>)<br />
Your have a server on the outside world, running PHP (for this example anyway)<br />
A way of requesting a remote web page automatically</p>
<h4>Introduction</h4>
<p>Our previous internet provider gave me a static IP (2 actually!) on a standard ADSL broadband connection. I also own a domain (for this, I&#8217;ll say <em>example.com</em>) &#8211; so I setup a zone specifically for my house (<em>subdomain.example.com</em>) &#8211; this was nice and easy using any DNS provider as it never changed. I also created NS records pointing <em>subdomain.example.com</em> at my home IP, so that I could create requests for <em>blah.subdomain.example.com</em></p>
<p>We&#8217;ve recently moved house. We&#8217;re now with Virgin, and they don&#8217;t provide static IPs &#8211; so I thought I could use something like <em>dyndns.com</em> or <em>no-ip.com</em> (which runs a small daemon which updates your IP to point to something like <em>yourname.no-ip.com</em>). However, these don&#8217;t support recursive wildcard DNS requests without paying for a subscription (i.e. <em>something.yourname.no-ip.com</em>) so I&#8217;d only be able to have a single domain name for my home, which makes using Virtual Hosts in apache not really possible&#8230;</p>
<h4>Solution!</h4>
<p>Find a free DNS host which support an API, and supports wildcard DNS records for a fixed zone. I&#8217;ve done the hard work for you, and found <a title="Zerigo DNS" href="http://www.zerigo.com/">Zerigo</a></p>
<p>Setup a free account on Zerigo and creat a new zone for <em>subdomain.example.com</em> &#8211; my primary DNS is hosted elsewhere for <em>example.com</em>, so I just created an NS record for <em>subdomain.example.com</em> on my main DNS to point at <em>a.ns.zerigo.com. </em>You could probably host both on Zerigo if you wanted.</p>
<p>Then, create 2 hosts on this new zone &#8211; &#8220;&#8221; (empty hostname) and &#8220;*&#8221; (the wildcard host) &#8211; give these any old IP; they&#8217;ll be updated in a minute!</p>
<p>So, now if you do something like (from your machine):</p>
<p><em>nslookup banana.subdomain.example.com a.ns.zerigo.com</em></p>
<p>you should get the IP you&#8217;ve given both these hosts. If you do, everything&#8217;s working fine.</p>
<p>Now, the best bit about Zerigo is that it has a rather nifty REST api for updating DNS zones and hosts, and they provide a PHP client library along with some fairly simple examples. So I created a small PHP script (using their provided API &#8211; thank you!) which just updates your zone to point to the client IP requesting the script, provided it&#8217;s not the same as it used to be (with very simple authentication):</p>
<h4>The PHP script to do it for you</h4>
<pre class="prettyprint lang-php">&lt;?php
$WILDCARD_ZONE="subdomain.example.com"

// rather nasty "authentication" - does the job though... (and it's fine provided the logs on your server are private!)
// just check the MD5 of a GET param is the same as one we're expecting
if (isset($_GET["key"]) &amp;&amp; "abc123abc123abc123abc123abc123ab"===md5($_GET["key"])) {
        // get the last IP we updated it to - if it's not the same, write the new one into the file
        // for use next time.
        $oldIP=file_get_contents("oldIP");
        $remoteIP=$_SERVER['REMOTE_ADDR'];
        if ($oldIP != $remoteIP) {
                file_put_contents("oldIP", $remoteIP);
        }
        else {
                // IP hasn't changed, so nothing to do - save superfluous calls to the Zerigo API
                die("No change: $oldIP, $remoteIP");
        }
        // include the zerigo API
        require_once("zerigo-dns_api_php/zerigo_ns.php");

        ZerigoAPI::$api_user = 'you@zerigouser.com';
        ZerigoAPI::$api_key  = 'abc123abc123abc123abc123abc123ab';

        // get all zones on your account (up to 50 of them anyway)
        $zones = NSZone::find_all(array('per_page'=&gt;50, 'page'=&gt;1));

        // Now get the zone we're trying to update
        $homeZone = null;
        foreach ($zones as $zone) {
                if ($zone-&gt;domain == $WILDCARD_ZONE) {
                        $homeZone = $zone;
                }
        }
        // found the zone we want?
        if ($homeZone) {
                // update all the hosts that match what we're fudging (i.e. the empty host and the wildcard)
                foreach ($homeZone-&gt;hosts as $host) {
                        if ($host-&gt;hostname == "" || $host-&gt;hostname == "*") {
                                // bit of debug to go in my cron logs
                                echo "Updating " . $host-&gt;hostname . "." . $homeZone-&gt;domain;
                                echo " from " . $host-&gt;data . " to " . $remoteIP . "&lt;br/&gt;\n";
                                $host-&gt;data = $remoteIP;
                                // call the Zerigo API to update the remote IP for this host
                                if ($host-&gt;save()) {
                                        echo "Updated.&lt;br/&gt;\n&lt;br/&gt;\n";
                                }
                                else echo "Failed.&lt;br/&gt;\n&lt;br/&gt;\n";
                        }
                }
        }

        exit();
}
header("Status: 404 Not Found");</pre>
<p>(You&#8217;ll also need the Zerigo PHP api stuff too, which can be found here: <a href="http://www.zerigo.com/docs/managed-dns/api_code_php" title="Zerigo PHP Libs" target="_blank">Zerigo PHP Libs</a>)</p>
<h4>Getting it to automatically update</h4>
<p>I just set a box on my home network to fetch this every now and again &#8211; at the moment, I&#8217;ve just got a cron job that does it hourly and it keeps my remote IP up to date  (with a low (1 hour) TTL) on Zerigo&#8217;s DNS servers. I presume there&#8217;s a way in Windows to create a scheduled job that does it too, so this method is pretty cross-platform (and because PHP can run on pretty much anything, it works on all client/server setups).</p>
<p>Hooray!</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/free-cross-platform-dynamic-dns-with-wildcards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIM quick fix (for arrow keys in insert mode)</title>
		<link>http://5eb.me/vim-quick-fix-for-arrow-keys-in-insert-mode/</link>
		<comments>http://5eb.me/vim-quick-fix-for-arrow-keys-in-insert-mode/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 13:27:40 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=3</guid>
		<description><![CDATA[When using VIM in insert mode, when I try and move around with the arrow keys, it inserts A, B, C and D instead. Not completely sure why, but typing: :set nocompatible seems to fix the problem. You can make this permanent by sticking set nocompatible in .vimrc in your home directory. Anyone know why?!]]></description>
			<content:encoded><![CDATA[<p>When using VIM in insert mode, when I try and move around with the arrow keys, it inserts A, B, C and D instead. Not completely sure why, but typing:</p>
<p><code class="prettyprint lang-sh">:set nocompatible</code></p>
<p>seems to fix the problem. You can make this permanent by sticking </p>
<p><code class="prettyprint lang-sh">set nocompatible</code></p>
<p>in .vimrc in your home directory. Anyone know why?!</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/vim-quick-fix-for-arrow-keys-in-insert-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adventures in WordPress</title>
		<link>http://5eb.me/adventures-in-wordpress/</link>
		<comments>http://5eb.me/adventures-in-wordpress/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 07:19:26 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=103</guid>
		<description><![CDATA[I&#8217;ve spent a bit of time building wordpress themes for clients, and usually they all need fairly simple page layouts, probably having commenting turned off, and nothing particularly complicated; occasionally there&#8217;ll be the odd nested page, and some funky javascript, but all fairly basic stuff (see lets-skinnydip for my last WordPress site). For this site, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve spent a bit of time building wordpress themes for clients, and usually they all need fairly simple page layouts, probably having commenting turned off, and nothing particularly complicated; occasionally there&#8217;ll be the odd nested page, and some funky javascript, but all fairly basic stuff (see <a href="http://www.lets-skinnydip.com" target="_blank">lets-skinnydip</a> for my last WordPress site).</p>
<p>For this site, as it&#8217;s my own site, I feel a bit more relaxed to play around and (possibly) break things. So my theme here is built from scratch, with empty files everywhere, and I&#8217;ve gradually been learning more and more from the WordPress codex filling in the blanks. Yesterday I worked out how to get comments working (I know it sounds obvious, but like I say, I started from scratch with the theme rather than from someone else&#8217;s and changing what it looked like) and got the navigation buttons under posts working too.</p>
<p>I&#8217;ve just discovered custom page templates, and how to create pages in WordPress that reference these &#8211; I&#8217;m really starting to see the power WordPress has!</p>
<p>The only other problem I had is that I used a subfolder to house WordPress on my server, and don&#8217;t really fancy moving it out (I like having it all self-contained) but wanted to reference a particular wordpress page as my &#8220;home&#8221; page (i.e. actually have the content served from <a href="http://5eb.me/">http://5eb.me/</a> rather than redirecting to <a href="http://5eb.me/wp/">http://5eb.me/wp/</a> and displaying a particular page) &#8211; turns out that this is possible too, but doing something along the lines of:</p>
<pre class="prettyprint lang-php">
&lt;?php include(&quot;wp/wp-load.php&quot;); // include the wordpress engine?&gt;
&lt;?php get_header(); // header file ?&gt;
&lt;?php get_sidebar(&quot;barebones&quot;); // custom sidebar template file - hides the menu etc ?&gt;
&lt;div id=&quot;content&quot; style=&quot;margin-top: 60px;&quot;&gt;
	&lt;?php $page=get_page_by_title(&quot;Seb Maynard&quot;); // get the page we&#39;d like to display ?&gt;
	&lt;h2&gt;&lt;?php echo $page-&gt;post_title; ?&gt;&lt;/h2&gt;
	&lt;div&gt;
		&lt;?php
			// echo the content, as if we were inside the wordpress loop
			echo apply_filters(&quot;the_content&quot;, $page-&gt;post_content);
		?&gt;
	&lt;/div&gt;
&lt;/div&gt;
&lt;?php get_footer(); ?&gt;
</pre>
<p>After working all this out, I decided it was actually better to have a normal wordpress page, with a different &#8220;subtheme&#8221;, and just redirect to that&#8230; So I&#8217;m not actually using any of the above for this site after all! However, I&#8217;m sure I (or someone else) may find it useful in the future&#8230;</p>
<p>It&#8217;s quite incredible that a piece of so well-maintained and powerful software is free.</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/adventures-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu tips and tricks</title>
		<link>http://5eb.me/ubuntu-tips-and-tricks/</link>
		<comments>http://5eb.me/ubuntu-tips-and-tricks/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 19:14:36 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Other musings]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=80</guid>
		<description><![CDATA[Here&#8217;s a small selection of tips and tricks I&#8217;ve collected in Ubuntu linux &#8211; and probably might help in other Linuses (is that the plural of Linux?!) too. X11 forwarding problems Window button order in Ubuntu Customizable menu shortcuts in Ubuntu How to fix “Setting locale failed” in Ubuntu X11 forwarding problems When setting up [...]]]></description>
			<content:encoded><![CDATA[<p><a name="tiptricktop"></a>Here&#8217;s a small selection of tips and tricks I&#8217;ve collected in Ubuntu linux &#8211; and probably might help in other Linuses (is that the plural of Linux?!) too.</p>
<ul style="margin-top: 20px; margin-bottom: 20px">
<li><a href="#tiptrick1">X11 forwarding problems</a></li>
<li><a href="#tiptrick2">Window button order in Ubuntu</a></li>
<li><a href="#tiptrick3">Customizable menu shortcuts in Ubuntu</a></li>
<li><a href="#tiptrick4">How to fix “Setting locale failed” in Ubuntu</a></li>
</ul>
<hr />
<h3><a name="tiptrick1"></a>X11 forwarding problems</h3>
<p>When setting up an SSH connection to forward X11 applications back to your client, you can connect with:<br />
<code class="prettyprint lang-sh">ssh -X user@host</code></p>
<p>This will use standard X11 forwarding; you can also<br />
<code class="prettyprint lang-sh">ssh -Y user@host</code></p>
<p>to get authenticated forwarding. Once this is done, if everything is working, doing:<br />
<code class="prettyprint lang-sh">echo $DISPLAY</code></p>
<p>on the host should print something like :0.0</p>
<h4>How to fix it if it doesn&#8217;t work&#8230;</h4>
<p>Sometimes, <code class="prettyprint lang-sh">$DISPLAY</code> doesn&#8217;t get set. There are a couple of reasons.</p>
<ol>
<li>Make sure <code class="prettyprint lang-sh">/etc/ssh/sshd_config</code> contains <code class="prettyprint lang-sh">X11Forwarding yes</code></li>
<li>Make sure you haven&#8217;t got any scripts overwriting the <code class="prettyprint lang-sh">$DISPLAY</code> variable</li>
<li><strong>(this is the one that always catches me out)</strong> Make sure you have <code class="prettyprint lang-sh">xauth</code> package installed on the target host!</li>
</ol>
<p><a href="#tiptricktop">Back to top</a></p>
<hr />
<h3><a name="tiptrick2"></a>Window button order in Ubuntu</h3>
<p>Or otherwise know as <strong>How to put the window close/maximize/minimize buttons back on the right</strong>. An infuriating change if you ask me&#8230;</p>
<p>In gconf-editor find<br />
<code>/apps/metacity/general/button_layout</code><br />
The <code>:</code> is where the large space will be, and the buttons are quite self-explanatory <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="#tiptricktop">Back to top</a></p>
<hr />
<h3><a name="tiptrick3"></a>Customizable menu shortcuts in Ubuntu</h3>
<p>How to bind a keyboard shortcut to almost anything in almost any Gnome app</p>
<h4>Old versions of Ubuntu</h4>
<p>In older versions of Ubuntu, on the main menu, under preferences, on the Appearance dialog, there was an &#8220;Interface&#8221; tab with various tweaks and things&#8230; one of which was customisable keyboard shortcuts for menu items. Just tick the appropriate one, and away you go&#8230;</p>
<h4>Ubuntu 10 and on</h4>
<p>In Ubuntu 10, the team removed the &#8220;interface&#8221; tab from the Gnome Appearance preferences dialog, so the option to enable &#8220;custom keyboard shortcuts&#8221; (which let you hover over any menu item, press a new keyboard shortcut and bind it immediately) was hidden away&#8230;</p>
<p>You can turn this behaviour on by opening up gconf-editor (either in run (alt+f2) or in a command line) and finding and ticking the key: <code>/desktop/gnome/interface/can_change_accels</code></p>
<p><a href="#tiptricktop">Back to top</a></p>
<hr />
<h3><a name="tiptrick4"></a>How to fix &#8220;Setting locale failed&#8221; in Ubuntu</h3>
<p>For when you see errors like&#8230;<br />
<code class="prettyprint lang-sh">perl: warning: Falling back to the standard locale ("C").</code><br />
<code class="prettyprint lang-sh">perl: warning: Setting locale failed.</code><br />
<code class="prettyprint lang-sh">perl: warning: Please check that your locale settings</code></p>
<p>Just reinstall the packages by:<br />
<code class="prettyprint lang-sh">apt-get install --reinstall language-pack-en </code><br />
(Stolen shamelessly from <a href="http://bit.ly/nlug9c">http://bit.ly/nlug9c</a>)</p>
<p><a href="#tiptricktop">Back to top</a></p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/ubuntu-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let Firefox read local files during development</title>
		<link>http://5eb.me/let-firefox-read-local-files-during-development/</link>
		<comments>http://5eb.me/let-firefox-read-local-files-during-development/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 18:51:16 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=65</guid>
		<description><![CDATA[Use with caution!! By default, Firefox doesn&#8217;t allow resources on the web to access local files. However, when debugging a web application, this is sometimes useful (for example, if you have a remote web system that takes a long time to rebuild/update, and want to make a lot of small trial-and-error changes to javascript/css). This [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://5eb.me/wp/wp-content/uploads/2011/07/firefox1.jpg"><img src="http://5eb.me/wp/wp-content/uploads/2011/07/firefox1.jpg" alt="" title="firefox" width="64" height="63" class="alignright size-full wp-image-77" /></a>Use with caution!!</p>
<p>By default, Firefox doesn&#8217;t allow resources on the web to access local files. However, when debugging a web application, this is sometimes useful (for example, if you have a remote web system that takes a long time to rebuild/update, and want to make a lot of small trial-and-error changes to javascript/css). This is potentially very dangerous, so only enable whilst you&#8217;re debugging, and turn off when you&#8217;re done <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Just visit <code>about:config</code> in the address bar, and search for<br />
<code>security.fileuri.strict_origin_policy</code></p>
<p>set it to <code>false</code>, restart Firefox and you&#8217;re done <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>p.s. for older Firefox versions, look for <code>security.checkloaduri</code> instead and change that</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/let-firefox-read-local-files-during-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random dev doodling &#8211; JavaScript 3D cube</title>
		<link>http://5eb.me/random-dev-doodling-javascript-3d-engine/</link>
		<comments>http://5eb.me/random-dev-doodling-javascript-3d-engine/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 04:04:00 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=56</guid>
		<description><![CDATA[Being a developer, I spend quite a bit of time playing around with programming bits and bobs. A little while ago, I had a relatively old Nokia that supported J2ME (without floating point) so I decided to try and write a simple 3d renderer for it &#8211; having no FPU (floating point unit) I had [...]]]></description>
			<content:encoded><![CDATA[<p>Being a developer, I spend quite a bit of time playing around with programming bits and bobs. A little while ago, I had a relatively old Nokia that supported J2ME (without floating point) so I decided to try and write a simple 3d renderer for it &#8211; having no FPU (floating point unit) I had to write an integer math library, and sine/cosine lookup tables against the math library. This was all good stuff, and reminded me some of the maths I learnt at uni, and some good optimization tricks.</p>
<p>A couple of months after that, bored one afternoon, I decided to write something similar in JavaScript &#8211; modern browsers have decent JavaScript engines with good floating point support, so it was a lot easier&#8230; after proving that it could be done, I lost interest, but here&#8217;s where it go to:</p>
<p><a href="http://5eb.me/play/test3d/" title="3D JavaScript test" target="_blank"><img src="http://5eb.me/wp/wp-content/uploads/2011/07/3dthing.jpg" alt="" title="3dthing" width="300" height="272" class="aligncenter size-full wp-image-59" /></a></p>
<p>Just a (very) simple 3D wireframe cube renderer, but done using a <code>&lt;canvas&gt;</code> tag, a fairly standard 3D matrix, and some javascript.</p>
<p>You can see it in action <a href="http://5eb.me/play/test3d/" title="3D JavaScript test" target="_blank">here</a> &#8211; not sure if it works in every browser (more than likely doesn&#8217;t) but it definitely works in FireFox and Chrome.</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/random-dev-doodling-javascript-3d-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick howto: init.d script for glassfish 3</title>
		<link>http://5eb.me/quick-howto-init-d-script-for-glassfish-3/</link>
		<comments>http://5eb.me/quick-howto-init-d-script-for-glassfish-3/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 10:00:45 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=40</guid>
		<description><![CDATA[Glassfish is a reference implentation of the Java EE 6 application server &#8211; it&#8217;s fairly easy to download and get running, but I wanted to get it running automatically on system startup on my linux server (which at the moment is running on coLinux &#8211; probably post about separately that at some point). I&#8217;m assuming [...]]]></description>
			<content:encoded><![CDATA[<p>Glassfish is a reference implentation of the Java EE 6 application server &#8211; it&#8217;s fairly easy to download and get running, but I wanted to get it running automatically on system startup on my linux server (which at the moment is running on coLinux &#8211; probably post about separately that at some point).</p>
<p>I&#8217;m assuming you&#8217;ve got the glassfish .zip, and extracted it to <code>/opt/glassfishv3</code>&#8230; and you&#8217;re running a debian-based OS (like Debian Lenny, or Ubuntu). These commands assume you&#8217;re either running as root, or prepend all of them with sudo&#8230;</p>
<p>Create a file:</p>
<p><code class="prettyprint lang-sh">/etc/init.d/glassfish.sh</code></p>
<p>and put the following in it:</p>
<pre class="prettyprint lang-sh">
GLASSFISH_HOME=${GLASSFISH_HOME:-"/opt/glassfishv3/glassfish"}
case "$1" in
start)
    $GLASSFISH_HOME/bin/asadmin start-domain | tee -a /var/log/glassfish.log
    ;;
stop)
    $GLASSFISH_HOME/bin/asadmin stop-domain | tee -a /var/log/glassfish.log
    ;;
restart)
    $GLASSFISH_HOME/bin/asadmin restart-domain | tee -a /var/log/glassfish.log
    ;;
*)
echo "usage: $0 (start|stop|restart|help)"
esac
</pre>
<p>Make sure it&#8217;s executable:</p>
<p><code class="prettyprint lang-sh">chmod +x /etc/init.d/glassfish.sh</code></p>
<p>Make it start by default on system boot:<br />
<code class="prettyprint lang-sh">update-rc.d glassfish.sh defaults</code></p>
<p>Then start your glassfish server <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  if it doesn&#8217;t appear to be working, you can tail the logs:</p>
<p><code class="prettyprint lang-sh">tail -F /var/log/glassfish.log</code></p>
<p>Done! Easy as pie <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>(thanks to <a href="http://bit.ly/qZ4fTj" target="_blank">http://bit.ly/qZ4fTj</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/quick-howto-init-d-script-for-glassfish-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello!</title>
		<link>http://5eb.me/wordpress-hooray/</link>
		<comments>http://5eb.me/wordpress-hooray/#comments</comments>
		<pubDate>Mon, 18 Jul 2011 13:09:00 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Other musings]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=26</guid>
		<description><![CDATA[Hi, I&#8217;m Seb I&#8217;m a web and software developer (and now a game programmer) from Brighton. You can read a bit more about me and what I do in the &#8220;about me&#8221; page. Anyway, feel free to have a read of some of my (relatively infrequent) posts &#8211; mostly geeky musings, but you never know&#8230;]]></description>
			<content:encoded><![CDATA[<p><img src="http://5eb.me/wp/wp-content/uploads/2011/07/wordpress_logo.png" alt="" title="wordpress_logo" width="54" height="54" class="alignright size-full wp-image-29" />Hi, I&#8217;m Seb <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I&#8217;m a web and software developer (and now a game programmer) from Brighton. You can read a bit more about me and what I do in the <a href="http://5eb.me/wp/about-me/" title="About Me">&#8220;about me&#8221;</a> page.</p>
<p>Anyway, feel free to have a read of some of my (relatively infrequent) posts &#8211; mostly geeky musings, but you never know&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/wordpress-hooray/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Continuous Android Sync (optionally with DropBox)</title>
		<link>http://5eb.me/continuous-android-sync-optionally-with-dropbox/</link>
		<comments>http://5eb.me/continuous-android-sync-optionally-with-dropbox/#comments</comments>
		<pubDate>Fri, 13 May 2011 01:32:15 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=14</guid>
		<description><![CDATA[I like DropBox. I like Android. I just wish there was a way to continously sync my dropbox folders with my phone so they&#8217;re always up to date&#8230; here&#8217;s a way I use to get round this limitation Start the bodge. Step 1: DropBox remote. First, setup DropBox on a computer somewhere running an ssh [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-33" title="andbox" src="http://5eb.me/wp/wp-content/uploads/2011/05/andbox.png" alt="" width="66" height="83" />I like DropBox. I like Android. I just wish there was a way to continously sync my dropbox folders with my phone so they&#8217;re always up to date&#8230; here&#8217;s a way I use to get round this limitation</p>
<hr />
<h3>Start the bodge.</h3>
<h4>Step 1: DropBox remote.</h4>
<p>First, setup DropBox on a computer somewhere running an ssh server, so you can copy files from it over ssh (with rsync), and make sure it&#8217;s setup with private key encryption with an agent so you don&#8217;t need to enter passphrases/passwords every time</p>
<h4>Step 2: RSync from remote to phone</h4>
<p>Then, get rsync4android (<a target="_blank" href="https://market.android.com/details?id=eu.kowalczuk.rsync4android">market link</a>)</p>
<p>That lets you setup rsync jobs from a remote server to your phone (and vice versa&#8230; I use it for this, but also for backing up my photos to my PC automatically every night)</p>
<p>Then create an rsync job to download a particular folder from your remote DropBox on your PC into the DropBox folder on your sd card.</p>
<h4>Step 3: scheduled automatic rsync jobs</h4>
<p>Get tasker (which lets you schedule jobs to happen on a large number of triggers, including time) (<a href="https://market.android.com/details?id=net.dinglisch.android.taskerm&amp;feature=search_result">market link</a>)</p>
<p>Create a tasker job to fire off your new rsync job to keep your dropbox folder up to date&#8230;</p>
<h4>Step 4: Enjoy <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </h4>
<p>Like I say, it&#8217;s a bit around the houses, but seems to do the job <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/continuous-android-sync-optionally-with-dropbox/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Digitoneurolinguistic Hacking</title>
		<link>http://5eb.me/digitoneurolinguistic-hacking/</link>
		<comments>http://5eb.me/digitoneurolinguistic-hacking/#comments</comments>
		<pubDate>Fri, 04 Feb 2011 17:02:31 +0000</pubDate>
		<dc:creator>seb</dc:creator>
				<category><![CDATA[The Internet]]></category>

		<guid isPermaLink="false">http://5eb.me/wp/?p=12</guid>
		<description><![CDATA[I read the word &#8220;Digitoneurolinguistic&#8221; in an XKCD comic, about 3 hours after it appeared on Google Reader: Trochee Fixation I&#8217;ve coined this dNLP because it looks fancy. I might try and drop it into a conversation somehow&#8230; Anyway, it sounded like an intriguing concept; after a quick Google, I found nothing &#8211; I&#8217;ve done [...]]]></description>
			<content:encoded><![CDATA[<p>I read the word &#8220;Digitoneurolinguistic&#8221; in an XKCD comic, about 3 hours after it appeared on Google Reader:</p>
<p><a href="http://xkcd.com/856/" target="_blank">Trochee Fixation</a></p>
<p>I&#8217;ve coined this <em>dNLP</em> because it looks fancy. I might try and drop it into a conversation somehow&#8230;</p>
<p>Anyway, it sounded like an intriguing concept; after a quick Google, I found nothing &#8211; I&#8217;ve done a bit of freelance work for a Hypnotherapy company / practice / clinic (what <em>do</em> you call it?!) in the past, and have read a lot of their site content about neurolinguistic programming (not the digito- kind though) and started wondering what the digital equivalent might be like.</p>
<p>&#8230;</p>
<p>&#8230;</p>
<p>Well, now I&#8217;ve finished wondering, and am no better off than I was before. Which means that I&#8217;m no better off finding out what what digitoneurolinguistic hacking is either.</p>
<p><strong>HOWEVER!!!</strong> On realising there are <em>no</em> Google results for &#8220;digitoneurolinguistic&#8221;, I decided I&#8217;d try and be the first (maybe) &#8211; so if you found this page after reading the XKCD comic, <a href="mailto:xkcd@5eb.me">drop me a line to say hi <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </a> &#8211; Hooray for Google&#8217;s indexes!</p>
<p>p.s. for added fun, press (on your keyboard):</p>
<p><code>↑ ↑ ↓ ↓ ← → ← → B A</code></p>
<p><em>(from <a href="http://bit.ly/fMwGL7">here</a>)</em> &#8211; this may not work yet in my wordpress&#8230;</p>
<p>* as a bit of an (quite a lot of an) internet geek, I really, really like that it is now socially acceptable to use a website&#8217;s name as a verb <img src='http://5eb.me/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://5eb.me/digitoneurolinguistic-hacking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

