<?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>Misterdom's World</title>
	<atom:link href="http://www.guinard.org/~misterdom/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guinard.org/~misterdom</link>
	<description>My Computing Logbook</description>
	<lastBuildDate>Sat, 24 Dec 2011 09:31:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Squeeze Box Server not Starting on Synology</title>
		<link>http://www.guinard.org/~misterdom/2011/12/24/squeeze-box-server-not-starting-on-synology/</link>
		<comments>http://www.guinard.org/~misterdom/2011/12/24/squeeze-box-server-not-starting-on-synology/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 09:31:38 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=196</guid>
		<description><![CDATA[Strangely enough, my squeeze box server which was running like a charm on my Synology DS210j decided not to start this morning.
I first tried to run it from the service control panel again but that didn&#8217;t help either, although I got a message from the panel saying it was running, it in fact wasn&#8217;t.
Next, I [...]]]></description>
			<content:encoded><![CDATA[<p>Strangely enough, my squeeze box server which was running like a charm on my Synology DS210j decided not to start this morning.</p>
<p>I first tried to run it from the service control panel again but that didn&#8217;t help either, although I got a message from the panel saying it was running, it in fact wasn&#8217;t.</p>
<p>Next, I tried to run it manually from an SSH shell:<br />
<code><br />
 /usr/bin/perl -w /volume1/@appstore/SqueezeCenter/slimserver.pl --daemon --user admin --pidfile /volume1/@appstore/SqueezeCenter</code></p>
<p>and found out that it was simply blocking because it could not write to the log file:</p>
<p><code><br />
Can't open /volume1/@appstore/SqueezeCenter/Logs/server.log (Permission denied) at /volume1/@appstore/SqueezeCenter/CPAN/Log/Log4perl/Appender/File.pm line 103.</code></p>
<p>Looking at the <code>server.log</code> file it somehow belonged to root while the slimserver was started with admin. Changing the owner of the <code>server.log</code> file worked fine and solved the bug.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2011/12/24/squeeze-box-server-not-starting-on-synology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert an MP3 to an Ogg on Linux</title>
		<link>http://www.guinard.org/~misterdom/2011/08/19/convert-an-mp3-to-an-ogg-on-linux/</link>
		<comments>http://www.guinard.org/~misterdom/2011/08/19/convert-an-mp3-to-an-ogg-on-linux/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 12:47:31 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=194</guid>
		<description><![CDATA[mpg321 input.mp3 -w - &#124; oggenc -o output.ogg -
Source post
]]></description>
			<content:encoded><![CDATA[<blockquote><p><code>mpg321 input.mp3 -w - | oggenc -o output.ogg -</code></p></blockquote>
<p><a href="http://www.perturb.org/display/entry/687/">Source post</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2011/08/19/convert-an-mp3-to-an-ogg-on-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Take a Timed Screenshot with Linux</title>
		<link>http://www.guinard.org/~misterdom/2011/06/30/timed-screenshot-with-linux/</link>
		<comments>http://www.guinard.org/~misterdom/2011/06/30/timed-screenshot-with-linux/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 15:41:50 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[screenshot]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=190</guid>
		<description><![CDATA[sleep 3s; import -window root screenshot.png
Source: http://www.linux-noob.com/forums/index.php?/topic/339-how-to-take-a-screenshot-in-linux/
]]></description>
			<content:encoded><![CDATA[<blockquote><p><code>sleep 3s; import -window root screenshot.png</code></p></blockquote>
<p>Source: <a href="http://www.linux-noob.com/forums/index.php?/topic/339-how-to-take-a-screenshot-in-linux/">http://www.linux-noob.com/forums/index.php?/topic/339-how-to-take-a-screenshot-in-linux/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2011/06/30/timed-screenshot-with-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embedding Databases in a WAR File</title>
		<link>http://www.guinard.org/~misterdom/2010/10/22/embedding-db-war-file/</link>
		<comments>http://www.guinard.org/~misterdom/2010/10/22/embedding-db-war-file/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 22:38:58 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[derby]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[sqlite]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=180</guid>
		<description><![CDATA[Lately I needed a Java Web Application to have its own small database. I know the common/good practice is to have Web apps connect to a DB through a database pool but this requires some user configuration (at least copying the DB driver to the lib folder of the app server) when deploying the app. [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I needed a Java Web Application to have its own small database. I know the common/good practice is to have Web apps connect to a DB through a database pool but this requires some user configuration (at least copying the DB driver to the lib folder of the app server) when deploying the app. Since the Web app was supposed to be deploy-and-play this was not an option.</p>
<p>Thus, we decided to embed a SQLite database in the app. This worked fine as long as I was locally testing the application. However, when deploying to a production Tomcat instance I started getting these exceptions:</p>
<blockquote><p>
<code>java.sql.SQLException: opening db: 'restfulepcis.db': Permission denied<br />
	at org.sqlite.Conn. init(Conn.java:117)<br />
	at org.sqlite.Conn. init(Conn.java:49)<br />
	at org.sqlite.JDBC.connect(JDBC.java:86)</code>
</p></blockquote>
<p>The reason is pretty clear, on the production server I did not have permission to write to the Tomcat working directory.</p>
<p>I was left with two solutions:<br />
1) have the directory where the database has to be created as a config parameter<br />
2) find a directory that&#8217;s universally accessible from an app in an app server.<br />
Since 1) involved user-configuration it was not an option.</p>
<p>There is actually a folder to which any Web app can write, the folder where the app is deployed (or at least my knowledge). The location of this folder can be found by calling:</p>
<blockquote><p><code><br />
ServletContext context = servletContext.getRealPath("/")<br />
</code>
</p></blockquote>
<p>from a servlet. Since my app is a JAX-RS (RESTful) application I can obtain it by CDI (Contexts and Dependency Injection):</p>
<blockquote><p><code>    @Context<br />
    ServletContext servletContext;</p>
<p>    /**<br />
     * Returns a representation of the EPCIS REST Adapter home resource according to the requested mime type<br />
     *<br />
     * @param context<br />
     * @return an instance of javax.ws.rs.core.Resource<br />
     */<br />
    @GET<br />
    public Resource getRESTfulEPCIS(@Context UriInfo context) {<br />
        System.setProperty("sqlite.system.home", servletContext.getRealPath("/"));<br />
        RESTfulEPCISBusinessLogic logic = new RESTfulEPCISBusinessLogic();<br />
        return logic.getRESTfulEPCIS(context);<br />
    }<br />
</code></p></blockquote>
<p>I then load the sqlite.system.home from my database manager class (which is not a Servlet) and use it as path in my database connection URI:</p>
<blockquote><p>
<code><br />
...<br />
     String sqliteHome = System.getProperty("sqlite.system.home");<br />
...<br />
    private Connection getConnection() {<br />
        Connection connection = null;<br />
        try {<br />
            Class.forName(DRIVER);<br />
            connection = DriverManager.getConnection("jdbc:sqlite:" + sqliteHome + DB_NAME + ".db");<br />
...<br />
</code>
</p></blockquote>
<p>Note that for Apache Derby, you can make it even easier by simply setting the <code>derby.system.home</code> in the servlet class. Then, you do not need to read it manually from your database manager class as it is read automatically when loading the driver:</p>
<blockquote><p><code> System.setProperty("derby.system.home", servletContext.getRealPath("/"));</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/10/22/embedding-db-war-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting SOAP XML out of KSOAP2 Requests</title>
		<link>http://www.guinard.org/~misterdom/2010/10/20/soap-xml-out-of-ksoap2/</link>
		<comments>http://www.guinard.org/~misterdom/2010/10/20/soap-xml-out-of-ksoap2/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 22:59:37 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ksoap]]></category>
		<category><![CDATA[SOAP]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=177</guid>
		<description><![CDATA[Use the debug mode of the HttpTransport with:

HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;

and get a hold on the raw response from the service using:
String result = androidHttpTransport.responseDump;
]]></description>
			<content:encoded><![CDATA[<p>Use the debug mode of the <code>HttpTransport</code> with:</p>
<blockquote><p><code><br />
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);<br />
androidHttpTransport.debug = true;<br />
</code></p></blockquote>
<p>and get a hold on the raw response from the service using:</p>
<blockquote><p><code>String result = androidHttpTransport.responseDump;</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/10/20/soap-xml-out-of-ksoap2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching Java Versions in Ubuntu</title>
		<link>http://www.guinard.org/~misterdom/2010/09/08/switching-java-versions-in-ubuntu/</link>
		<comments>http://www.guinard.org/~misterdom/2010/09/08/switching-java-versions-in-ubuntu/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 14:00:13 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=171</guid>
		<description><![CDATA[Use this command to switch between the versions of Java (e.g. Sun, Oracle, Openjdk, etc.)
sudo update-alternatives --config java
]]></description>
			<content:encoded><![CDATA[<p>Use this command to switch between the versions of Java (e.g. Sun, Oracle, Openjdk, etc.)</p>
<blockquote><p><code>sudo update-alternatives --config java</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/09/08/switching-java-versions-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>java.lang.IllegalArgumentException: No enum const class Pachube.Exposure.</title>
		<link>http://www.guinard.org/~misterdom/2010/08/27/jpachube-bug/</link>
		<comments>http://www.guinard.org/~misterdom/2010/08/27/jpachube-bug/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 19:40:46 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[pachube]]></category>
		<category><![CDATA[patch]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=166</guid>
		<description><![CDATA[Trying to push some data to Pachube using JPachube I faced this error: java.lang.IllegalArgumentException: No enum const class Pachube.Exposure which is reported as an issue on the JPachube forge but was not fixed yet. However, a nice fox actually located the bug and uploaded the solution. Since the it requires you to recompile the JPachube [...]]]></description>
			<content:encoded><![CDATA[<p>Trying to push some data to <a href="http://www.pachube.com">Pachube</a> using <a href="http://code.google.com/p/jpachube">JPachube</a> I faced this error: java.lang.IllegalArgumentException: No enum const class Pachube.Exposure which is reported as an issue on the <a href="http://code.google.com/p/jpachube/issues/detail?id=2">JPachube</a> forge but was not fixed yet. However, a nice fox actually located the bug and uploaded the solution. Since the it requires you to recompile the JPachube library I&#8217;ve done the job for you and <a href="http://www.guinard.org/misc/JPachube_patched.jar">uploaded it to here, until a patched version is officially released&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/08/27/jpachube-bug/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Find What Process Listens to Which Port</title>
		<link>http://www.guinard.org/~misterdom/2010/08/19/linux-find-process-4-port/</link>
		<comments>http://www.guinard.org/~misterdom/2010/08/19/linux-find-process-4-port/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 18:32:05 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=162</guid>
		<description><![CDATA[Find what process listens to which port:
fuser -v -n tcp PORT
]]></description>
			<content:encoded><![CDATA[<p>Find what process listens to which port:</p>
<blockquote><p><code>fuser -v -n tcp PORT</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/08/19/linux-find-process-4-port/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Packaging a Property File in a Maven Project</title>
		<link>http://www.guinard.org/~misterdom/2010/06/25/property-file-maven-project/</link>
		<comments>http://www.guinard.org/~misterdom/2010/06/25/property-file-maven-project/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 14:12:52 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=154</guid>
		<description><![CDATA[When working with a Maven project, property (e.g. config.properties) files are not copied to the build as a default. The easiest way to have them appear in the final jar is to put them in ${basedir}/src/main/resources.
As a result your property file will be copied at the root of your packaged jar.
]]></description>
			<content:encoded><![CDATA[<p>When working with a Maven project, property (e.g. config.properties) files are not copied to the build as a default. The easiest way to have them appear in the final jar is to put them in <code>${basedir}/src/main/resources</code>.</p>
<p>As a result your property file will be copied at the root of your packaged jar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/06/25/property-file-maven-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Manually Add a Jar to a Maven Repository</title>
		<link>http://www.guinard.org/~misterdom/2010/06/21/manually-add-a-jar-to-a-maven-repository/</link>
		<comments>http://www.guinard.org/~misterdom/2010/06/21/manually-add-a-jar-to-a-maven-repository/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 16:42:15 +0000</pubDate>
		<dc:creator>misterdom</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://www.guinard.org/~misterdom/?p=148</guid>
		<description><![CDATA[Use this command to manually add a Jar to a Maven Repository
mvn install:install-file -DgroupId=javax.comm -DartifactId=comm -Dversion=3.0 -Dpackaging=jar -Dfile=/home/misterdom/Documents/3_Software_Projects/WebPlogg/commapi/comm.jar
]]></description>
			<content:encoded><![CDATA[<p>Use this command to manually add a Jar to a Maven Repository<br />
<code>mvn install:install-file -DgroupId=javax.comm -DartifactId=comm -Dversion=3.0 -Dpackaging=jar -Dfile=/home/misterdom/Documents/3_Software_Projects/WebPlogg/commapi/comm.jar</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.guinard.org/~misterdom/2010/06/21/manually-add-a-jar-to-a-maven-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

