<?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>Blog::Log &#187; linux</title>
	<atom:link href="http://www.stpe.se/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stpe.se</link>
	<description>Not a blog, more a log.</description>
	<lastBuildDate>Sun, 28 Nov 2010 19:07:44 +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>Using screen for linux background processing</title>
		<link>http://www.stpe.se/2009/09/using-screen-for-linux-background-processing/</link>
		<comments>http://www.stpe.se/2009/09/using-screen-for-linux-background-processing/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 15:48:56 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=125</guid>
		<description><![CDATA[Perfect for long running batch jobs on a remote server over unreliable connections or if you want to bring your laptop home (instead of keeping that terminal running). Log in and run screen -t title_of_your_choice Do the same thing again if you want to create another window. All the following screen commands are preceeded by [...]]]></description>
			<content:encoded><![CDATA[<p>Perfect for long running batch jobs on a remote server over unreliable connections or if you want to bring your laptop home (instead of keeping that terminal running).</p>
<p>Log in and run<br />
<code>screen -t title_of_your_choice</code></p>
<p>Do the same thing again if you want to create another window.</p>
<p>All the following screen commands are preceeded by Ctrl-a (i.e. first press ctrl-a then the shortcut below)</p>
<ul>
<li>0-9 &#8211; switch to window by id</li>
<li>Ctrl-n &#8211; next window</li>
<li>Ctrl-a &#8211; previous window</li>
<li>K &#8211; kill window</li>
</ul>
<p>The next day, log in as usual and attach to the screen session using</p>
<p><code>screen -x</code></p>
<p>Check the man page for screen for other options and shortcuts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2009/09/using-screen-for-linux-background-processing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Count files recursively in a directory using Linux</title>
		<link>http://www.stpe.se/2008/12/count-files-recursively-in-a-directory-using-linux/</link>
		<comments>http://www.stpe.se/2008/12/count-files-recursively-in-a-directory-using-linux/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 07:53:57 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[command]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=68</guid>
		<description><![CDATA[Using Linux, to get the number of files in the current directory, use: ls -1 &#124; wc -l To count the number of files recursively in the current and all directories below it, use: find . -type f &#124; wc -l]]></description>
			<content:encoded><![CDATA[<p>Using Linux, to get the number of files in the current directory, use:</p>
<p><code>ls -1 | wc -l</code></p>
<p>To count the number of files recursively in the current and all directories below it, use:</p>
<p><code>find . -type f | wc -l</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/12/count-files-recursively-in-a-directory-using-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing GlassFish on Debian Etch or Ubuntu</title>
		<link>http://www.stpe.se/2008/07/installing-glassfish-on-debian-etch-ubunt/</link>
		<comments>http://www.stpe.se/2008/07/installing-glassfish-on-debian-etch-ubunt/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 10:56:56 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=41</guid>
		<description><![CDATA[I had to install GlassFish on an Debian Etch machine and here is how I did it (the purpose of these instructions is as a reminder to myself so I know what I did in case I have to do it again). Install Java 5 First thing needed is Java 5. To be able to [...]]]></description>
			<content:encoded><![CDATA[<p>I had to install GlassFish on an Debian Etch machine and here is how I did it (the purpose of these instructions is as a reminder to myself so I know what I did in case I have to do it again).</p>
<h3>Install Java 5</h3>
<p>First thing needed is Java 5. To be able to get Java 5 and other stuff, add <code>contrib</code> and <code>non-free</code> to each repository in <code>/etc/apt/sources.list</code> .</p>
<p>It should look something like this:</p>
<pre class="brush: xml; title: ; notranslate">
deb http://security.debian.org/ etch/updates main contrib non-free

deb http://ftp.debian.org/debian etch main contrib non-free
deb-src http://ftp.debian.org/debian etch main contrib non-free
</pre>
<p>Then simply run:<br />
<code>apt-get install sun-java5-jdk</code></p>
<h3>Download GlassFish</h3>
<p>Check the <a href="https://glassfish.dev.java.net">GlassFish website</a> for the latest version and download it (URL may be different depending on version):</p>
<p><code>wget http://java.net/download/javaee5/v2ur2/promoted/Linux/glassfish-installer-v2ur2-b04-linux.jar</code></p>
<h3>Install GlassFish</h3>
<p>Install GlassFish by running:<br />
<code>java -jar -mx256M glassfish-installer-v2-b09.jar</code></p>
<p>For convenience it might be nice to move GlassFish to a version independent directory name and make symlink (will make future upgrades easier as well):</p>
<p><code>mv glassfish /opt/glassfish-v2ur2-b09<br />
ln -s /opt/glassfish-v2ur2-b09 /opt/glassfish</code></p>
<p>Now setup GlassFish:</p>
<p><code>cd /opt/glassfish<br />
/opt/glassfish/lib/ant/bin/ant -f setup.xml</code></p>
<p>If you get an permission error, make sure ANT is executable (note that this is just a standard ANT, if you already have ANT you may use that one instead):</p>
<p><code>chmod u+x /opt/glassfish/lib/ant/bin/ant</code></p>
<p>Start the application server by running:<br />
<code><br />
/opt/glassfish/bin/asadmin start-domain<br />
</code></p>
<p>Verify that you may reach http://localhost:8080 and http://localhost:4848 (replace localhost if server is somewhere else).</p>
<p>Finally it might be a good idea to change the default admin password:<br />
<code><br />
/opt/glassfish/bin/asadmin change-admin-password --user admin<br />
</code></p>
<h3>Create init script</h3>
<p>Based on the <code>/etc/init.d/skeleton</code> I created the following init-script:</p>
<pre class="brush: xml; title: ; notranslate">
#! /bin/sh
### BEGIN INIT INFO
# Provides:          glassfish
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: glassfish initscript
# Description:       Simple initscript for GlassFish App server
### END INIT INFO

# Do NOT &quot;set -e&quot;

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/glassfish/bin
DESC=&quot;GlassFish Java EE5 App server&quot;
NAME=glassfish
ASADMIN=asadmin
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (&gt;= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        $ASADMIN start-domain \
                || return 1
}

#
# Function that stops the daemon/service
#
do_stop()
{
        $ASADMIN stop-domain \
                || return 1
}

case &quot;$1&quot; in
  start)
        [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Starting $DESC&quot; &quot;$NAME&quot;
        do_start
        case &quot;$?&quot; in
                0|1) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 0 ;;
                2) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 1 ;;
        esac
        ;;
  stop)
        [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_daemon_msg &quot;Stopping $DESC&quot; &quot;$NAME&quot;
        do_stop
        case &quot;$?&quot; in
                0|1) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 0 ;;
                2) [ &quot;$VERBOSE&quot; != no ] &amp;&amp; log_end_msg 1 ;;
        esac
        ;;
  restart|force-reload)
        log_daemon_msg &quot;Restarting $DESC&quot; &quot;$NAME&quot;
        do_stop
        sleep 10
        case &quot;$?&quot; in
          0|1)
                do_start
                case &quot;$?&quot; in
                        0) log_end_msg 0 ;;
                        1) log_end_msg 1 ;; # Old process is still running
                        *) log_end_msg 1 ;; # Failed to start
                esac
                ;;
          *)
                # Failed to stop
                log_end_msg 1
                ;;
        esac
        ;;
  *)
        echo &quot;Usage: $SCRIPTNAME {start|stop|restart|force-reload}&quot; &gt;&amp;2
        exit 3
        ;;
esac

:
</pre>
<p>Save it as <code>glassfish</code>, then run:</p>
<p><code>cd /etc/init.d<br />
update-rc.d glassfish defaults</code></p>
<p>Set executable permission on init script with <code>chmod a+x glassfish</code> .</p>
<p>That&#8217;s it!</p>
<p>These instructions are very much based on similar posts by Jasper Kalkers <a href="http://computingwithjasper.blogspot.com/2008/01/installing-glassfish-2-on-ubuntu-710.html">Installing Glassfish 2 on ubuntu 7.10</a> and Cay Horstmann <a href="http://weblogs.java.net/blog/cayhorstmann/archive/2006/07/installing_glas.html">Installing GlassFish and PostgreSQL on Ubuntu Server Edition</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/07/installing-glassfish-on-debian-etch-ubunt/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Enable symbolic links in GlassFish</title>
		<link>http://www.stpe.se/2008/07/enable-symbolic-links-in-glassfish/</link>
		<comments>http://www.stpe.se/2008/07/enable-symbolic-links-in-glassfish/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 09:21:08 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[glassfish]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=48</guid>
		<description><![CDATA[To enable symbolic links in GlassFish, which is disabled by default, go to the admin interface, click Configuration > Http Service > Virtual Servers and then the name of of the virtual server you are using (e.g. server). Under Additional Properties, click Add Property and enter allowLinking as name and true as value. It is [...]]]></description>
			<content:encoded><![CDATA[<p>To enable symbolic links in GlassFish, which is disabled by default, go to the admin interface, click <strong>Configuration</strong> > <strong>Http Service</strong> > <strong>Virtual Servers</strong> and then the name of of the virtual server you are using (e.g. <strong>server</strong>).</p>
<p>Under <strong>Additional Properties</strong>, click <strong>Add Property</strong> and enter <code>allowLinking</code> as name and <code>true</code> as value.</p>
<p>It is <a href="http://wiki.glassfish.java.net/Wiki.jsp?page=FaqActivateSymbolicLinks">also possible</a> to activate symbolic links using <code>sun-web.xml</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/07/enable-symbolic-links-in-glassfish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Backup on Linux and Ubuntu</title>
		<link>http://www.stpe.se/2008/07/simple-backup-on-linux-and-ubuntu/</link>
		<comments>http://www.stpe.se/2008/07/simple-backup-on-linux-and-ubuntu/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 05:18:37 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=33</guid>
		<description><![CDATA[Incremental encrypted remote backup using Amazon S3: Duplicity Incremental backup to another (remote) directory: rdiff-backup Easily available on Ubuntu using: sudo apt-get rdiff-backup Nice instructions for automating and scheduling backups. Simple backup by simply tar&#8217;ing everything, instructions on Ubuntu Forums.]]></description>
			<content:encoded><![CDATA[<p>Incremental encrypted remote backup using Amazon S3: <a href="http://www.brainonfire.net/2007/08/11/remote-encrypted-backup-duplicity-amazon-s3/">Duplicity</a></p>
<p>Incremental backup to another (remote) directory: <a href="http://www.nongnu.org/rdiff-backup/">rdiff-backup</a></p>
<p>Easily available on Ubuntu using:</p>
<blockquote><p>sudo apt-get rdiff-backup</p></blockquote>
<p><a href="http://www.ibm.com/developerworks/linux/library/l-backup/index.html">Nice instructions</a> for automating and scheduling backups.</p>
<p>Simple backup by simply tar&#8217;ing everything, instructions on <a href="http://ubuntuforums.org/showthread.php?t=35087">Ubuntu Forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/07/simple-backup-on-linux-and-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 8.04 LTS released</title>
		<link>http://www.stpe.se/2008/04/ubuntu-804-lts-released/</link>
		<comments>http://www.stpe.se/2008/04/ubuntu-804-lts-released/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:47:04 +0000</pubDate>
		<dc:creator>stefan</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.stpe.se/?p=5</guid>
		<description><![CDATA[Ubuntu 8.04 released, time to upgrade wardrobe server. http://www.ubuntu.com/download]]></description>
			<content:encoded><![CDATA[<p>Ubuntu 8.04 released, time to upgrade wardrobe server.</p>
<p>http://www.ubuntu.com/download</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stpe.se/2008/04/ubuntu-804-lts-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

