<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<title type="text">CoffeeBreak</title>
	<subtitle type="text">CoffeeBreak:CoffeeBreak, the neverpanic.de blog</subtitle>
	<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/" />
	<link rel="self" type="application/atom+xml" href="http://www.neverpanic.de/blog/atom/" />
	<updated>2010-07-30T23:14:02Z</updated>
	<rights>Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Germany License</rights>
	<generator uri="http://expressionengine.com/" version="1.6.8">ExpressionEngine</generator>
	<id>tag:neverpanic.de,2010-07-30:/blog/</id>
	
	<entry>
		<title>whatthecommit.com git hook</title>
		<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/single/whatthecommit.com&#45;git&#45;hook/" />
		<id>tag:neverpanic.de,2010-07-03:/blog/single/whatthecommit.com-git-hook/#3.83</id>
		<published>2010-07-03T17:23:52Z</published>
		<updated>2010-07-03T17:36:53Z</updated>
		<author>
			<name>Clemens Lang</name>
			<email>neverpanic@gmail.com</email>
			<uri>http://www.neverpanic.de/about-me</uri>		</author>
		
			<category
				term="Development"
				scheme="/site/category/development/"
				label="Development" />
		
			<category
				term="Linux"
				scheme="/site/category/linux/"
				label="Linux" />
		<content type="html">
			<![CDATA[
				<p>I currently use <a href="http://gitscm.org/">Git</a> for most of my version control needs. I'm keeping all of my hand-ins for university under version control to be able to sync them between university and my laptop easily and to make it easy for others to contribute (and sometimes they actually do!). But those of you using version control systems know what the biggest problem with version control is: Thinking of a commit message. Wait no moar! The ultimate solution is here!</p>
<p><a href="http://whatthecommit.com/" title="a commit message generator">whatthecommit.com</a> is a website that provides you with a fresh commit message every time you load it. So all you have to do, is copy and paste the line into your commit window. Still too much work? That's why git comes with hook scripts. Paste the following code in <code>.git/hooks/prepare-commit-msg</code> in your working copy and make the file executable and you'll be provided with a wonderful commit message every time you type <code>git commit</code> automatically!
<pre class="bash" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># A hook script to prepare the commit log message.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># Called by &quot;git commit&quot; with the name of the file that has the</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># commit message, followed by the description of the commit</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># message's source.  The hook's purpose is to edit the commit</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># message file.  If the hook fails with a non-zero status,</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># the commit is aborted.</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$2,$3&quot;</span> <span style="color: #000000; font-weight: bold;">in</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        ,<span style="color: #000000; font-weight: bold;">|</span>template,<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #007800;">line</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>whatthecommit.com<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #660033;">-O</span> - <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">'&lt;p&gt;.*$'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'s/&lt;[^&gt;]*&gt;//g'</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #007800;">file</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">'1d'</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${line}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${file}</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>&quot;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000000; font-weight: bold;">;;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">;;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">esac</span></div></li></ol></pre></p> 
			]]>
		</content>
	</entry>
	
	<entry>
		<title>Subversion Property Copy</title>
		<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/single/subversion&#45;property&#45;copy/" />
		<id>tag:neverpanic.de,2009-02-15:/blog/single/subversion-property-copy/#3.73</id>
		<published>2009-02-15T22:03:04Z</published>
		<updated>2009-04-02T16:23:05Z</updated>
		<author>
			<name>Clemens Lang</name>
			<email>neverpanic@gmail.com</email>
			<uri>http://www.neverpanic.de/about-me</uri>		</author>
		
			<category
				term="Linux"
				scheme="/site/category/linux/"
				label="Linux" />
		<content type="html">
			<![CDATA[
				<p>Although there is a <a href="http://www.lachoseinteractive.net/en/community/subversion/svnx/features/" title="svnX (free)">couple</a> <a href="http://versionsapp.com/" title="Versions">of</a> <a href="http://www.zennaware.com/cornerstone/" title="Cornerstone">Subversion</a> <a href="http://zigversion.com/" title="ZigVersion (free for students)">GUI</a>s for Macs, I usually use the <abbr title="Command Line Interface">CLI</abbr>. I manage all source code I write during my studies using Subversion and usually add revision number and date of last checkin to the file using the <code>svn:keywords</code>-Property. However, I always forget the set of keywords I usually add: <code>Author Date Id Revision URL</code>. Unfortunately, there is no way to copy a property from one file to another in the standard subversion binary. There is, however, a little shortcut:<br />
<pre class="bash" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #007800;">$propertyName</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`svn propget $propertyName $fromFileName`</span>&quot;</span> <span style="color: #007800;">$toFileName</span></div></li></ol></pre><br />
Typing this monster isn&#8217;t any userfriendly at all, though – a little <code>.bashrc</code> magic does the trick:<br />
<pre class="bash" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># add svn propcopy</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000000; font-weight: bold;">function</span> <span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        pc<span style="color: #000000; font-weight: bold;">|</span>propcopy<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #007800;">propName</span>=<span style="color: #007800;">$2</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #007800;">fromFile</span>=<span style="color: #007800;">$3</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #7a0874; font-weight: bold;">shift</span> <span style="color: #000000;">3</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">`</span> propset <span style="color: #007800;">$propName</span> <span style="color: #ff0000;">&quot;<span style="color: #780078;">`\`</span>which svn\<span style="color: #780078;">` propget $propName $fromFile`</span>&quot;</span> $<span style="color: #000000; font-weight: bold;">@</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000000; font-weight: bold;">;;</span></div></li><li style="font-weight: bold; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">which</span> <span style="color: #c20cb9; font-weight: bold;">svn</span><span style="color: #000000; font-weight: bold;">`</span> $<span style="color: #000000; font-weight: bold;">@</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #000000; font-weight: bold;">;;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #000000; font-weight: bold;">esac</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#125;</span></div></li></ol></pre></p>

<p><strong>Update</strong>: Thanks to <a href="http://raim.codingfarm.de/" title="Rainer Müller">Raim</a> for the wildcard support. Using subversion auto-props is an option for files, but unfortunately, <a href="http://subversion.tigris.org/issues/show_bug.cgi?id=1989" title="issue 1989 on auto-props on directories">auto-props don&#8217;t work on directories</a> yet.
</p> 
			]]>
		</content>
	</entry>
	
	<entry>
		<title>A Friday 13th story</title>
		<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/single/a&#45;friday&#45;13th&#45;story/" />
		<id>tag:neverpanic.de,2009-02-14:/blog/single/a-friday-13th-story/#3.72</id>
		<published>2009-02-14T14:32:36Z</published>
		<updated>2009-02-16T13:01:37Z</updated>
		<author>
			<name>Clemens Lang</name>
			<email>neverpanic@gmail.com</email>
			<uri>http://www.neverpanic.de/about-me</uri>		</author>
		
			<category
				term="Internal"
				scheme="/site/category/internal/"
				label="Internal" />
		
			<category
				term="Linux"
				scheme="/site/category/linux/"
				label="Linux" />
		<content type="html">
			<![CDATA[
				<p>This site is served by my own virtual server hosted by Carrot Servers in Austria. The hardware nodes running their servers are housed in one of Germany&#8217;s largest hosting company&#8217;s datacenters. However, three of their datacenters recently suffered from a power loss because of a defunct uninterruptible power source and a series of other unfortunate problems – a little over 12,000 servers were without power for a few hours.<br />
However, it seems my vServer&#8217;s hardware node was damaged by the power loss; one of the hard disk drives in the RAID array was replaced after the outage. Yesterday, the worst-case scenario came true: besides the hard disks, apparently the motherboard was also damaged causing the RAID controller to slowly corrupt the data on the drives. On Friday, 13<sup>th</sup>, my provider informed me data had been lost and the server will be swapped with a new machine.<br />
Luckily, I did remember creating backup – and it happened to be a recent one (namely from Thursday, 12<sup>th</sup>). But as Murphy&#8217;s law states, things never work the way you expect them to work. In this case that meant that permissions were incorrect on the backup although I used rsync with the appropriate preserve-permissions option. I&#8217;ve thus been busy reinstalling the software, uploading the files and databases and fixing their permission. As of now, all data has been successfully restored (blessing in disguise) and I&#8217;m supervising the server&#8217;s functions.
</p> 
			]]>
		</content>
	</entry>
	
	<entry>
		<title>Backup a Linux server to a Windows PC while preserving user, group and permissions</title>
		<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/single/backup&#45;linux&#45;server&#45;to&#45;windows&#45;pc&#45;preserving&#45;user&#45;group&#45;permissions/" />
		<id>tag:neverpanic.de,2008-08-24:/blog/single/backup-linux-server-to-windows-pc-preserving-user-group-permissions/#3.66</id>
		<published>2008-08-24T21:32:44Z</published>
		<updated>2008-12-25T17:48:45Z</updated>
		<author>
			<name>Clemens Lang</name>
			<email>neverpanic@gmail.com</email>
			<uri>http://www.neverpanic.de/about-me</uri>		</author>
		
			<category
				term="Linux"
				scheme="/site/category/linux/"
				label="Linux" />
		<content type="html">
			<![CDATA[
				<p>
 I moved my sites to a new virtual server at <a href="http://carrot-server.com/">Carrot Server</a>. Their offer is (imho) better than the one over at <a href="http://www.hosteurope.de/">HostEurope</a>, however there are some downsides: they don't have a rescue system yet (you better watch your step!) and there's no backup included.
</p>
<p>
 I can live without the rescue system, but no backup? <strong>No way</strong>.
</p>
<p>
 Since I don't have a dedicated Linux box around at home, I needed to store the backup on my Windows PC. There's a problem with storing files from a Unix system on Windows though: You'll lose the owner, group and permission data for the files, since the file systems supported by Windows can't store this information. A backup without this metadata is useless, though.
</p>
<h3>Finding a solution</h3>
<p>
 Some kind of container solution was needed. Tar archives support Unix permissions, however packing all files into a huge tar file would require transferring all data on every backup run. My internet connection at home is not T1, so transferring all data every time I do a backup is probably not a good idea (and it's perfectly useless, too).
</p>
<p>
 There's <code>rsync</code> — the state-of-the-art tool to transfer only the changes (yes, changes, not only changed files; very useful if you have some multiple GB files around). So combining rsync and tar seems the way to go.
</p>
<p>
 I could have packed all files into a huge tarball and rsynced it to my PC (effectively only tranferring the changes), but that would mean the tarball would need to be stored at the server (at least temporarily). Now imagine the disk is 95% full and you're trying to pack the whole filesystem — we have a problem here.
</p>
<p>
 Fortunately I'm not the first one facing this problem: <a href="http://ttsiodras.googlepages.com/index.html">Thanassis Tsiodras</a> outlines a way to <a href="http://ttsiodras.googlepages.com/backup.html">backup your Linux server preserving permissions to a Windows PC</a> using a loop-mounted file system on a Samba share.<br />
 This technique would require a Linux box, though. Bummer! (If I had a Linux box around, I'd backup to it directly).
</p>

 <h3>Setting it up</h3>
<p>
 So I went with Virtualization: I remember having an old version of Parallels Workstation (now VMware Workstation) laying around. This should do the job. I installed a minimalistic Debian Etch in a virtual machine. The virtualization software supports folder sharing with the host operating system after installing some kernel extensions. Sounds good for my needs. Installed the kernel modules (I had to compile them, since there were none pre-built for my kernel), added a shared folder and found it in /mnt/hgfs/backup/.
</p>
<p>
 <code>#cd /mnt/hgfs/backup/</code> followed by<br />
 <code>#dd if=/dev/zero of=destinationfilename bs=1M count=1 seek=150000</code><br />provided me with a 15GB file full of zeroes to put my file system to. Notice the seek parameter; on file systems supporting sparse files (NTFS does, FAT32 does not) it prevents physically writing 15GB of junk to the disk, but will instead create a file that only looks like it was 15GB. Physically this file is only a couple of KB large. If you need more than 15GB, adjust the seek parameter. Basically the block size (bs) times the seek parameter equals the size of your file system.<br />
 Next I mounted the file to a loopback device:<br />
 <code>#losetup -f /mnt/hgfs/backup/destinationfilename</code><br />
 -f will tell losetup to use the next free loop device and print it's name to stdout.<br />
 Now I had to create a file system on the loopback device. You can chose whatever filesystem you think is best, I went with ext3:<br />
 <code>#mkfs -t ext3 /dev/loop0</code><br />
 Make sure to substitute <code>/dev/loop0</code> with the device <code>losetup</code> printed after mounting.<br />
 Finally, I mounted the file system by executing<br />
 <code>#mount -t ext3 /dev/loop0 /media/backup</code>.<br />
 In this case the device /dev/loop0 is mounted to /media/backup (the folder needs to be created before) using the ext3 filesystem driver.
</p>
<h3>Make it stick</h3>
<p>
 You wouldn't want to execute <code>losetup</code> and <code>mount</code> every time you start the system, so here's what you need to add to <code>/etc/fstab</code> to have the file mounted automatically on startup:
 <pre>/mnt/hgfs/backup/destinationfilename /media/backup ext3 loop,defaults 0 0</pre>
</p>
<h3>Backup</h3>
<p>
 Finally you need to use rsync to backup the files. I wrote a small shell script for my needs:
<pre class="bash" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># make sure we're in ~; adjust this, if you want your rsync-backup.err file to be elsewhere</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">cd</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># remove old log file. you could use logrotate for this, if you want to do it right</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> rsync-backup.err.gz <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-f</span> rsync-backup.err.gz</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># gzip existing log file</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> rsync-backup.err <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #c20cb9; font-weight: bold;">gzip</span> rsync-backup.err</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #666666; font-style: italic;"># do the rsync; this will sync remote /* to /media/backup</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">rsync <span style="color: #660033;">--delete</span> avze <span style="color: #c20cb9; font-weight: bold;">ssh</span> servername:<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>media<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span>rsync-backup.err</div></li></ol></pre>
</p>
<p>
 You might ask why I didn't backup to the disk of the virtual machine directly. Doing it this way allows me to exchange the virtual machine without the data getting lost (the machine could even refuse to boot, and the data would still be there).
</p>
			]]>
		</content>
	</entry>
	
	<entry>
		<title>Updating my Ubuntu Backup OS</title>
		<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/single/updating&#45;my&#45;ubuntu&#45;backup&#45;os/" />
		<id>tag:neverpanic.de,2007-10-18:/blog/single/updating-my-ubuntu-backup-os/#3.43</id>
		<published>2007-10-18T20:52:00Z</published>
		<updated>2007-10-19T13:00:53Z</updated>
		<author>
			<name>Clemens Lang</name>
			<email>neverpanic@gmail.com</email>
			<uri>http://www.neverpanic.de/about-me</uri>		</author>
		
			<category
				term="Linux"
				scheme="/site/category/linux/"
				label="Linux" />
		<content type="html">
			<![CDATA[
				<p>I always keep a Linux system on a separate hard disk. This is quite important for me, as it&#8217;s my only sheet anchor when I mess up my Windows installation or my hard disk crashes. This Linux system is a clean Ubuntu 7.04 Feisty Fawn with some Compiz desktop effects from a 3<sup>rd</sup>-party-repository - no need for special software here, as I hardly use the system at all and Ubuntu comes with almost everything you usually need.</p>

<p>So Ubuntu 7.10, codename &#8220;Gutsy Gibbon&#8221; was released today, and as I always like to live at the edge, I thought I&#8217;d upgrade - well, at least I tried. The update manager stopped responding multiple times when trying to download the updater script. A quick Google search, let&#8217;s see how the servers do this&#8230; there&#8217;s a command-line tool called do-release-upgrade, maybe this one is more stable?<br />
First it seemed it was not, since it took about 5 minutes just to find that there&#8217;s an upgrade, but it did the job or at least does it until now, and I&#8217;m already at downloading packages. At the moment of writing, I&#8217;m downloading libcroco3 (whatever this is - funny name, though).</p>

<p>New post will follow once the system is running Gutsy Gibbon.
</p> 
			]]>
		</content>
	</entry>
	
	<entry>
		<title>Experiences with ClipShare Pro 2.0</title>
		<link rel="alternate" type="text/html" href="http://www.neverpanic.de/blog/single/experiences&#45;with&#45;clipshare&#45;pro&#45;20/" />
		<id>tag:neverpanic.de,2007-10-14:/blog/single/experiences-with-clipshare-pro-20/#3.38</id>
		<published>2007-10-14T12:48:00Z</published>
		<updated>2008-02-03T13:42:02Z</updated>
		<author>
			<name>Clemens Lang</name>
			<email>neverpanic@gmail.com</email>
			<uri>http://www.neverpanic.de/about-me</uri>		</author>
		
			<category
				term="Linux"
				scheme="/site/category/linux/"
				label="Linux" />
		
			<category
				term="Web Development"
				scheme="/site/category/web-development/"
				label="Web Development" />
		
			<category
				term="PHP"
				scheme="/site/category/php/"
				label="PHP" />
		
			<category
				term="XHTML &amp; CSS"
				scheme="/site/category/xhtml-css/"
				label="XHTML &amp; CSS" />
		<content type="html">
			<![CDATA[
				<h3>Requirements</h3><p>
All of the scripts are based on PHP and MySQL - there might be other solutions out there, but since my clients all had the traditional LAMP setup I didn&#8217;t bother searching for alternatives.<br />
For encoding, all of the scripts named use the same combination of <a href="http://www.mplayerhq.hu/" title="MEncoder, the encoder packaged with MPlayer">MEncoder</a>, <a href="http://ffmpeg.mplayerhq.hu/" title="ffmpeg">ffmpeg</a> to support the Flash video format, the <a href="http://ffmpeg-$php$.sourceforge.net/" title="ffmpeg $PHP$ extension">ffmpeg PHP extension</a> and <a href="http://www.inlet-media.de/flvtool2" title="FLVTool2">FLVTool2</a>.<br />
Installing these software packages isn&#8217;t that hard unless you&#8217;re on something different than a .deb-based Linux system: The Debian multimedia repository provided me with the MEncoder and FFmpeg packages, I installed Ruby to run FLVTool2 (which is a Ruby script) and installed ffmpeg-php from <a href="http://deb.atomo64.puffinhost.com/" title="Atomo64's Debian Repository">Atomo64&#8217;s Debian Repository</a> (thanks to Raphaël for this one).<br />
If you&#8217;re on another system, you might end up with a lot of compiling, though.<br />
Once you got all these things in place and made sure your php.ini settings allow the <a href="http://de2.php.net/manual/de/function.exec.php" title="PHP exec() function">exec()</a>, <a href="http://de2.php.net/manual/de/function.shell-exec.php" title="PHP shell_exec() function">shell_exec()</a> and <a href="http://de2.php.net/manual/de/function.system.php" title="PHP system() function">system()</a> functions you can start doing the real installataion.
</p> <h3>Installing</h3><p>
<em>This article will just contain the review of ClipShare, PHPmotion will follow later, so stay tuned.</em><br />
To install ClipShare, you&#8217;ll have to import a SQL file into your database using phpMyAdmin, open some files and adjust some variables. Not easy, however not that difficult, either. Luckily they have an installation service for their customers, so you can get the software installed for you. These guys at the installation service will, however, compile the software on your server (why don&#8217;t they just use an .rpm or .deb package - what about updating that software?) and they don&#8217;t seem to be that smart either. They couldn&#8217;t fix some weird issue my client had and after some debugging I found safe_mode for PHP-CLI to be turned on. This is something I expect them to check for - they get paid for that!
</p><h3>Customizing</h3><p>
ClipShare comes with a template engine, so you can achieve any design you can imagine. However if you just want to adjust the design that came with ClipShare (speaking of version 2.0, there&#8217;s a table-free CSS design coming with version 2.5) this is where you undergo a web developer&#8217;s nightmare. table-deserts as far as your screen is big, mixed with some invalid attribute notation (e.g. width=450), &#8220;borders&#8221; are colored td-elements. Long story short, their HTML code is evil.<br />
Now you might say, that&#8217;s version 2.0, you said earlier they released 2.5 with a CSS-based template. Well, check it out at <a href="http://www.clipsharedemo.com/">http://www.clipsharedemo.com/</a> - it comes with a little 864 validation errors and 13 external JavaScripts plus some neat inline JavaScript. It&#8217;s clearly a step in the right direction, but it&#8217;s not better than the table-based design they had before.</p>

<p>ClipShare&#8217;s PHP code is completely editable, which is certainly a pro - however, you might end up adding some code yourself: My client wanted the user avatar to be displayed in the sidebar of a single-video page (like YouTube does it). ClipShare doesn&#8217;t come with this data per default or at least I couldn&#8217;t find it since there&#8217;s no documentation to check, so I had to get it from the database myself.</p>

<h3>Summary</h3><p>
Overall, ClipShare does it&#8217;s job, however there&#8217;s quite a lot of room for improvements at the installation service, the templates and the documentation.
</p>
			]]>
		</content>
	</entry>
	
</feed>