<?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>Capi's Corner &#187; howto</title>
	<atom:link href="http://www.dont-panic.cc/capi/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dont-panic.cc/capi</link>
	<description>Development, Network, Security, Ideas &#038; Opinions</description>
	<lastBuildDate>Fri, 19 Feb 2010 00:11:10 +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>Novatel Merlin U740 using only Windows 7 onboard tools</title>
		<link>http://www.dont-panic.cc/capi/2009/11/19/novatel-merlin-u740-using-only-windows-7-onboard-tools/</link>
		<comments>http://www.dont-panic.cc/capi/2009/11/19/novatel-merlin-u740-using-only-windows-7-onboard-tools/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 00:32:11 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[computer]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[dial-up]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[merlin u740]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/?p=257</guid>
		<description><![CDATA[I have lost the install CD of my Novatel Merlin U740, an older PCMCIA UMTS card. As a consequence I got no &#8220;Mobilink Connection Manager&#8221; after installing Windows 7 on my notebook. Fortunately I found this guide by Novatel Wireless which explains how to connect using only on-board tools in Windows Vista, by setting up [...]]]></description>
			<content:encoded><![CDATA[<p>I have lost the install CD of my <a href="http://www.novatelwireless.com/">Novatel</a> <a href="http://www.3g.co.uk/PR/June2006/3209.htm">Merlin U740</a>, an older PCMCIA UMTS card. As a consequence I got no &#8220;Mobilink Connection Manager&#8221; after installing <a href="http://www.windows7.com/">Windows 7</a> on my notebook. Fortunately I found<a href="http://www.novatelwireless.com/files/UMTS%20-%20Creating%20Vista%20DUN%20Connection.pdf"> this guide</a> by Novatel Wireless which explains how to connect using only on-board tools in Windows Vista, by setting up a dial-up connection. It still works in Windows 7. The important part is to set the APN as part of the driver&#8217;s initialization string.</p>
<p>The telephone number you have to set is <code>*99#</code>, which should be provider-independent.</p>
<p>The following settings are for <a href="http://yesss.at">yesss.at</a> only:<br />
Username: <code>web</code><br />
Passwort: <code>web</code></p>
<p>Remember to set the APN as part of the driver&#8217;s connection string in Window&#8217;s &#8220;Device Manager&#8221; as described in the PDF.</p>
<p>Again, for <a href="http://www.yesss.at">yesss.at</a> this is: <code>AT+CGDCONT=1,"IP","web.yesss.at"</code></p>
<p>For this to work properly, the SIM must not have a PIN set, as otherwise the SIM will be locked and the dialer cannot dial out. For me this is ok, as it is a pre-paid card which can hardly be abused if it gets stolen, but your situation might be different, so please consider the security implications. (I suspect that it should be possible to unlock the SIM card somehow using the <code>AT+CPIN=1234</code> command, but I did not research how to separate several initialization strings, as it did not work immediately.)</p>
<p>The solution works quite well for me, even under Windows 7. Disadvantage is that there is no way to tell the signal strength and exact mode of operation (despite the color-coded status led on the Merlin U740).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2009/11/19/novatel-merlin-u740-using-only-windows-7-onboard-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing and Synchronizing Data Across Multiple Computers</title>
		<link>http://www.dont-panic.cc/capi/2007/07/04/sharing-and-synchronizing-data-across-multiple-computers/</link>
		<comments>http://www.dont-panic.cc/capi/2007/07/04/sharing-and-synchronizing-data-across-multiple-computers/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 19:53:48 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[synchronization]]></category>
		<category><![CDATA[unison]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/07/04/sharing-and-synchronizing-data-across-multiple-computers/</guid>
		<description><![CDATA[I have several computers, one at the office (Windows Vista), one at home (Gentoo Linux), and one notebook (Windows XP). On most of them I want to share a common set of files, including letters and other documents, but also Miranda. This time I am going to tell you how I keep my shared data [...]]]></description>
			<content:encoded><![CDATA[<p>I have several computers, one at the office (<a href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows Vista</a>), one at home (<a href="http://www.gentoo.org">Gentoo Linux</a>), and one notebook (<a href="http://en.wikipedia.org/wiki/Microsoft_Windows">Windows XP</a>). On most of them I want to share a common set of files, including letters and other documents, but also Miranda. This time I am going to tell you how I keep my shared data in sync using <a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison</a>, <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a>, and <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">OpenSSH</a>, using a dedicated server as central hub.</p>
<p>(Note: this is a rather advisory level HOWTO, not a step-by-step, command-by-command tutorial. It might give you some ideas nevertheless.)</p>
<p><span id="more-64"></span></p>
<p>This version of my synchronization solution is based on a central dedicated server on which you can install Unison and login via SSH using public key authentication. You can also do the same with an external media, like an USB-Stick, but there you could use the external media directly without syncing. I would recommend using synching even in this case, as Flash-based media like most USB memory sticks only have limited write cycles. Additionally, if you use synching, you get some redundancy (I wouldn&#8217;t go as far as call it &#8220;backup&#8221;) in case one of your storage devices fails.</p>
<p><strong>Step 1 &#8211; Preparation</strong></p>
<p><a href="http://www.cis.upenn.edu/~bcpierce/unison/">Unison</a> is one of my favorite two-way synchronization tools. It works by keeping a database for every replica, so it can detect new, modified, and deleted files. The program was originally target at Linux, but there is a client for Windows as well, which works well. Its major advantage in my opinion is that it uses the <a href="http://en.wikipedia.org/wiki/Rsync">rsync</a>-protocol for transferring the data, which keeps the ordinary synchronization bandwidth reasonably small.</p>
<p>You have to install Unison on every client that is going to participate. <em>Important: you need to install the same version for every peer!</em></p>
<p><strong>Step 2 &#8211; The Central Hub<br />
</strong></p>
<p>Then you need the central server. I am using a Gentoo-based dedicates server at <a href="http://www.hetzner.de">Hetzner</a>. You don&#8217;t need a real server, but it must be an &#8220;always-on&#8221;, always reachable computer. It could be your gateway at home, but keep in mind you need to contact the host. Consider using <a href="http://de.wikipedia.org/wiki/DynDNS">DynDNS</a> or similar services if you don&#8217;t have a static IP for the box. The server can even be one of the target computers, but as mentioned, it needs to be reachable via the Internet for the other sync-partners.</p>
<p>I created a dm_crypt encrypted partition of 1GB size and mounted it at /home/martin/shared. The 1GB size is enough for me, in fact, the shared data is around 100MB. I am sharing data, not programs or (large) multimedia files.</p>
<p><strong>Step 3 &#8211; Configuring a Linux Peer<br />
</strong></p>
<p>Configuration of a Linux peer is the easier than configuration of a Windows peer, that&#8217;s why I am starting with this. First you need to create a SSH-key which will be used for authentication if you don&#8217;t already have one. Unison needs to be able to login via SSH without user interaction, still I do not recommend to create a key without passphrase. Protect the key with a passphrase, but use something like <a href="http://www.gentoo.org/proj/en/keychain/">keychain</a> to authenticate only once against the key before starting your synchronization.</p>
<p>You need to add the key to the ~/.ssh/authorized_keys2 file <em>at the central hub</em>. Ensure you can now login as the desired user using ssh <em>without a password prompt</em>.</p>
<p>Once SSH is working, you can create a profile for unsion, like my <em>shared.prf</em>:</p>
<blockquote><p><code>root = /home/martin<br />
root = ssh://martin@&lt;server&gt;//home/martin<br />
path = shared<br />
ignore = Path {shared/local}</code></p></blockquote>
<p>This profile synchronizes the ~/shared/ directory to the central hub&#8217;s ~/shared/ directory, ignoring anything at ~/shared/local, which gives you the easy possibility to exclude some of your files from synchronization.</p>
<p>That&#8217;s it, you can now synchronize the Linux host to the central hub. Do this anytime you quit working with the computer to prevent conflicts due to concurrent modifications on different workstations.</p>
<p><strong>Step 4 &#8211; Configuring a Windows Peer</strong></p>
<p>Windows configuration is a little bit different (but not much). First I create a <a href="http://www.truecrypt.org/">TrueCrypt</a> volume of the desired size. I like to have all shared folders at the same location, just out of habit. So I mount them all at S:\ and create a #shared subdirectory, which is going to contain the shared files. (Using TrueCrypt is entirely optional and not required, I just want to make it thieves a little bit harder to read my personal data.)</p>
<p>Then you need to have <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a> (including plink and (advisable) pageant). Create a key and add it to the central hub&#8217;s ~/.ssh/authorized_keys2 files. I again advise against keys without password. Use pageant to cache the credentials for synchronization.</p>
<p>The Unison profile needs to be different for Windows, as you need to convince Unison to use PuTTY instead of ssh. Therefore a small batch-script is required, I call it <code>launcher_server.cmd</code> (containing just one line, remove the word wrap):</p>
<blockquote style="text-align: left"><p><code>@"C:\Program Files\PuTTY\plink.exe" -i "S:\putty-key.ppk" martin@my.server.domain unison -server</code></p></blockquote>
<p>Make sure the connection is able to login without further authentication.</p>
<p>The <code>shared.prf</code> needs to be a little bit different here:</p>
<blockquote><p><code>root = S:/#shared<br />
root = ssh://martin@&lt;server&gt;//home/martin<br />
sshcmd = S:/Program Files/Unison/launcher_server.cmd<br />
fastcheck = true<br />
path = shared<br />
ignore = Path {shared/local}</code></p></blockquote>
<p>(Note: the &#8220;fastcheck&#8221; attribute is optional, but I recommend using it on Windows, but see the <a href="http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#fastcheck">Unison documentation</a> for further infos before using it!)</p>
<p><strong> Step 5 &#8211; Synchronize</strong></p>
<p>After you have set up all the hosts you want to participate, simply use it. Use keychain and pageant to ensure you don&#8217;t need a password for login at the central hub.  You should synchronize whenever you log off or shut down a workstation, to ensure there will be as little conflicts as possible. As long as you don&#8217;t create conflicts, even concurrent modifications can be handled automatically.</p>
<p>And now, have fun and enjoy working with a consistent dataset over multiple computers. <img src='http://www.dont-panic.cc/capi/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/07/04/sharing-and-synchronizing-data-across-multiple-computers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpMyAdmin with mod_fcgid</title>
		<link>http://www.dont-panic.cc/capi/2007/01/22/phpmyadmin-with-mod_fcgid/</link>
		<comments>http://www.dont-panic.cc/capi/2007/01/22/phpmyadmin-with-mod_fcgid/#comments</comments>
		<pubDate>Sun, 21 Jan 2007 23:07:44 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mod_fcgid]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/2007/01/22/phpmyadmin-with-mod_fcgid/</guid>
		<description><![CDATA[I am currently migrating my server configuration away from mod_php towards mod_fcgid (the successor of mod_fastcgi), as this allows me to use different users for executing scripts in different directories. I use this to have every hosted virtual domain using its own system user. This should (in theory) prevent one buggy application to take over [...]]]></description>
			<content:encoded><![CDATA[<p>I am currently migrating my server configuration away from mod_php towards <a href="http://fastcgi.coremail.cn/">mod_fcgid</a> (the successor of mod_fastcgi), as this allows me to use different users for executing scripts in different directories. I use this to have every hosted virtual domain using its own system user. This should (in theory) prevent one buggy application to take over all other hosted domains as well.</p>
<p>I though faced one problem: I could not get <a href="http://www.phpmyadmin.net">phpMyAdmin</a> working and this was a requirement of one of my clients. phpMyAdmin kept popping up the authentication dialog over and over again when using HTTP Basic Authentication.</p>
<p>After searching some time, I noticed that, when using PHP in CGI mode, the authentication data is not passed over to the script by default. A <a href="http://wiki.cihar.com/pma/FAQ_1.35">FAQ entry</a> of phpMyAdmin brought the solution to this issue: a ReWrite Rule was needed for the directory containing phpMyAdmin:</p>
<blockquote style="text-align: left; white-space: pre; font-size: 9px"><p><code>RewriteEngine On<br />
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]</code></p></blockquote>
<p>Suddenly phpMyAdmin worked <img src='http://www.dont-panic.cc/capi/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2007/01/22/phpmyadmin-with-mod_fcgid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Increasing Performance of VMWare Virtual Machines on External Devices</title>
		<link>http://www.dont-panic.cc/capi/2006/04/23/increasing-performance-of-vmware-on-external-devices/</link>
		<comments>http://www.dont-panic.cc/capi/2006/04/23/increasing-performance-of-vmware-on-external-devices/#comments</comments>
		<pubDate>Sun, 23 Apr 2006 19:27:21 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[external-device]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[tuning]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/archives/36</guid>
		<description><![CDATA[By default, VMware Workstation 5.x use a memory mapped file for backing the RAM of the simulated machines. This eases the pressure on the system&#8217;s page file. If you host the virtual machine on an external drive, however, this can become a bottle neck, especially if the external device is slow (e.g. USB 1.1, flash, [...]]]></description>
			<content:encoded><![CDATA[<p>By default, <a href="http://www.vmware.com">VMware</a> Workstation 5.x use a memory mapped file for backing the RAM of the simulated machines. This eases the pressure on the system&#8217;s page file. If you host the virtual machine on an external drive, however, this can become a bottle neck, especially if the external device is slow (e.g. USB 1.1, flash, etc.).</p>
<p>As described in this <a href="http://www.vmware.com/support/kb/enduser/std_adp.php?p_sid=x8NVkM5i&#038;p_lva=&#038;p_faqid=1620&#038;p_created=1112131543&#038;p_sp=cF9zcmNoPTEmcF9ncmlkc29ydD0mcF9yb3dfY250PTUwJnBfc2VhcmNoX3RleHQ9c2xvdyBleHRlcm5hbCZwX3NlYXJjaF90eXBlPTcmcF9wcm9kX2x2bDE9fmFueX4mcF9wcm9kX2x2bDI9fmFueX4mcF9zb3J0X2J5PWRmbHQmcF9wYWdlPTE*&#038;p_li=">VMware Knowledge Base Article</a>, you can turn of VMWare&#8217;s behaviour to use a memory mapped file and force it to use the system&#8217;s paging mechanism instead. To do so, you just have to add</p>
<blockquote><p><code>mainMem.useNamedFile=FALSE</code></p></blockquote>
<p>to your virtual machine&#8217;s configuration file (.vmx).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2006/04/23/increasing-performance-of-vmware-on-external-devices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache: Force SSL for a Directory Using .htaccess and mod_rewrite</title>
		<link>http://www.dont-panic.cc/capi/2005/12/12/apache-force-ssl-for-a-directory-using-htaccess-and-mod_rewrite/</link>
		<comments>http://www.dont-panic.cc/capi/2005/12/12/apache-force-ssl-for-a-directory-using-htaccess-and-mod_rewrite/#comments</comments>
		<pubDate>Mon, 12 Dec 2005 17:34:44 +0000</pubDate>
		<dc:creator>Martin Carpella</dc:creator>
				<category><![CDATA[internet]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://www.dont-panic.cc/capi/?p=26</guid>
		<description><![CDATA[To force SSL on a given directory using .htaccess, use the following code. It requires mod_rewrite enabled in Apache. Adjust the path in the RewriteRule to match the full qualified URL of the HTTPS-domain. RewriteEngine On RewriteCond %{SERVER_PORT} !443 RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]]]></description>
			<content:encoded><![CDATA[<p>To force SSL on a given directory using .htaccess, use the following code. It requires mod_rewrite enabled in Apache. Adjust the path in the RewriteRule to match the full qualified URL of the HTTPS-domain.</p>
<blockquote><p><code><br />
RewriteEngine On<br />
RewriteCond %{SERVER_PORT} !443<br />
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.dont-panic.cc/capi/2005/12/12/apache-force-ssl-for-a-directory-using-htaccess-and-mod_rewrite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
