<?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>patrik.cqure.net</title>
	<atom:link href="http://patrik.cqure.net/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://patrik.cqure.net/wordpress</link>
	<description>random thoughts about random things</description>
	<lastBuildDate>Fri, 27 Nov 2009 23:09:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Add as email attachment</title>
		<link>http://patrik.cqure.net/wordpress/2009/11/09/add-as-email-attachment/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/11/09/add-as-email-attachment/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 10:05:14 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[context]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[snowleopard]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=219</guid>
		<description><![CDATA[One thing that I&#8217;m missing in Snow Leopard is the &#8220;add as email attachment&#8221; option in the Finder context menu as I find myself constantly right-clicking a file when I want to send it to someone. The functionality exists but not in the context menu. You need to go all the way to Finder-&#62;Services-&#62;New Email [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that I&#8217;m missing in Snow Leopard is the &#8220;add as email attachment&#8221; option in the Finder context menu as I find myself constantly right-clicking a file when I want to send it to someone. The functionality exists but not in the context menu. You need to go all the way to Finder-&gt;Services-&gt;New Email With Attachment.</p>
<p>Some may argue well, that&#8217;s the way it is, Apple decided this is the best way of doing things, you need to accept it and move on. Why do that, when fixing it the way you want it is a couple of seconds away?</p>
<p>If you want to be able to right-click a file in Finder in order to add it as an attachment, this is what you need to do:</p>
<ol>
<li>Start Automator</li>
<li>Choose the Service template</li>
<li>In the dropdown boxes that appear choose &#8220;files or folders&#8221; and &#8220;Finder&#8221;</li>
<li>Click the Mail application in the Library tree</li>
<li>Drag the &#8220;New Mail Message&#8221; to the workflow area</li>
<li>Save the new service (the name of the workflow will appear in the context-menu)</li>
</ol>
<p>That&#8217;s it! The new action should appear at the bottom when you right-click a file in Finder.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F11%2F09%2Fadd-as-email-attachment%2F&amp;linkname=Add%20as%20email%20attachment"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/11/09/add-as-email-attachment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Truecrypt, now also for Snow Leopard</title>
		<link>http://patrik.cqure.net/wordpress/2009/10/22/truecrypt-now-also-for-snow-leopard/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/10/22/truecrypt-now-also-for-snow-leopard/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 16:08:22 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=212</guid>
		<description><![CDATA[Truecrypt 6.3 has finally been released and now fully supports Snow Leopard. No need to patch and compile anymore, simply grab your copy from here: http://www.truecrypt.org/downloads
]]></description>
			<content:encoded><![CDATA[<p>Truecrypt 6.3 has finally been released and now fully supports Snow Leopard. No need to patch and compile anymore, simply grab your copy from here: <a href="http://www.truecrypt.org/downloads">http://www.truecrypt.org/downloads</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F10%2F22%2Ftruecrypt-now-also-for-snow-leopard%2F&amp;linkname=Truecrypt%2C%20now%20also%20for%20Snow%20Leopard"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/10/22/truecrypt-now-also-for-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing your NAS to Humyo</title>
		<link>http://patrik.cqure.net/wordpress/2009/09/27/backing-your-nas-to-humyo/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/09/27/backing-your-nas-to-humyo/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 08:50:28 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bubba]]></category>
		<category><![CDATA[davfs2]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[humyo]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=211</guid>
		<description><![CDATA[I have written about my Bubba&#124;Two NAS before and I am still very happy with it. It&#8217;s not a performance beast but so quiet that it&#8217;s not noticeable in our living room which has always been the most important for me. Even though it runs RAID-1 and mirrors the 1TB internal disk to an external [...]]]></description>
			<content:encoded><![CDATA[<p>I have written about my <a href="https://www.excito.com/bubba/products/overview.html">Bubba|Two </a>NAS before and I am still very happy with it. It&#8217;s not a performance beast but so quiet that it&#8217;s not noticeable in our living room which has always been the most important for me. Even though it runs RAID-1 and mirrors the 1TB internal disk to an external eSata disk I wanted to add some additional security by moving some of the most important files off-site. This article will describe some of the challenges and my final solution. The setup can be used on any Debian or Ubuntu based distribution.</p>
<p><span id="more-211"></span><strong>Finding a storage service provider</strong></p>
<p>First off I needed to find someplace where I could upload my files. The most obvious choices were <a href="http://www.getdropbox.com/">Dropbox</a>, <a href="https://spideroak.com/">SpiderOak</a> or one of the alternatives found here: <a href="http://alternativeto.net/desktop/dropbox/">http://alternativeto.net/desktop/dropbox/</a>. Even though some of the clients were possible to setup without a GUI and provided Linux clients, they did so for the x86 or x86_64 architecture. The problem is that the Bubba|Two runs Debian on a PPC architecture which I couldn&#8217;t find any single client for. Needing a proprietary client was kind of annoying anyway so I started looking for alternative solutions such as backing up over Rsync, Scp, Ftp or WebDav. I finally found two providers allowing me to connect to my storage area using WebDav: <a href="http://humyo.com/">Humyo</a> and <a href="http://www.bingodisk.com/">BingoDisk</a>. During my, not that scientific tests, I had better luck with performance on Humyo and as they were the (minimally) cheaper alternative I opened a trial account there.</p>
<p><strong>Setting up the storage access</strong></p>
<p>In order to access the storage using webdav we need a webdav client. Preferably the client should allow for easy mirroring of an entire directory of files. The natural choice would be the webdav FUSE filesystem <a href="http://savannah.nongnu.org/projects/davfs2">davfs2</a>. FUSE stands for file system in user space and allows developers to implement file systems that can be accessed from userspace with FUSE rather than being implemented in the Linux kernel. There are today several great FUSE filesystems such as davfs2, sshfs, ftpfs, encfs and many many more. Once the file system is mounted it appears as any other file system. FUSE also allows for file system chaining so that encfs can run on top of eg. davfs2 to provide file encryption on top of a remote WebDav file system.</p>
<p>The davfs2 package exists in both Debian and in Ubuntu but unfortunately with old versions which I had some trouble getting to work with Humyo. The problem I was experiencing was that all uploaded files would be of zero size and empty. This was solved as soon as I installed a more current version (1.4.1). As the upcoming Ubuntu Karmic release ships with this version I used the package source to build a new package for my Bubba|Two which worked out great. This is what I did:</p>
<p><em>Preparing the build environment</em></p>
<p>First off I needed a compiler and build environment to build from source, I installed it by issuing the following command:</p>
<pre lang="bash">sudo apt-get install build-essential make gcc</pre>
<p>Then the davfs2 package requires libneon to build. In order to install this I did:</p>
<pre lang="bash">sudo apt-get install libneo26-gnutls-dev</pre>
<p><em>Downloading the source code</em></p>
<p>Once these prerequisites were in place I downloaded the source code, decompressed it and patched it using the following:</p>
<pre lang="bash">mkdir $HOME/src
cd $HOME/src
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/davfs2/davfs2_1.4.1.orig.tar.gz
wget http://archive.ubuntu.com/ubuntu/pool/universe/d/davfs2/davfs2_1.4.1-1.diff.gz
tar xvzf davfs2_1.4.1.orig.tar.gz
zcat davfs2_1.4.1-1.diff.gz | patch -p0</pre>
<p><em>Building the package from source</em></p>
<p>Now we can start to build the package by issuing:</p>
<pre lang="bash">cd $HOME/src/davfs2-1.4.1
chmod +x debian/rules
sudo debian/rules binary</pre>
<p>This should give us a complete deb package in the parent directory ($HOME/src). The name of this package depends on the architecture which it was built for, in my case the name was: davfs2_1.4.1-1_powerpc.deb</p>
<p><em>Installing the package</em></p>
<p>The package can be installed by issuing the following command:</p>
<pre lang="bash">sudo dpkg -i $HOME/src davfs2_1.4.1-1_powerpc.deb</pre>
<p><strong>Setting up davfs2 to access Humyo</strong></p>
<p>With the davfs2 package installed we now have to do some minor changes to a couple of files in order to mount the file system without the need for root access and prompting for credentials. Also as Humyo doesn&#8217;t seem to support file locking, we need to disable this to in order to avoid a warning each time we mount a file system.</p>
<p><em>Adding your Humyo username and password to davfs2</em></p>
<p>In order to add our credentials to davfs2 we need to add the following file to the /etc/davfs2/secrets file:</p>
<p>https://dav.humyo.com    <username>    &#8221;
<password>&#8221;</p>
<p>So if your username is foo@bar.com and your password is foobar the line should look like this:</p>
<p>https://dav.humyo.com    foo@bar.com    &#8221;foobar&#8221;</p>
<p>Don&#8217;t forget that the server should be accessed over SSL, hence the https://dav.humyo.com</p>
<p><em>Disabling file locking</em></p>
<p>As Humyo doesn&#8217;t support file locking we need to disable this in order to remove the annoying warning each time a file system is mounted. This can be done either on a per-system, per-user level or in a custom configuration file. As I&#8217;m not running any other WebDav file system on the server I changed this in the global /etc/davfs2/davfs2.conf file. Consult the mount.davfs manual page (man mount.davfs) for information how this can be changed on a per-user or in a custom configuration file. To change it on a per-system level set the use_locks option to 0 (zero) in the /etc/davfs2/davfs2.conf file.</p>
<p><strong>Importing the SSL certificate</strong></p>
<p>We&#8217;re now almost all set to mount the remote WebDav file system. However, if you try to mount the file system now, you would most likely get the following message:</p>
<blockquote><p>/sbin/mount.davfs: the server certificate is not trusted<br />
issuer:      US, New Jersey, Jersey City, OptimumSSL CA, OptimumSSL CA<br />
subject:     OptimumSSL Wildcard, Domain Control Validated, OptimumSSL Wildcard, Domain Control Validated, *.humyo.com<br />
identity:    *.humyo.com<br />
fingerprint: bf:28:74:8e:63:96:bf:07:9d:99:ed:f7:bf:44:cc:ad:f8:7b:c6:a7<br />
You only should accept this certificate, if you can<br />
verify the fingerprint! The server might be faked<br />
or there might be a man-in-the-middle-attack.<br />
Accept certificate for this session? [y,N]</p></blockquote>
<p>The error occurs due to OpenSSL not being able to verify the SSL certificate chain. In order to get rid of this message we need to provide davfs2 with the root certificate. We do this by issuing the following command:</p>
<pre lang="bash">wget -O - "https://support.comodo.com/index.php?_m=downloads&#038;_a=downloadfile&#038;downloaditemid=10" | \
sudo tee /etc/davfs2/certs/addtrust_ab.pem</pre>
<p>Then we need to instruct davfs2 to read this pem file when mounting our file system by adding the following line to /etc/davfs2/davfs2.conf:</p>
<p>servercert /etc/davfs2/certs/addtrust_ab.pem</p>
<p>So, now we should be all set!</p>
<p><strong>Creating a mount point and adding it to fstab</strong></p>
<p>We&#8217;re now ready to create a mount point. I chose to mount my Humyo storage to /mnt/humyo. In order to be able to do this I created the directory by issuing:</p>
<pre lang="bash">sudo mkdir /mnt/humyo</pre>
<p>Once we have the mount point in place we can try to mount our file system by issuing the following command:</p>
<pre lang="bash">sudo mount -t davfs https://dav.humyo.com /mnt/humyo/</pre>
<p>If all went well we should not have gotten any error messages and we can test whether it works by copying any file to /mnt/humyo. You can check whether the file actually made it to Humyo by checking their web interface. If it works your good to go, if not well, you need to start checking what went wrong.</p>
<p><strong>Adding the mount point to fstab</strong></p>
<p>The current setup only allows root to mount the file system and requires you to issue the above command to do so. In order to allow users to mount the file system you need to add a line into /etc/fstab.</p>
<p>https://dav.humyo.com    /mnt/humyo    davfs    user,noauto,rw    0    0</p>
<p>If you want the file system to be mounted at boot change the <em>noauto</em> to <em>auto</em> instead.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F09%2F27%2Fbacking-your-nas-to-humyo%2F&amp;linkname=Backing%20your%20NAS%20to%20Humyo"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/09/27/backing-your-nas-to-humyo/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>OS X, nano and backspace trouble</title>
		<link>http://patrik.cqure.net/wordpress/2009/09/22/os-x-nano-and-backspace-trouble/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/09/22/os-x-nano-and-backspace-trouble/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 08:10:53 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[backspace]]></category>
		<category><![CDATA[MAC]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[snowleopard]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=205</guid>
		<description><![CDATA[A part from my Mac running OS X I am running quite a few Ubuntu and Debian servers and workstations. One thing that has been bugging me for quite a while is the fact that the backspace key has not been working properly in the nano editor on these systems when accessed over ssh from [...]]]></description>
			<content:encoded><![CDATA[<p>A part from my Mac running OS X I am running quite a few Ubuntu and Debian servers and workstations. One thing that has been bugging me for quite a while is the fact that the backspace key has not been working properly in the nano editor on these systems when accessed over ssh from my OS X laptop. Instead of deleting the character immediately to the left of the cursor, it deletes the character to the right as if I was hitting the delete key.</p>
<p>I got some creative suggestions such as: &#8220;Well, don&#8217;t use nano use vi/emacs/pico instead&#8221;. Those are all great suggestions but I still wanted to solve the problem with nano as it&#8217;s installed on all of my systems, and I find myself using it a lot.</p>
<p>Doing some Googling I came up with one solution, which I wasn&#8217;t entirely happy with as it involved changing the TERM settings on the remote computer. This isn&#8217;t all bad but I wanted to try to find a solution that actually just affects  nano rather than every other program that uses the TERM environment variable. For those of you that don&#8217;t consider this to be a problem you can simply place the following in your .bash_profile or equivalent file.</p>
<blockquote><p>export TERM=xterm</p></blockquote>
<p>By studying the /etc/nanorc I immediately found something interesting which turned out to be a better solution:</p>
<blockquote><p>## Fix Backspace/Delete confusion problem.</p>
<p>set rebinddelete</p></blockquote>
<p>In order to set this option for everyone on the system it needs to go in /etc/nanorc, however for me it&#8217;s sufficient to fix it for my own accounts. This can be done by issuing the following command:</p>
<pre lang="bash">echo "set rebinddelete" >> $HOME/.nanorc</pre>
<p>Now, the next time you start nano the backspace should behave as backspace rather than delete. Delete still works by pressing fn+backspace as usual.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F09%2F22%2Fos-x-nano-and-backspace-trouble%2F&amp;linkname=OS%20X%2C%20nano%20and%20backspace%20trouble"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/09/22/os-x-nano-and-backspace-trouble/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System keychain + passwords = bad idea</title>
		<link>http://patrik.cqure.net/wordpress/2009/09/18/system-keychain-passwords-bad-idea/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/09/18/system-keychain-passwords-bad-idea/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 17:56:35 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=195</guid>
		<description><![CDATA[Well, it finally bit me in the &#8230; Storing sensitive information, such as passwords for encrypted volumes, in the system keychain is a *REALLY* *REALY* bad idea! Why? Well, in contrast to the login keychain that is unlocked by a user&#8217;s password (transparently, if the same as the login password) the system keychain is accessible [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it finally bit me in the &#8230; Storing sensitive information, such as passwords for encrypted volumes, in the system keychain is a *REALLY* *REALY* bad idea! Why? Well, in contrast to the login keychain that is unlocked by a user&#8217;s password (transparently, if the same as the login password) the system keychain is accessible by any administrator on the system. So basically anyone with root access can dump all passwords from the system keychain.</p>
<p>If this wasn&#8217;t bad enough you can simply boot the system using the installation DVD and reset any administrator password, login and have instant access to the system keychain. So, well, using the system keychain for passwords to encrypted disks is not a great idea.</p>
<p>I therefore removed the articles referring to how to setup TrueCrypt with the keychain.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F09%2F18%2Fsystem-keychain-passwords-bad-idea%2F&amp;linkname=System%20keychain%20%2B%20passwords%20%3D%20bad%20idea"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/09/18/system-keychain-passwords-bad-idea/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Slow sleep on Snow Leopard</title>
		<link>http://patrik.cqure.net/wordpress/2009/09/17/slow-sleep-on-snow-leopard/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/09/17/slow-sleep-on-snow-leopard/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 06:30:59 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[hdd]]></category>
		<category><![CDATA[hibernation]]></category>
		<category><![CDATA[lid]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[power down]]></category>
		<category><![CDATA[ram]]></category>
		<category><![CDATA[sleep]]></category>
		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=182</guid>
		<description><![CDATA[Ever since I upgraded to Snow Leopard my MacBook took for ever to go into sleep when closing the lid. This was very frustrated as being a time optimist I usually work until I really need to leave and then I don&#8217;t want to spend 20 seconds before being able to put the computer into [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I upgraded to Snow Leopard my MacBook took for ever to go into sleep when closing the lid. This was very frustrated as being a time optimist I usually work until I <strong>really</strong> need to leave and then I don&#8217;t want to spend 20 seconds before being able to put the computer into my computer bag. Anyway, looking in to the problem I found that OS X provides several sleep (hibernate) modes where some are considered more safe than others and therefore require more time.</p>
<p>In short when closing the lid the MacBook can either:</p>
<p>- Sleep and keep the RAM memory powered on<br />
- Hibernate and write memory contents to disk and power down completely</p>
<p>Writing memory to disk is considered safer as even if your battery runs out of juice memory contents are still preserved and the OS can bring you back to where you were. This of course comes with a time penalty. The following article explains everything in more detail and also provides information on how to change between different sleep and hibernation modes:<br />
<a href="http://www.macworld.com/article/53471/2006/10/sleepmode.html">http://www.macworld.com/article/53471/2006/10/sleepmode.html</a></p>
<p>I changed my settings from hibernation to sleep and went from 22 seconds to 1 second of wait when closing the lid.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F09%2F17%2Fslow-sleep-on-snow-leopard%2F&amp;linkname=Slow%20sleep%20on%20Snow%20Leopard"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/09/17/slow-sleep-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compiling TrueCrypt for Snow Leopard</title>
		<link>http://patrik.cqure.net/wordpress/2009/09/15/compiling-truecrypt-for-snow-leopard/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/09/15/compiling-truecrypt-for-snow-leopard/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 16:34:19 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Compile]]></category>
		<category><![CDATA[MacFUSE]]></category>
		<category><![CDATA[Snow Leopard]]></category>
		<category><![CDATA[TrueCrypt]]></category>
		<category><![CDATA[XCode]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=175</guid>
		<description><![CDATA[UPDATE 2009-10-22: Truecrypt 6.3 has been released, no need for this anymore
UPDATE 2009-09-18-2: Removed ref. to Fink as it requires to be built from source on Snow Leopard
UPDATE 2009-09-18: Added a missing requirement: pkg-config. See &#8220;installing pkg-config&#8221;
Unfortunately licensing issues prevent me from publishing my pre-compiled versions of TrueCrypt. So the next best thing I can [...]]]></description>
			<content:encoded><![CDATA[<p>UPDATE 2009-10-22: Truecrypt 6.3 has been released, no need for this anymore<br />
UPDATE 2009-09-18-2: Removed ref. to Fink as it requires to be built from source on Snow Leopard<br />
UPDATE 2009-09-18: Added a missing requirement: pkg-config. See &#8220;installing pkg-config&#8221;</p>
<p>Unfortunately licensing issues prevent me from publishing my pre-compiled versions of TrueCrypt. So the next best thing I can do until there&#8217;s a new version of TrueCrypt that supports Snow Leopard, is to publish a &#8220;simple&#8221; do it your self guide.</p>
<p>In order to compile TrueCrypt for Mac OS X Snow Leopard you need the following:</p>
<ol>
<li>XCode (it&#8217;s under the Optional folder on the Snow Leopard Install DVD)</li>
<li>macFUSE</li>
<li>TrueCrypt and wxWidgets source code</li>
<li>Header files from the RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20.</li>
<li>pkg-config</li>
<li>A patch that modifies the source code so it compiles under Snow Leopard.</li>
</ol>
<p><span id="more-175"></span></p>
<p><strong>Installing XCode</strong></p>
<p>Install XCode from the Snow Leopard installation DVD. This should be pretty straight forward and hopefully does not need any further explanation.</p>
<p><strong>Installing macFUSE</strong></p>
<p>Download and install macFUSE from here: <a href="http://code.google.com/p/macfuse">http://code.google.com/p/macfuse</a></p>
<p><strong>Installing pkg-config</strong></p>
<p>pkg-config can be installed either through MacPorts or through Fink. The difference is that MacPorts requires you to compile the source and Fink installs the binary version. I personally prefer Fink as it uses the debian package installer. Below you will find instructions for installing either through MacPorts. <span style="text-decoration: line-through;">OR Fink. Don&#8217;t do both!</span></p>
<p><span style="text-decoration: line-through;"><em>Installing pkg-config through Fink</em></span></p>
<ol>
<li><span style="text-decoration: line-through;">Get and install Fink 0.9 from here: <a href="http://www.finkproject.org/download/index.php?phpLang=en">http://www.finkproject.org/download/index.php?phpLang=en</a></span></li>
<li><span style="text-decoration: line-through;">Install pkgconfig by issuing the following command:<br />
</span><br />
<span style="text-decoration: line-through;">sudo apt-get update &amp;&amp; sudo apt-get install pkgconfig</span></li>
</ol>
<p><em>Installing pkg-config through MacPorts</em></p>
<ol>
<li> Get and install MacPorts from here: <a href="http://www.macports.org/install.php">http://www.macports.org/install.php</a></li>
<li>Install pkgconfig by issuing the following command:
<pre lang="bash">sudo port install pkgconfig</pre>
</li>
<li>Restart the Terminal application</li>
</ol>
<p><strong>Getting the TrueCrypt and wxWidgets source code</strong></p>
<p>Download the TrueCrypt source code (preferably the tar.gz version) from here: <a href="http://www.truecrypt.org/downloads2">http://www.truecrypt.org/downloads2</a></p>
<p>Open up a new Terminal window and create a new directory from where you will build TrueCrypt eg. $HOME/src:</p>
<pre lang="bash">mkdir $HOME/src</pre>
<p>Uncompress the downloaded file into the new directory:</p>
<pre lang="bash">cd $HOME/src; tar xvzf $HOME/Downloads/TrueCrypt\ 6.2a\ Source.tar.gz</pre>
<p>TrueCrypt uses the wxWidgets cross platform GUI library and therefore needs it to compile. Get it here:<br />
<a href="http://prdownloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.gz">http://prdownloads.sourceforge.net/wxwindows/wxMac-2.8.10.tar.gz</a></p>
<p>Uncompress the wxMac-2.8.10.tar.gz file into the $HOME/src directory using the following command:</p>
<pre lang="bash">cd $HOME/src; tar xvzf $HOME/Downloads/wxMac-2.8.10.tar.gz</pre>
<p>You should now have two directories in the $HOME/src directory truecrypt-6.2a-source and wxMac-2.8.10. You can verify this by running the following command:</p>
<pre lang="bash">ls $HOME/src</pre>
<p>In order to compile TrueCrypt for Snow Leopard the source code has to be patched slightly. I have prepared a patch file that can be applied to the code automatically using the patch utility. Download the patch from here: <a href="http://patrik.cqure.net/files/truecrypt-snow-leopard.patch">http://patrik.cqure.net/files/truecrypt-snow-leopard.patch</a></p>
<p>Apply the patch by running the following command:</p>
<pre lang="bash">cd $HOME/src; patch -p0 &lt; $HOME/Downloads/truecrypt-snow-leopard.patch</pre>
<p>You should see the following output:</p>
<blockquote><p>patching file truecrypt-6.2a-source/Main/FatalErrorHandler.cpp<br />
patching file truecrypt-6.2a-source/Main/StringFormatter.h<br />
patching file truecrypt-6.2a-source/Makefile<br />
Hunk #1 succeeded at 145 with fuzz 2.</p></blockquote>
<p>TrueCrypt also uses a number of header files from RSA Security Inc. PKCS #11 Cryptographic Token Interface (Cryptoki) 2.20. These have to be downloaded manually from here: <a href="http://ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20">ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20</a>. The files needed are pkcs11.h, pkcs11f.h and pkcs11t.h. They need to go into the directory $HOME/src/pkcs11. If your lazy you can run the following, which does this for you:</p>
<pre lang="bash">mkdir $HOME/src/pkcs11; cd $HOME/src/pkcs11; \
for f in pkcs11.h pkcs11f.h pkcs11t.h; do \
curl --no-epsv --ftp-pasv "ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-11/v2-20/${f}" &gt; ${f}; \
done</pre>
<p>Ok, so now we are all set with the source code and can begin compiling.</p>
<p><strong>Compiling TrueCrypt</strong></p>
<p>First of all we need to point out where our RSA Security pkcs stuff is located. You do this by issuing the following command in the Terminal:</p>
<pre lang="bash">export PKCS11_INC=$HOME/src/pkcs11</pre>
<p>Once this is done we can start to compile the wxWidgets by issuing the following command:</p>
<pre lang="bash">cd $HOME/src/truecrypt-6.2a-source; make WX_ROOT=$HOME/src/wxMac-2.8.10 wxbuild</pre>
<p>Compilation will take time and at times look as if it has stopped. Be patient and disregard any WARNINGS or error messages that you may see (there may be quite a few with different information!) If all went well you should now have a directory called $HOME/src/truecrypt-6.2a-source/wxrelease with 355 items in it. You can verify this by issuing the following command:</p>
<pre lang="bash">ls $HOME/src/truecrypt-6.2a-source/wxrelease | wc -l</pre>
<p>With the wxWidgets compiled we can now start compiling TrueCrypt by issuing the following command:</p>
<pre lang="bash">cd $HOME/src/truecrypt-6.2a-source; make WXSTATIC=1</pre>
<p>Again, compiling TrueCrypt will take some time but it should not return any errors. If all goes well, which it should if you have followed the guide properly, you should end up with a TrueCrypt.app folder under the Main directory. You can test whether the application works or not by running the following command:</p>
<pre lang="bash">open $HOME/src/truecrypt-6.2a-source/Main/TrueCrypt.app/</pre>
<p>If it starts, you&#8217;re all set and simply need to copy or move the application into /Applications as usual. From the Terminal you can do this by issuing the following command:</p>
<pre lang="bash">cp -R $HOME/src/truecrypt-6.2a-source/Main/TrueCrypt.app /Applications</pre>
<p>Good luck!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F09%2F15%2Fcompiling-truecrypt-for-snow-leopard%2F&amp;linkname=Compiling%20TrueCrypt%20for%20Snow%20Leopard"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/09/15/compiling-truecrypt-for-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Samba directories keep getting 755 permissions</title>
		<link>http://patrik.cqure.net/wordpress/2009/09/11/samba-directories-keep-getting-755-permissions/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/09/11/samba-directories-keep-getting-755-permissions/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 21:45:30 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[Directories]]></category>
		<category><![CDATA[Fail]]></category>
		<category><![CDATA[Incorrect]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[MAC]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Permissions]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=126</guid>
		<description><![CDATA[I just came across a really strange and *annoying* problem on one of our servers. A while ago I swapped my PC for a Macbook. Up until now I hadn&#8217;t noticed that all my files created on our common Samba server could not be modified by others. Once a colleague pointed this out I started [...]]]></description>
			<content:encoded><![CDATA[<p>I just came across a really strange and *annoying* problem on one of our servers. A while ago I swapped my PC for a Macbook. Up until now I hadn&#8217;t noticed that all my files created on our common Samba server could not be modified by others. Once a colleague pointed this out I started investigating the smb.conf file to figure out what was happening.</p>
<p>However, in the configuration file all looked fine and dandy: <strong>create mode</strong>, <strong>directory mode</strong> and <strong>inherit permissions</strong> were all still set. To make really sure I added some of the force options as well. Still, all folders were created with 0755 (drwxr-xr-x) permissions (I had it setup and expected 0750). I thought I was going nuts until I found some other articles outlining the exact same problems and pointing their finger at Mac OS X.</p>
<p><a href="http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg657971.html">http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg657971.html</a><br />
<a href="http://lists.samba.org/archive/samba/2009-June/148518.html">http://lists.samba.org/archive/samba/2009-June/148518.html</a></p>
<p>Apparently the servers incorrect setting of ACLs on the directories was due to the umask value on Mac OS X. Going through the article, I found that the following suggested settings fixed the problem for me.</p>
<p><strong>unix extensions = no<br />
force directory security mode = 0770</strong></p>
<p>Once setting unix extensions to <strong>no</strong>, I had to disconnect and re-connect to the server in order to access my files and from then all directories were created with the correct permissions.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F09%2F11%2Fsamba-directories-keep-getting-755-permissions%2F&amp;linkname=Samba%20directories%20keep%20getting%20755%20permissions"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/09/11/samba-directories-keep-getting-755-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox 2.2.0</title>
		<link>http://patrik.cqure.net/wordpress/2009/04/11/virtualbox-220/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/04/11/virtualbox-220/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 09:04:35 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[2.2.0]]></category>
		<category><![CDATA[host-only]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=120</guid>
		<description><![CDATA[Just had the time to install VirtualBox 2.2.0 on my Mac and I am looking forward to testing the new host-only mode which made it into this release. This is something I have been using for quite a while in order to setup a number of systems on isolated networks by using loopback tun-devices. The [...]]]></description>
			<content:encoded><![CDATA[<p>Just had the time to install VirtualBox 2.2.0 on my Mac and I am looking forward to testing the new host-only mode which made it into this release. This is something I have been using for quite a while in order to setup a number of systems on isolated networks by using loopback tun-devices. The new host-only mode should make this so much easier without the hassle of setting up dhcp etc. on the host system.</p>
<p>Some other cool features also made it into the release such as:</p>
<ul>
<li>OVF (Open Virtualization Format) appliance import and export</li>
<li>OpenGL 3D acceleration for Linux and Solaris guests</li>
</ul>
<p>The complete Changelog is here <a href="http://www.virtualbox.org/wiki/Changelog">http://www.virtualbox.org/wiki/Changelog</a></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F04%2F11%2Fvirtualbox-220%2F&amp;linkname=VirtualBox%202.2.0"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/04/11/virtualbox-220/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating VirtualBox from Linux to Mac</title>
		<link>http://patrik.cqure.net/wordpress/2009/04/04/migrating-virtualbox-from-linux-to-mac/</link>
		<comments>http://patrik.cqure.net/wordpress/2009/04/04/migrating-virtualbox-from-linux-to-mac/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 11:51:24 +0000</pubDate>
		<dc:creator>patrik</dc:creator>
				<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[coreaudio]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[machine]]></category>
		<category><![CDATA[migration]]></category>
		<category><![CDATA[virtualbox]]></category>

		<guid isPermaLink="false">http://patrik.cqure.net/wordpress/?p=114</guid>
		<description><![CDATA[So, I recently got myself a MacBook. So far I have been impressed with lot&#8217;s of things! And then there some stuff that I obviously have been less impressed with. One of these things has been the migration from the Linux version to the Mac OS X of VirtualBox 2.1.4. Maybe I was naive to [...]]]></description>
			<content:encoded><![CDATA[<p>So, I recently got myself a MacBook. So far I have been impressed with lot&#8217;s of things! And then there some stuff that I obviously have been less impressed with. One of these things has been the migration from the Linux version to the Mac OS X of VirtualBox 2.1.4. Maybe I was naive to start with, thinking that hey VirtualBox exists on Linux and it also exists on Mac, then it should be a matter of copying the files over and I should be up and running! Well, well, well it wasn&#8217;t quite that simple. Looking back, I could probably have made things a lot easyer by shutting down all machines instead of moving them in their saved state.</p>
<p><span id="more-114"></span></p>
<p>Copying the lot from Linux to Mac simply broke the whole VirtualBox installation which failed to start at all once the files were in place. I had expected some errors, however not total breakage. Simply creating new machine configurations and re-attaching the disks was out of the questions as most of my machines had several snapshots which I didn&#8217;t manage to reconnect to the new machine configuration. So I started to look for trouble in the old configuration files.</p>
<p>For starters several configuration files had absolute paths to disk files, dvd/cd images, snapshots etc. As my files now resided in different folders this had to be changed. I started modyfying the VirtualBox.xml by hand and finally made som quick search and replaces. I also took the chance to remove some older dvd/cd images which were no longer on the system. Oh and then there was the version attribute of the VirtualBox element that had to be changed from 1.6-linux to 1.6-macosx.</p>
<p>Then for each VirtualBox machine I had to open the Machines/&lt;machine name&gt;/&lt;machine name&gt;.xml file and first correct the version stuff from 1.6-linux to 1.6 macosx.  Ones this was done I needed to remove any cd/dvd images no longer accessible by the machine such as the installation dvd for the guest additions which was &#8220;left in the drive&#8221; for most machines. This was a matter of simply deleting the Image element between each DVDDrive element. Now the configuration was correct and the Machine could be loaded by the interface. For every machine that was in their saved state I hade to discard the state as the CPU did not match the one under which the image was saved. Once discarded the Machine could be opened by the VirtualBox interface where it was a matter of clicking through all the options to make sure they were correct. One option that needed to be changed for each machine was the audio configuration. In linux it was set to Pulse audio and in Mac OS X it needed to be CoreAudio. Also any old network interfaces no longer available, such as host interfaces pointing at interface names such as eth0, eth1 or any tun interface not present in the new system had to be corrected.</p>
<p>So with the configuration all changed both manually and in the GUI the Machine was good to go. Once corrected and started it all worked great and I was very happy with VirtualBox! It even works better than it did in Linux as so far I have had a lot less problems with machines in their saved state breaking and refusing to start because of image inconsistencies.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fpatrik.cqure.net%2Fwordpress%2F2009%2F04%2F04%2Fmigrating-virtualbox-from-linux-to-mac%2F&amp;linkname=Migrating%20VirtualBox%20from%20Linux%20to%20Mac"><img src="http://patrik.cqure.net/wordpress/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://patrik.cqure.net/wordpress/2009/04/04/migrating-virtualbox-from-linux-to-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
