<?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>Helene &#187; IT &amp; Programming</title>
	<atom:link href="http://klungvik.com/index.php/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://klungvik.com</link>
	<description>Site of wonder (my personal sandbox)</description>
	<lastBuildDate>Wed, 21 Jul 2010 14:52:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Enter optimization</title>
		<link>http://klungvik.com/index.php/2010/enter-optimization/</link>
		<comments>http://klungvik.com/index.php/2010/enter-optimization/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 14:27:34 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[Communication & Self realization]]></category>
		<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[file synchronization]]></category>
		<category><![CDATA[sugarsync]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=998</guid>
		<description><![CDATA[A couple of days ago I wrote about Sugarsync, a service that stores all your data online and makes the data available on most devices. I have spent some days uploading all my data (which takes a bit of time). Since I have data going at least ten years back or more, one can safely [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I wrote about <a href="https://www.sugarsync.com/referral?rf=cbp3et6w3vnkt">Sugarsync</a>, a service that stores all your data online and makes the data available on most devices. I have spent some days uploading all my data (which takes a bit of time). Since I have data going at least ten years back or more, one can safely assume I don&#8217;t have it neatly organized. I have several folders with names like &#8220;backup_daymonthyear&#8221;.</p>
<p>I have spent some days just getting rid of duplicate files. I downloaded Duplicate Cleaner, and it came as no surprise that I had about 40 000 duplicate files. I even managed to find a file I have been looking for months ago and written off as lost in a trash can somewhere. That tells a little bit about my problem with excess data. Too much data and little  organization makes it impossible to find what I was looking for.</p>
<p>I have spent several hours a day just going through my data, and today it finally dawned on me in a way I will remember this time. I love optimizing systems (including my own file structure). I think many people would prefer sitting in the dentist chair rather than working through large amounts of data. That love of optimization doesn&#8217;t just extend to going through my own data. I remember I used to love to take code and making it better, I just wasn&#8217;t always conscious of how much I liked doing it. I naturally gravitated towards it. It&#8217;s not just loving to see the final result of the work I&#8217;ve done, I really love just the process of doing it. Spending time just doing it. No wonder I have used hours just sifting through files (and I have countless hours left&#8230;. 40 000 files!).</p>
<p>Now that I&#8217;m aware of how much I love it, I&#8217;m going to make sure that will be embedded in my everyday work. For what better way is there when you can go, feeling refreshed from work, just by doing what you love?</p>
<p>I know that&#8217;s the place I want to be.</p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2010/enter-optimization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Never worry about losing data again</title>
		<link>http://klungvik.com/index.php/2010/never-worry-about-losing-data-again/</link>
		<comments>http://klungvik.com/index.php/2010/never-worry-about-losing-data-again/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 12:26:18 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cloud storage]]></category>
		<category><![CDATA[file synchronization]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=981</guid>
		<description><![CDATA[I have a lot of data &#8211; that&#8217;s where it started. Secondly, I use a lot of computers and operating systems (OS). I have a private macbook pro, a notebook with windows,  a work computer (usually with Linux), iphone and ipad. My main need was to be able to access all my files from all [...]]]></description>
			<content:encoded><![CDATA[<p>I have a lot of data &#8211; that&#8217;s where it started.<br />
Secondly, I use a lot of computers and operating systems (OS). I have a private macbook pro, a notebook with windows,  a work computer (usually with Linux), iphone and ipad.</p>
<p>My main need was to be able to access all my files from all the computers, no matter what the OS was.</p>
<p>For a long time I have been a user of a service where you can store your data on the internet just through using a regular file management application like the Explorer or Finder. I work on the files locally, and changes gets synchronized to the internet in the background.</p>
<p>I never have to worry about backup again.<br />
I have access to all my files &#8211; everywhere.</p>
<p>And it only costs me 10 dollars (65 kroner) a month for 60 GB or 5 dollars for 30 GB.</p>
<p>For a long time I have been using Dropbox, which has a free version with 2 Gb of storage. It&#8217;s a genious service which makes file backup and synchronization as easy as it gets.</p>
<p>There are a myriad of services out there that provide backup at a very cheap amount, but I needed synchronization of files between computers.  So when I had to start paying for it, I started researching who could give me most value for my buck.</p>
<p>I landed on SugarSync which is a little bit cheaper (or give 10GB more storage space) and have more functionality than Dropbox:</p>
<ul>
<li>The coolest feature being music streaming, though I doubt I will be using it much.</li>
<li>Photo gallery</li>
<li>Easy to share files/folders with friends</li>
<li>Easy to make files/folders public (give everybody access)</li>
<li>Easily store mobile pictures to Sugarsync</li>
</ul>
<p>If you would like to try it out, use my referrer link (which gives both of us extra 250 MB):<a href="https://www.sugarsync.com/referral?rf=cbp3et6w3vnkt"> Sugarsync</a>. Unfortunately they have made it a bit cumbersome to become a free user (you have to enter credit card details just to become a user).  Moreover, I was unable to validate my account and it took two days before support fixed my problem.</p>
<p>The easiest start is <a href="https://www.dropbox.com/referrals/NTIzNjQ2Mjk">Dropbox</a>.</p>
<p>I read a good review of <a href="http://www.addictivetips.com/windows-tips/shoot-out-dropbox-vs-sugarsync/">SugarSync vs Dropbox at another blog</a>. Many comments that the upload of files from sugarsync is slow, and I can vouch for that. It&#8217;s a good idea to set off time and a computer to upload files first time around.</p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2010/never-worry-about-losing-data-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting date and time in linux</title>
		<link>http://klungvik.com/index.php/2010/setting-date-and-time-in-linux/</link>
		<comments>http://klungvik.com/index.php/2010/setting-date-and-time-in-linux/#comments</comments>
		<pubDate>Sun, 09 May 2010 14:21:45 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=963</guid>
		<description><![CDATA[Server clocks has a tendency to drift, so to ensure correct date, time and zone once and for all is a good thing. Setting the date sudo date +%Y%m%d -s "20081128" Setting the time sudo date +%T -s "08:23:00" Setting the timezone This is done by making /etc/localtime into a symbolic link that goes to [...]]]></description>
			<content:encoded><![CDATA[<p>Server clocks has a tendency to drift, so to ensure correct date, time and zone once and for all is a good thing.</p>
<p><strong>Setting the date</strong><br />
<code>sudo date +%Y%m%d -s "20081128"</code></p>
<p><strong>Setting the time</strong><br />
<code>sudo date +%T -s "08:23:00"</code></p>
<p><strong>Setting the timezone</strong><br />
This is done by making /etc/localtime into a symbolic link that goes to the timezone the server is to use.<br />
<code>sudo ln -sf /usr/share/zoneinfo/<em>your/zone</em> /etc/localtime</code></p>
<p><strong>Setting UTC or local time</strong><br />
Change the content of the file <code>/etc/sysconfig/clock</code> to &#8220;UTC=true&#8221; or &#8220;UTC=false&#8221; (in norway it&#8217;s true).</p>
<p><strong>Setting the hardware clock</strong><br />
Synchronizes the hw clock and system clock. Only add the &#8220;&#8211;utc&#8221; parameter if you are using UTC:<br />
<code>/sbin/hwclock --systohc --utc</code></p>
<p><strong>Regurlarly synchronize the clock toward Network Time Protocol</strong><br />
This is done by adding this to crontab (ensure that the path to rdate is correct beforehand):<br />
<code># update time with NTP server<br />
0 3, 9, 15, 21 * * * /usr/sbin/rdate 128. 2. 136. 71 | logger -t NTP</code></p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2010/setting-date-and-time-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>N00b boyfriend</title>
		<link>http://klungvik.com/index.php/2010/n00b-boyfriend/</link>
		<comments>http://klungvik.com/index.php/2010/n00b-boyfriend/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 09:26:29 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[Humor]]></category>
		<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=848</guid>
		<description><![CDATA[My friend, einar, found this hilarious video on youtube (unfortunately embedded video has been disabled by those that published it): N00b boyfriend]]></description>
			<content:encoded><![CDATA[<p>My friend, einar, found this hilarious video on youtube (unfortunately embedded video has been disabled by those that published it): <a href="http://www.youtube.com/watch?v=JVfVqfIN8_c">N00b boyfriend</a></p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2010/n00b-boyfriend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My identity have been stolen&#8230; again</title>
		<link>http://klungvik.com/index.php/2009/my-identity-have-been-stolen-again/</link>
		<comments>http://klungvik.com/index.php/2009/my-identity-have-been-stolen-again/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 19:32:21 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[id]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[theft]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=781</guid>
		<description><![CDATA[and again&#8230; and numerous times more. In the Norwegian newspaper, Aftenposten, one can read about Malin who were told that her name had been used for selling viagra, cars etc. through emails (also known as spam). &#8220;This is the easiest form of id theft&#8221; states Christian Meyer, senior advisor at NORSIS and suggest there may [...]]]></description>
			<content:encoded><![CDATA[<p>and again&#8230; and numerous times more.</p>
<p>In the Norwegian newspaper, Aftenposten, one can <a href="http://www.aftenposten.no/nyheter/iriks/article3275419.ece">read about Malin</a> who were told that her name had been used for selling viagra, cars etc. through emails (also known as spam). &#8220;This is the easiest form of id theft&#8221; states Christian Meyer, senior advisor at <a href="http://www.norsis.no/">NORSIS</a> and suggest there may be a need for a national ID center for dealing with issues related to identity.</p>
<p>I have experienced that not only my name, but my domain (klungvik.com) has been used for spam and there&#8217;s not a damn thing I can do about it. It&#8217;s the hazard I take by (just existing as a human being and) having an online presence with full credentials. I even once experienced that an obscure US law firm sent me a warning and letting me know that I was banned from their services. A warning I easily ignored since I don&#8217;t think I ever will use them, and because they revealed their technical ignorance just by sending me a warning.</p>
<p>Sending spam is easy if one looks at how it&#8217;s done technically. Forging email identity is really easy and I don&#8217;t think there&#8217;s much a national ID center can do about it. What makes spam and online forging of ID even more difficult is that it usually spans country borders &#8211; it&#8217;s an international problem.</p>
<p>It&#8217;s far worse if one&#8217;s identity have been used for making loans, purchasing goods etc. My current house loan I managed to get without ever showing up at the bank. All they wanted was a copy of my passport and a signature, and it was all done through the phone and postal system. They never saw me in person. A copy of my passport, and anybody can take up a loan on my behalf.</p>
<p>Stealing credit card details are also easy if one person have tried to purchase goods at the wrong website (and how anybody dare buying goods from spam is beyond my understanding). But all it requires is to cancel ones credit card and order a new one.</p>
<p>A national center for dealing with these kinds of issues can be a good idea and not only for electronic reasons. A national center can be used for dealing with issues related to immigrants that gives wrong name or deny telling their identity at our borders.</p>
<p>But couldn&#8217;t online id theft be managed by <a href="http://www.datatilsynet.no/templates/Page____194.aspx">The Data Inspectorate</a> (<a href="http://www.datatilsynet.no">datatilsynet</a>), and immigrants managed by <a href="http://www.regjeringen.no/nb/dep/ud.html?id=833">The Ministry of Foreign Affairs (UD)</a>? They certainly have the knowledge and resources needed. May be what we need isn&#8217;t a new national center (which we have for every thinkable issue anyway), but expanding the area of responsibility of existing agencies. Or may be NORSIS wants to do this themselves?</p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2009/my-identity-have-been-stolen-again/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automount Windows Active Directory shared drives in Linux</title>
		<link>http://klungvik.com/index.php/2009/automount-windows-ad-shared-drives-in-linux/</link>
		<comments>http://klungvik.com/index.php/2009/automount-windows-ad-shared-drives-in-linux/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 12:12:56 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[likewise-open]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=747</guid>
		<description><![CDATA[Requirements: Likewise-open is installed and working. Likewise-open plug in to pam to authenticate Windows AD users on a linux box. pam-mount will mount shared drives at login time using the login credentials. There is no need for samba to do this, and no need to write down your username and password in a file. Install [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Requirements:</strong><br />
Likewise-open is installed and working.</p>
<p>Likewise-open plug in to pam to authenticate Windows AD users on a linux box. pam-mount will mount shared drives at login time using the login credentials. There is no need for samba to do this, and no need to write down your username and password in a file.</p>
<ol>
<li>Install pam-mount.<br />
sudo apt-get install libpam-mount<br />
sudo mkdir -p /media/shared_folder_name</li>
<li>Set up shared drives to mount:<br />
sudo gedit /etc/security/pam_mount.conf.xml<br />
<code >&lt;!-- Volume definitions --&gt;<br />
&lt;!-- &lt;volume fstype="cifs" server="server ip adress" user="*" path="to_shared_folder" mountpoint="shared_folder_name" /&gt; --&gt;<br />
&lt;volume fstype="cifs" server="192.168.140.00" user="*" path="felles" mountpoint="/media/server_felles" /&gt;</code></li>
<li>Make gdm automatically mount shared folders at login:<br />
<code > sudo gedit /etc/pam.d/gdm</code><br />
At the bottom of the file, add the following:<br />
<code >@include common-pammount</code>
</li>
</ol>
<p>Reboot and log in again. The shared drive should be available.</p>
<p>Resources:<br />
<a href="https://wiki.ubuntu.com/MountWindowsSharesPermanently#Mount%20password%20protected%20network%20folders%20without%20credentials%20file%20using%20libpam_mount">wiki.ubuntu.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2009/automount-windows-ad-shared-drives-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Alfresco and CIFS troubleshooting on Ubuntu</title>
		<link>http://klungvik.com/index.php/2009/alfresco-and-cifs-troubleshooting-on-ubuntu/</link>
		<comments>http://klungvik.com/index.php/2009/alfresco-and-cifs-troubleshooting-on-ubuntu/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 13:21:43 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[alfresco]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=555</guid>
		<description><![CDATA[When installing Alfresco on an Ubuntu machine, CIFS doesn&#8217;t work out of the box. First question: is Samba installed? sudo apt-get install samba smbfs The configuration files for file-server setups: $ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.xml $ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.properties Uncomment these lines in file-servers.xml (though to make sure this is permanent &#8211; create file-servers-custom.xml): &#60;tcpipSMB port="1445" ipv6="${cifs.ipv6}" platforms="linux,solaris,macosx"/&#62; &#60;netBIOSSMB sessionPort="1139" namePort="1137" datagramPort="1138" [...]]]></description>
			<content:encoded><![CDATA[<p>When installing Alfresco on an Ubuntu machine, CIFS doesn&#8217;t work out of the box.<br />
First question: is Samba installed?<br />
<code>sudo apt-get install samba smbfs</code></p>
<p>The configuration files for file-server setups:<br />
$ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.xml<br />
$ALFRESCO_HOME/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/file-servers.properties </p>
<p>Uncomment these lines in file-servers.xml (though to make sure this is permanent &#8211; create file-servers-custom.xml):<br />
<code>      &lt;tcpipSMB port="1445" ipv6="${cifs.ipv6}" platforms="linux,solaris,macosx"/&gt;<br />
      &lt;netBIOSSMB sessionPort="1139" namePort="1137" datagramPort="1138" platforms="linux,solaris,macosx"/&gt;</code></p>
<p>Set iptable rules:<br />
<code>sudo su<br />
echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
modprobe iptable_nat<br />
iptables -F<br />
iptables -t nat -F<br />
iptables -P INPUT ACCEPT<br />
iptables -P FORWARD ACCEPT<br />
iptables -P OUTPUT ACCEPT<br />
iptables -t nat -A PREROUTING -p tcp --dport 445 -j REDIRECT --to-ports 1445<br />
iptables -t nat -A PREROUTING -p tcp --dport 139 -j REDIRECT --to-ports 1139<br />
iptables -t nat -A PREROUTING -p udp --dport 137 -j REDIRECT --to-ports 1137<br />
iptables -t nat -A PREROUTING -p udp --dport 138 -j REDIRECT --to-ports 1138</code></p>
<p>Check iptable rules:<br />
<code>sudo iptables -t nat -L</code></p>
<p><strong>Troubleshooting options:</strong><br />
To check what ports are listened to:<br />
<code>netstat -a</code><br />
Look for:<br />
<code>tcp6       0      0 [::]:1445               [::]:*                  LISTEN<br />
tcp6       0      0 [::]:1139               [::]:*                  LISTEN</code></p>
<p>To see who listens at what port:<br />
<code>$ sudo lsof -i :1139 -n<br />
COMMAND   PID     USER   FD   TYPE DEVICE SIZE NODE NAME<br />
java    11881 alfresco  296u  IPv6  60400       TCP *:1139 (LISTEN)</code></p>
<p>Another way to check if the port is listened to:<br />
<code>$ telnet localhost 1139<br />
Trying 127.0.0.1...<br />
Connected to localhost.<br />
Escape character is '^]'.</code></p>
<p>Resources:<br />
<a href="http://wiki.alfresco.com/wiki/File_Server_Configuration">http://wiki.alfresco.com/wiki/File_Server_Configuration</a><br />
<a href="http://wiki.alfresco.com/wiki/CIFS_linux">CIFS Linux</a><br />
<a href="http://wiki.alfresco.com/wiki/Troubleshooting">http://wiki.alfresco.com/wiki/Troubleshooting</a><br />
<a href="http://forums.alfresco.com/en/viewtopic.php?t=938">CIFS Troubleshooting</a></p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2009/alfresco-and-cifs-troubleshooting-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to create an Alfresco Module Package (AMP)</title>
		<link>http://klungvik.com/index.php/2009/how-to-create-an-alfresco-module-package-amp/</link>
		<comments>http://klungvik.com/index.php/2009/how-to-create-an-alfresco-module-package-amp/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 14:02:04 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[alfresco]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=513</guid>
		<description><![CDATA[In this post I will set up the basic settings to create an Alfresco Module Package (AMP). Ant needs to be installed to make this work. This creates a skeleton AMP module that does nothing except being a module. So the first step is to create a new project in your favorite IDE. In the [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I will set up the basic settings to create an Alfresco Module Package (AMP). <a href="http://ant.apache.org/">Ant</a> needs to be installed to make this work. This creates a skeleton AMP module that does nothing except being a module. So the first step is to create a new project in your favorite IDE.</p>
<p>In the <a href="http://wiki.alfresco.com/wiki/Alfresco_SDK">Alfresco SDK</a> there are some great examples, and one of them is named SDK Basic AMP. <a href="http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#Structuring_your_Project">AMP&#8217;s have a specific directory structure that it&#8217;s wise to use</a>. When deploying AMP&#8217;s the Module Management Tool (mmt) maps the files to specific locations in the alfresco tree. This can be a bit <a href="http://klungvik.com/index.php/2009/alfresco-the-first-lessons-learned/">confusing when dealing with configuration files</a> and if the SDK samples have solved a problem in a specific way, it&#8217;s wise to just follow that road.</p>
<p>1. Create a module.properties file containing these lines:<br />
<code># Skeleton AMP Module<br />
module.id=skeleton<br />
module.title=Skeleton<br />
module.description=Add a skeleton amp to Alfresco<br />
module.version=1.0</code></p>
<p>This file contain module information and is to be located in the root of the amp. Usually the file is located in the IDE at config/alfresco/module/modulename/module.properties. <strong>(IDE)</strong> config/alfresco maps to <strong>alfresco_dir</strong>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/.</p>
<p>2. Create a config/alfresco/module/skeleton/module.context file:<br />
<code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;<br />
&lt;!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'&gt;</p>
<p>&lt;beans&gt;<br />
&lt;/beans&gt;<br />
</code> </p>
<p>This is where one puts bean initializations, bootstrap resource bundles, adds webclient configuration files etc. when needed.</p>
<p>3. Place class files (if you have any) in source/java/my/namespace/*.java</p>
<p>4. Sample build.xml for ant:<br />
<code >&lt;?xml version="1.0"?&gt;</p>
<p>&lt;project name="Skeleton" default="deploy-war" basedir="."&gt;<br />
    &lt;!-- Project directories, REPLACE WITH YOUR SETTINGS --&gt;<br />
    &lt;property name="project.dir" value="."/&gt;<br />
    &lt;property name="build.dir" value="${project.dir}/build"/&gt;<br />
    &lt;property name="jar.file" value="${build.dir}/lib/skeleton.jar" /&gt;<br />
    &lt;property name="amp.file" value="${build.dir}/dist/skeleton.amp"/&gt;<br />
    &lt;property name="tomcat.dir" value="/opt/Alfresco/tomcat" /&gt;<br />
    &lt;property name="war.file" value="${tomcat.dir}/webapps/alfresco.war"/&gt;<br />
    &lt;property name="lib.dir" value="/opt/alfresco-sdk2.9/lib/server" /&gt;</p>
<p>    &lt;!-- Path to essential libraries --&gt;<br />
    &lt;path id="class.path"&gt;<br />
        &lt;dirset dir="${build.dir}" /&gt;<br />
        &lt;fileset dir="${lib.dir}" includes="**/*.jar"/&gt;<br />
    &lt;/path&gt;</p>
<p>    &lt;!-- Creates a build directory where the amp and jar files will be located --&gt;<br />
    &lt;target name="mkdirs"&gt;<br />
        &lt;mkdir dir="${build.dir}/dist" /&gt;<br />
        &lt;mkdir dir="${build.dir}/lib" /&gt;<br />
    &lt;/target&gt;</p>
<p>     &lt;target name="package-jar" depends="compile"&gt;<br />
        &lt;delete file="${jar.file}" /&gt;</p>
<p>	&lt;jar destfile="${jar.file}"&gt;<br />
		&lt;fileset dir="${build.dir}" includes="**/faces-config.xml, **/*.class" /&gt;<br />
	&lt;/jar&gt;<br />
     &lt;/target&gt;</p>
<p>    &lt;target name="package-amp" depends="mkdirs, package-jar" description="Packages the amp"&gt;<br />
         &lt;zip destfile="${amp.file}"&gt;<br />
             &lt;fileset dir="${project.dir}/build" includes="lib/*.jar" /&gt;<br />
             &lt;fileset dir="${project.dir}" includes="module.properties" /&gt;<br />
             &lt;fileset dir="${project.dir}" includes="config/**/*.*" /&gt;<br />
        &lt;/zip&gt;<br />
    &lt;/target&gt;</p>
<p>    &lt;!-- Use when checking what deployment of an AMP will do without actually committing the deployment --&gt;<br />
    &lt;target name="preview-install"&gt;<br />
        &lt;echo&gt;Preview installation of AMP&lt;/echo&gt;<br />
         &lt;java dir="." fork="true" classname="org.alfresco.repo.module.tool.ModuleManagementTool"&gt;<br />
            &lt;classpath refid="class.path" /&gt;<br />
            &lt;arg line="install ${amp.file} ${war.file} -preview -force -verbose"/&gt;<br />
        &lt;/java&gt;<br />
    &lt;/target&gt;</p>
<p>     &lt;!-- Deploys the war to Alfresco --&gt;<br />
     &lt;target name="deploy-war" depends="package-amp"&gt;<br />
         &lt;java dir="." fork="true" classname="org.alfresco.repo.module.tool.ModuleManagementTool"&gt;<br />
            &lt;classpath refid="class.path" /&gt;<br />
            &lt;arg line="install ${amp.file} ${war.file} -force -verbose"/&gt;<br />
        &lt;/java&gt;<br />
    &lt;/target&gt;</p>
<p>&lt;/project&gt;</code></p>
<p>An AMP file is a zipped archive, so if you would like to know the content of the amp then:<br />
<code>unzip skeleton.amp</code></p>
<p>To view the content of a jar file:<br />
<code>jar -tvf skeleton.jar</code></p>
<p><a href='http://klungvik.com/wp-content/uploads/2009/04/ampsample.tar.gz'>SDK Basic AMP example</a> &#8211; This is the basic AMP taken from the SDK. </p>
<p>Resources:<br />
<a href="http://wiki.alfresco.com/wiki/Developer_Guide#Alfresco_Module_Packages">Alfresco Module Packages</a><br />
<a href="http://wiki.alfresco.com/wiki/Alfresco_SDK">Alfresco SDK</a><br />
<a href="http://wiki.alfresco.com/wiki/Module_Management_Tool">http://wiki.alfresco.com/wiki/Module_Management_Tool</a></p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2009/how-to-create-an-alfresco-module-package-amp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to remove DRM from ITunes music and videos</title>
		<link>http://klungvik.com/index.php/2009/how-to-remove-drm-from-itunes-music-and-videos/</link>
		<comments>http://klungvik.com/index.php/2009/how-to-remove-drm-from-itunes-music-and-videos/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 13:25:56 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[itunes]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=530</guid>
		<description><![CDATA[Requiem is an application that works on all platforms and it removes the DRM on (purchased) videos and music in ITunes. The application can be downloaded from this torrent. This is of course something Apple is not happy about, so therefore each version of ITunes works on a specific Requiem version. Thankfully the developer of [...]]]></description>
			<content:encoded><![CDATA[<p>Requiem is an application that works on all platforms and it removes the DRM on (purchased) videos and music in ITunes. The application can be downloaded from <a href="http://thepiratebay.org/torrent/4775230/Requiem_1.8.6_(iTunes_8.1__Windows___Mac)">this torrent</a>. This is of course something Apple is not happy about, so therefore each version of ITunes works on a specific Requiem version. Thankfully the developer of Requiem updates the application to match changes made by Apple. </p>
<p>Now, the torrent link will soon be outdated as new versions of ITunes and Requiem is released, so therefore I also supply the <a href="http://thepiratebay.org/search/requiem%201.8.5/0/99/300">search that will find the latest release of Requiem</a>. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2009/how-to-remove-drm-from-itunes-music-and-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alfresco: The first lessons learned</title>
		<link>http://klungvik.com/index.php/2009/alfresco-the-first-lessons-learned/</link>
		<comments>http://klungvik.com/index.php/2009/alfresco-the-first-lessons-learned/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 06:04:50 +0000</pubDate>
		<dc:creator>Helene Klungvik</dc:creator>
				<category><![CDATA[IT & Programming]]></category>
		<category><![CDATA[alfresco]]></category>

		<guid isPermaLink="false">http://klungvik.com/?p=521</guid>
		<description><![CDATA[The last couple of weeks I have learned some lessons the hard way. 1. When doing changes to faces-config(-custom).xml, put it in a jar-file. This is stated in Developing an Alfresco Module, but it&#8217;s very easy to forget because so many places one can read about extending Alfresco using faces-config-custom.xml. There are two options for [...]]]></description>
			<content:encoded><![CDATA[<p>The last couple of weeks I have learned some lessons the hard way. </p>
<p><strong>1. When doing changes to faces-config(-custom).xml, put it in a jar-file.</strong><br />
This is stated in <a href="http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#Adding_a_custom_faces-config.xml">Developing an Alfresco Module</a>, but it&#8217;s very easy to forget because so many places one can read about <a href="http://wiki.alfresco.com/wiki/Packaging_And_Deploying_Extensions#JSF_configuration_files">extending Alfresco using faces-config-custom.xml</a>.</p>
<p>There are two options for making changes to faces-config:<br />
- Add a faces-config-custom.xml in the AMP.<br />
In an IDE it would typically ble places in web/WEB-INF/faces-config-custom.xml. When deploying the amp to Alfresco, it doesn&#8217;t overwrite the WEB-INF/faces-config-custom.xml on the server as one would expect, it&#8217;s as if the changes were never made. In reality Alfresco does some magic, and the changes are available in alfresco, but not in any extensions you have made. So if you try to create a managed bean and access it from within alfresco jsp-files, life is good. But in most cases, extending Alfresco is the best way to go and then the managed bean is suddenly not available. Therefore the next choice is the best way.</p>
<p>- Add faces-config.xml to the jar-file.<br />
Yes, no need for a faces-config-custom.xml here, and the declarations are available all over alfresco, including any third-party extensions. Inside the jar the file is located at META-INF/faces-config.xml. </p>
<p>Alfresco is simply a bit touchy when dealing with faces-config files.</p>
<p><strong>2. Use (unique) IDs on faces components no matter what</strong><br />
I came up in the situation that I had one jsp that only contained two lines:<br />
<code>&lt;%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %&gt;<br />
&lt;r:webScript  scriptUrl="/service/mwsearch" /&gt;</code></p>
<p>With just two lines to maintain, one would think it would be difficult to make mistakes&#8230; Wrong! It doesn&#8217;t matter that even the<a href="http://dev.alfresco.com/resource/docs/taglib/web-client/r/webScript.html"> taglib documentation state that id isn&#8217;t required</a>, because it&#8217;s simply not true. ID&#8217;s are required unless you want erratic behaviour &#8211; IllegalStateExceptions (like seen below) that occurs at random, but will definitly stop the show:</p>
<p>javax.faces.FacesException: java.lang.IllegalStateException: Client-id : _idJsp13 is duplicated in the faces tree. Component : browse:_idJsp13, path: {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /jsp/browse/browse.jsp][Class: javax.faces.component.html.HtmlForm,Id: browse][Class: org.alfresco.web.ui.common.component.UIPanel,Id: spaces-panel][Class: org.alfresco.web.ui.common.component.data.UIRichList,Id: spacesList][Class: org.alfresco.web.ui.common.component.data.UIColumn,Id: col1][Class: org.alfresco.web.ui.common.component.UIActionLink,Id: col1-act1][Class: javax.faces.component.UIParameter,Id: _idJsp13]}</p>
<p><strong>3. Any files in the AMP will override files in the Data Dictionary</strong><br />
I had a webscript where I needed to make an url configurable. Now, configurations can be added in a modulename.get.config.xml <a href="http://wiki.alfresco.com/wiki/Web_Scripts#Web_Script_Configuration">as stated in the documentation</a>. I removed the file from my AMP, and added the file in Alfresco DM &#8211;> Company Home &#8211;> Data Dictionary &#8211;> Web Scripts Extentions &#8211;> Modulefolder &#8211;> modulename.get.config.xml. And voila, my Freemarker templates caught on the config changes after a restart of Alfresco.</p>
<p>Hopefully this will have saved at least one person from hours of frustration.</p>
]]></content:encoded>
			<wfw:commentRss>http://klungvik.com/index.php/2009/alfresco-the-first-lessons-learned/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
