<?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>silef.de</title>
	<atom:link href="http://www.silef.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.silef.de</link>
	<description></description>
	<lastBuildDate>Wed, 10 Aug 2011 18:14:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Recursive Duplicate Finder</title>
		<link>http://www.silef.de/2011/01/14/recursive-duplicate-finder/</link>
		<comments>http://www.silef.de/2011/01/14/recursive-duplicate-finder/#comments</comments>
		<pubDate>Fri, 14 Jan 2011 08:55:06 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=65</guid>
		<description><![CDATA[Recently I needed quickly a tool which compares two directories file by file and delete duplicate copies on one side. So it checks the source directory with the copy directory file by file. Each file is compared by inode, size and md5sum. If the source file and the copy file have the same md5 hash [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed quickly a tool which compares two directories file by file and delete duplicate copies on one side. So it checks the source directory with the copy directory file by file. Each file is compared by inode, size and md5sum. If the source file and the copy file have the same md5 hash value (but not the same inode) the file copy could be deleted via the -d parameter or moved with the -m parameter.<br />
At the beginning I found <a href="http://www.pixelbeat.org/fslint">fslint</a> which was to fancy for this task. And at the end of this blog post I found <a href="http://linux.die.net/man/1/fdupes">fdupes</a> which seems to do exactly what I needed. I love YAGN programming <img src='http://www.silef.de/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># dupremover - Recursive Duplicate Remover</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># (c) 2011 by Sebastian Felis</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You are free to use, modify, restribute without warranty while keeping it</span>
<span style="color: #666666; font-style: italic;"># free of charge. It would be nice to get an feedback note if you are using it.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># History</span>
<span style="color: #666666; font-style: italic;"># 2011-01-14 Initial Version</span>
<span style="color: #666666; font-style: italic;">#</span>
&nbsp;
<span style="color: #007800;">SCRIPT</span>=<span style="color: #ff0000;">&quot;$0&quot;</span>
<span style="color: #007800;">SRC</span>=
<span style="color: #007800;">COPY</span>=
<span style="color: #007800;">LOGLEVEL</span>=<span style="color: #000000;">0</span> <span style="color: #666666; font-style: italic;"># 2 DEBUG, 1 VERBOSE, 0 INFO, -1 WARN, -2 ERR</span>
<span style="color: #007800;">DELETE</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">DELETE_HARDLINK</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">MOVE</span>=<span style="color: #000000;">0</span>
<span style="color: #007800;">MOVEDST</span>=<span style="color: #ff0000;">&quot;.dupremover&quot;</span>
<span style="color: #007800;">TRY</span>=<span style="color: #000000;">0</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">help</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>
  <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(basename &quot;$SCRIPT&quot;)</span> [OPTIONS] SRC COPY
&nbsp;
Compares files of SRC directory with COPY directory recursivly via md5sum and
deletes or moves duplicated files of the COPY directory.
&nbsp;
<span style="color: #000099; font-weight: bold;">\t</span>-d|--delete
<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Delete the copy file
<span style="color: #000099; font-weight: bold;">\t</span>-m|--move
<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Moves the copy file to SRC/<span style="color: #007800;">$MOVEDST</span>
<span style="color: #000099; font-weight: bold;">\t</span>-t|--try
<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Try run. Do not perform any action
<span style="color: #000099; font-weight: bold;">\t</span>-H|--delete-hardlink
<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Delete multiple hardlink file
<span style="color: #000099; font-weight: bold;">\t</span>-L|--log-level LEVEL
<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Set log level: 2: DEBUG, 1: VERBOSE, 0: INFO, -1: WARN, -2: ERR
&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-n</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>
  <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>
    <span style="color: #660033;">-d</span><span style="color: #000000; font-weight: bold;">|</span>--delete<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">DELETE</span>=<span style="color: #000000;">1</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #660033;">-m</span><span style="color: #000000; font-weight: bold;">|</span>--move<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">MOVE</span>=<span style="color: #000000;">1</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #660033;">-t</span><span style="color: #000000; font-weight: bold;">|</span>--try<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">TRY</span>=<span style="color: #000000;">1</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #660033;">-H</span><span style="color: #000000; font-weight: bold;">|</span>--delete-hardlink<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #007800;">DELETE_HARDLINK</span>=<span style="color: #000000;">1</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #660033;">-L</span><span style="color: #000000; font-weight: bold;">|</span>--log-level<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #7a0874; font-weight: bold;">shift</span>
      <span style="color: #007800;">LOGLEVEL</span>=<span style="color: #007800;">$1</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #660033;">-h</span><span style="color: #000000; font-weight: bold;">|</span>--help<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #7a0874; font-weight: bold;">help</span>
      <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRC</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">SRC</span>=<span style="color: #007800;">$1</span>
      <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPY</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">COPY</span>=<span style="color: #007800;">$1</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
      <span style="color: #000000; font-weight: bold;">;;</span>
  <span style="color: #000000; font-weight: bold;">esac</span>
  <span style="color: #7a0874; font-weight: bold;">shift</span>
<span style="color: #000000; font-weight: bold;">done</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPY</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
  <span style="color: #7a0874; font-weight: bold;">help</span>
  <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
log<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>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">LEVEL</span>=DEBUG
  <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">LEVEL</span>=VERBOSE
  <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">LEVEL</span>=INFO
  <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-eq</span> <span style="color: #660033;">-1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">LEVEL</span>=WARN
  <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-eq</span> <span style="color: #660033;">-2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #007800;">LEVEL</span>=ERR
  <span style="color: #000000; font-weight: bold;">else</span>
    <span style="color: #007800;">LEVEL</span>=UNKNOWN
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$1</span> <span style="color: #660033;">-le</span> <span style="color: #007800;">$LOGLEVEL</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$LEVEL</span>: <span style="color: #007800;">$2</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
action<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>
  <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">FILE</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
  <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">DIR</span>=<span style="color: #ff0000;">&quot;$2&quot;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$MOVE</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FILE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      log <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;Skip moving of directory <span style="color: #007800;">$FILE</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">DST</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRC</span>/<span style="color: #007800;">$MOVEDST</span><span style="color: #007800;">$DIR</span>&quot;</span>
    log <span style="color: #000000;">0</span> <span style="color: #ff0000;">&quot;Move duplicate <span style="color: #007800;">$FILE</span> to <span style="color: #007800;">$DST</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$TRY</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DST</span>&quot;</span>
      <span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FILE</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DST</span>&quot;</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        log <span style="color: #660033;">-2</span> <span style="color: #ff0000;">&quot;Could not move <span style="color: #007800;">$FILE</span> to <span style="color: #007800;">$DST</span>&quot;</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$DELETE</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    log <span style="color: #000000;">0</span> <span style="color: #ff0000;">&quot;Delete duplicate <span style="color: #007800;">$FILE</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$TRY</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$FILE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        log <span style="color: #660033;">-2</span> <span style="color: #ff0000;">&quot;Could not delete <span style="color: #007800;">$FILE</span>&quot;</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">else</span>
    log <span style="color: #000000;">0</span> <span style="color: #ff0000;">&quot;Do nothing for duplicate <span style="color: #007800;">$FILE</span>&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
checkemptydir<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>
  <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">DIR</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    log <span style="color: #660033;">-1</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span> is not a directory&quot;</span>
    <span style="color: #7a0874; font-weight: bold;">exit</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
  <span style="color: #007800;">COUNT</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">wc</span> -l<span style="color: #7a0874; font-weight: bold;">&#41;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$COUNT</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    action <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
compare<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>
  <span style="color: #7a0874; font-weight: bold;">local</span> <span style="color: #007800;">DIR</span>=<span style="color: #ff0000;">&quot;$1&quot;</span>
  <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRC</span><span style="color: #007800;">$DIR</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
    log <span style="color: #660033;">-2</span> <span style="color: #ff0000;">&quot;Skip non directory <span style="color: #007800;">$_DIR</span>&quot;</span>
  <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRC</span><span style="color: #007800;">$DIR</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> NAME; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NAME</span>&quot;</span> = <span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NAME</span>&quot;</span> = <span style="color: #ff0000;">&quot;..&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #007800;">SRCFILE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRC</span><span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>&quot;</span>
    <span style="color: #007800;">COPYFILE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPY</span><span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYFILE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      log <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;File <span style="color: #007800;">$NAME</span> only in source <span style="color: #007800;">$SRC</span><span style="color: #007800;">$DIR</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCFILE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      log <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;Read directory <span style="color: #007800;">$SRCFILE</span>&quot;</span>
      compare <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>&quot;</span>
      checkemptydir <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYFILE</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">stat</span> -c<span style="color: #000000; font-weight: bold;">%</span>i <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCFILE</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-eq</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">stat</span> -c<span style="color: #000000; font-weight: bold;">%</span>i <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYFILE</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-ld</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCFILE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #660033;">-gt</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-a</span> <span style="color: #007800;">$DELETE_HARDLINK</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        log <span style="color: #660033;">-1</span> <span style="color: #ff0000;">&quot;File <span style="color: #007800;">$COPYFILE</span> is duplicated hardlink&quot;</span>
      <span style="color: #000000; font-weight: bold;">else</span>
        log <span style="color: #000000;">0</span> <span style="color: #ff0000;">&quot;Skip file <span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span> with same inode. Use -H to delete hardlinks&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">continue</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #007800;">SRCSIZE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">stat</span> -c<span style="color: #000000; font-weight: bold;">%</span>s <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCFILE</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #007800;">COPYSIZE</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">stat</span> -c<span style="color: #000000; font-weight: bold;">%</span>s <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYFILE</span>&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SRCSIZE</span> <span style="color: #660033;">-ne</span> <span style="color: #007800;">$COPYSIZE</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      log <span style="color: #000000;">2</span> <span style="color: #ff0000;">&quot;File size mismatch of {<span style="color: #007800;">$SRC</span>|<span style="color: #007800;">$COPY</span>}<span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span> <span style="color: #007800;">$SRCSIZE</span> != <span style="color: #007800;">$COPYSIZE</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #007800;">SRCMD5</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>md5sum <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCFILE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #007800;">COPYMD5</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span>md5sum <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYFILE</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $1}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCMD5</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYMD5</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      log <span style="color: #000000;">2</span> <span style="color: #ff0000;">&quot;MD5 mismatch of {<span style="color: #007800;">$SRC</span>|<span style="color: #007800;">$COPY</span>}<span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    log <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;{<span style="color: #007800;">$SRC</span>|<span style="color: #007800;">$COPY</span>}<span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>:<span style="color: #007800;">$SRCSIZE</span> are equal&quot;</span>
    action <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPYFILE</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$DIR</span>&quot;</span>
  <span style="color: #000000; font-weight: bold;">done</span>
  <span style="color: #666666; font-style: italic;"># Get files only in the copy directory</span>
  <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-a</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPY</span><span style="color: #007800;">$DIR</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> NAME; <span style="color: #000000; font-weight: bold;">do</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NAME</span>&quot;</span> = <span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$NAME</span>&quot;</span> = <span style="color: #ff0000;">&quot;..&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #007800;">SRCFILE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRC</span><span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>&quot;</span>
    <span style="color: #007800;">COPYFILE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$COPY</span><span style="color: #007800;">$DIR</span>/<span style="color: #007800;">$NAME</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRCFILE</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      log <span style="color: #000000;">1</span> <span style="color: #ff0000;">&quot;File <span style="color: #007800;">$NAME</span> only in copy <span style="color: #007800;">$COPY</span><span style="color: #007800;">$DIR</span>&quot;</span>
      <span style="color: #7a0874; font-weight: bold;">continue</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
compare</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2011/01/14/recursive-duplicate-finder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coping mp3 to iPod with Rhythmbox on Ubuntu 10.10</title>
		<link>http://www.silef.de/2010/11/07/coping-mp3-to-ipod-with-rhythmbox-on-ubuntu-10-10/</link>
		<comments>http://www.silef.de/2010/11/07/coping-mp3-to-ipod-with-rhythmbox-on-ubuntu-10-10/#comments</comments>
		<pubDate>Sun, 07 Nov 2010 14:50:06 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[ipod]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=58</guid>
		<description><![CDATA[Recently I was unable to copy some audio files to my iPod Touch using Rhythmbox. The copy seems to be OK and I was able to playback the songs of the iPod using Rhythmbox. However, the playback from the iPod did not work. The play sign in the right top corner on the iPod was [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was unable to copy some audio files to my iPod Touch using Rhythmbox. The copy seems to be OK and I was able to playback the songs of the iPod using Rhythmbox. However, the playback from the iPod did not work. The play sign in the right top corner on the iPod was blinking and the iPod tried some next songs without playing anything. <em>Didn&#8217;t it work some days ago?</em></p>
<p>After depressing searches I found the solution <a href="http://ubuntu-ky.ubuntuforums.org/showthread.php?t=1600537">here</a>. You need to install some extra (or simply all) gstreamer plugins with</p>
<pre dir="ltr" lang="bash">sudo apt-get install gstreamer0.10-plugins*
</pre>
<p>and everything works fine again with Ubuntu 10.10, Rhythmbox, mp3s and the iPod again. I love open source!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2010/11/07/coping-mp3-to-ipod-with-rhythmbox-on-ubuntu-10-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top 20 Travel Advice</title>
		<link>http://www.silef.de/2010/09/11/top-20-travel-advice/</link>
		<comments>http://www.silef.de/2010/09/11/top-20-travel-advice/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 10:04:34 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[travel]]></category>
		<category><![CDATA[advice]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=43</guid>
		<description><![CDATA[Between 2008 and 2010 my girlfriend and I did a world trip through Asia, Australia, India, Africa, and South America. Here here the summarize of our Top 20 Travel Advice First of all: DO IT! The most important things are your passport and your credit card – everything else is optional and replaceable! All preparation [...]]]></description>
			<content:encoded><![CDATA[<p>Between 2008 and 2010 my girlfriend and I did a world trip through Asia, Australia, India, Africa, and South America. Here here the summarize of our <strong>Top 20 Travel Advice</strong></p>
<ul>
<li>First of all: <strong>DO IT!</strong></li>
<li>The most important things are your passport and your credit card – everything else is optional and replaceable!</li>
<li>All preparation you need for a (long term) travel is a good health insurance and the first flight ticket including required visa to your first destination country. Everything else will change during to your trip&#8230;</li>
<li>Do not book trips from home! They are much cheaper if you buy them local</li>
<li>Before you leave your country, leave the half of your luggage at home and double you money on your credit card</li>
<li>You need about three weeks to get in touch with one country (How much is a dollar worth, how to travel, where to sleep, where to eat)</li>
<li>Take some days off! Traveling and sightseeing is demanding</li>
<li>Monkey see – monkey do ! Adapt your behavior in the foreign country – if they cross the street on red – do it as well!</li>
<li>Before you enter a country get to know the exchange rate</li>
<li>Ask you travel fellows for advices – they might know better places than Lonely Planet</li>
<li>Eat in places where Moms eat with their kids. If it is good for them it is good for you</li>
<li>Drink water always from sealed water bottles – only in some countries you can drink water direct from the pipe</li>
<li>Treat locals always with respect</li>
<li>According beggars: Money is not everything. Having a nice and funny conversation helps a lot – especially for child beggars</li>
<li>Take care of your belongings in crowded places like main sights, carnival or festivals. (Did you backup your pictures before?)</li>
<li>Get to know the local money to detect false money (especially Chinese Yen)</li>
<li>Relax: The first taxi drive is mostly overpriced until you know the price (You cant know until you know)</li>
<li>If you do not know the price – ask different places and walk around (also helpful for bargain)</li>
<li>There will be bad situations – but they are temporary. The worst and coldest 9 hour bus ride on the dirtiest bump road at night has its end</li>
<li>Wear a money belt underneath your trousers containing the credit card and the passport</li>
<li>Have a fake money pocket with the daily money and some unimportant documents. Just in case you get stolen – the thief is happy with your fake wallet</li>
<li>Reduce money transactions as much as possible. A friend back home can do it for you. It is safer</li>
<li>Use a partially loaded credit card and reloaded it from time to time (by a friend back home). If your credit card gets lost not all money might be gone</li>
<li>For medical care: Keep your own hygienic clove and injection needle with you – you never know how bad world hospitals are</li>
<li>Pay always after the service (especially in Sieam Reap, Cambodia)</li>
<li>Label you important belongs with your contact details. Sometimes you just forget or lose your items. There are good people out there and want to contact you – at least give them a change <img src='http://www.silef.de/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>On bus rides: Keep the important stuff always in your hand luggage with you. On sights: leave most things in your hostel</li>
<li>You do not need an notebook. There are plenty cheap Internet Cafes out there and you have one item less which you have to take care of</li>
<li>Backup and duplicate your digital memories as much as possible to minimize data lost</li>
<li>Not a high end camera itself takes awesome pictures – you take the pictures. So get to know how to take pictures well</li>
<li>Bind the camera belt around your wrist while taking pictures against thieves</li>
<li>For media backup of your photos/videos: Backup your data! Make two DVD copies and ship one to your friend at home. If your friend confirms the shipping, you can trash your 2nd copy. If the shipping gets lost, create another copy and repeat these steps (BTW the shipping is faster than uploading your photos in the world and your friend can upload the pictures for you)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2010/09/11/top-20-travel-advice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>KlarMobil XSSurfstick W14 mit Ubuntu 10.04</title>
		<link>http://www.silef.de/2010/06/25/klarmobil-xssurfstick-w14-mit-ubuntu-10-04/</link>
		<comments>http://www.silef.de/2010/06/25/klarmobil-xssurfstick-w14-mit-ubuntu-10-04/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 18:23:41 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[klarmobil]]></category>
		<category><![CDATA[umts]]></category>
		<category><![CDATA[w14]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=26</guid>
		<description><![CDATA[Hier möchte ich kurz beschreiben, wie man mit dem Surfstick von KlarMobil (Tarif Internet Flat500) unter Linux/Ubuntu mobil ins Internet kommt. KlarMobil liefert den UMTS Stick XSStick W14 von 4G Systems mit &#8211; doch Ubuntu bzw Linux steht weder bei KlarMobil noch bei 4G Systems auf der Supportliste. Die beschriebene Lösung benutzt usb-modeswitch und wvdial [...]]]></description>
			<content:encoded><![CDATA[<p>Hier möchte ich kurz beschreiben, wie man mit dem Surfstick von <a href="http://www.klarmobil.de">KlarMobil</a> (Tarif <a href="http://www.klarmobil.de/tarife/datentarife/Internet_Flat_500/index.html">Internet Flat500</a>) unter Linux/Ubuntu mobil ins Internet kommt. KlarMobil liefert den UMTS Stick <a href="http://4g-systems.com/www/produkte.php?page=produkte&amp;kat=3&amp;id=3&amp;parent=0&amp;lang=de">XSStick W14</a> von <a href="http://www.4g-systems.com">4G Systems</a> mit &#8211; doch Ubuntu bzw Linux steht weder bei KlarMobil noch bei 4G Systems auf der Supportliste. Die beschriebene Lösung benutzt usb-modeswitch und wvdial unter Ubuntu 10.04. Sie benötigt weder Windows noch Mac OSX und ist recht zuverlässig.</p>
<p>Die Foreneinträge <a href="http://wiki.ubuntuusers.de/Baustelle/XS_Stick_W14">Baustelle XS_Stick_W14</a> und <a href="http://forum.ubuntuusers.de/topic/mobilcom-debitelstick-t-mobile/">mobilcom-debitelstick-t-mobile</a> beschreiben das Problem recht ausführlich, auf denen diese Kurzbeschreibung basiert.</p>
<p>Man installiert die benötigten Pakete <code>usb_modeswitch</code>, <code>usb-modeswitch-data</code> und <code>wvdial</code>.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> usb-modeswitch usb-modeswitch-data wvdial</pre></div></div>

<p>Man erstellt <code>/etc/usb-modeswitch.conf</code></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">########################################################</span>
<span style="color: #666666; font-style: italic;"># 4GSystems XS Stick W10/W14</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># USB-ID im Datentraegermodus</span>
<span style="color: #007800;">DefaultVendor</span>=  0x1c9e
<span style="color: #007800;">DefaultProduct</span>= 0xf000
<span style="color: #666666; font-style: italic;"># USB-ID im Modemmodus</span>
<span style="color: #007800;">TargetVendor</span>=   0x1c9e
<span style="color: #007800;">TargetProduct</span>=  0x9603
<span style="color: #007800;">MessageContent</span>=<span style="color: #ff0000;">&quot;55534243123456788000000080000606f50402527000000000000000000000&quot;</span></pre></div></div>

<p>Dazu erstellt man <code>/etc/wvdial.conf</code> und gibt die eigene PIN der SIM Karte unter <code>[Dialer pin]</code> an.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>Dialer Defaults<span style="color: #7a0874; font-weight: bold;">&#93;</span>
Init1 = AT
Baud = <span style="color: #000000;">460800</span>
Phone = <span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">99</span><span style="color: #000000; font-weight: bold;">***</span><span style="color: #000000;">1</span><span style="color: #666666; font-style: italic;">#</span>
Modem = <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyUSB2
Modem Type = Analog Modem
ISDN = <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Dialer pin<span style="color: #7a0874; font-weight: bold;">&#93;</span>
; Die eigene PIN eingeben
Init3 = AT+<span style="color: #007800;">CPIN</span>=<span style="color: #ff0000;">&quot;1234&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Dialer reset<span style="color: #7a0874; font-weight: bold;">&#93;</span>
Init3 = ATZ
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#91;</span>Dialer umts<span style="color: #7a0874; font-weight: bold;">&#93;</span>
Stupid Mode = on
Carrier Check = on
Init2 = ATQ0 V1 E1 <span style="color: #007800;">S0</span>=<span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;C1 <span style="color: #000000; font-weight: bold;">&amp;</span>amp;D2 +<span style="color: #007800;">FCLASS</span>=<span style="color: #000000;">0</span>
Init3 = <span style="color: #007800;">ATS0</span>=<span style="color: #000000;">0</span>
Init4 = AT+COPS?
Init5 = AT+<span style="color: #007800;">CGDCONT</span>=<span style="color: #000000;">1</span>,<span style="color: #ff0000;">&quot;IP&quot;</span>,<span style="color: #ff0000;">&quot;internet.mobilcom&quot;</span>
ISDN = off
Password = <span style="color: #ff0000;">&quot;klarmobil&quot;</span>
Username = <span style="color: #ff0000;">&quot;klarmobil&quot;</span>
Dial Attempts = <span style="color: #000000;">3</span></pre></div></div>

<p>Nun ist alles konfiguriert. Nach jedem Systemstart führt man das USB Modeswitch aus, um den Stick zu erkennen. (Bei mir auf Ubuntu 10.04 läuft der Stick ohne weiteren Änderungen wie in den oben genannten Foreneinträgen beschrieben wird. Man kann USB Modeswitch mit udev automatisieren, siehe dazu die Foreneinträge.):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> usb_modeswitch</pre></div></div>

<p>Jedes mal, wenn man den erneut Stick W14 einsteckt (bzw. wenn der Stick wieder Strom bekommt), muss der UMTS Stick W14 per PIN wieder freigeschalten werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> wvdial pin</pre></div></div>

<p>Danach kann man per wvdial sich ins Netz einloggen mit:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> wvdial umts</pre></div></div>

<p>Dabei wird eine PPP Verbindung aufgebaut und man kann endlich surfen, nachdem die DNS Einträge übermittelt wurden. Unter Umständen muss man sich öfters einwählen, bis man einen vollständigen Verbindungsaufbau hat. Die Verbindung wird durch ein <code>STRG+C</code> beendet.</p>
<p>Bei mir ist der Verbindungsaufbau recht zuverlässig, auch wenn die Qualität stark variiert. Viel Spaß beim mobilen surfen!</p>
<p>[Update] Laut einem Kommentar ist modeswitch nicht notwendig. Siehe Kommentare.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2010/06/25/klarmobil-xssurfstick-w14-mit-ubuntu-10-04/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Convert PalmDB to iCalendar</title>
		<link>http://www.silef.de/2008/08/18/convert-palmdb-to-icalendar/</link>
		<comments>http://www.silef.de/2008/08/18/convert-palmdb-to-icalendar/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 13:08:05 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[info]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[palm]]></category>
		<category><![CDATA[sunbird]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=21</guid>
		<description><![CDATA[Reasently I hat the problem to convert a palm DB to iCalendar format. But with jpilot and some scripting tricks it was possible to import the final iCalendar into SunBird. Export the your palm calendar with iCalendar format to palm.ics cat palm.ics &#124; perl -n -e 's/\n/BBRR/g; print;'&#124; \ perl -n -e 's/BBRR //g; print'&#124;perl [...]]]></description>
			<content:encoded><![CDATA[<p>Reasently I hat the problem to convert a palm DB to iCalendar format. But with <a href="http://www.jpilot.org/">jpilot</a> and some scripting tricks it was possible to import the final iCalendar into <a href="http://www.mozilla.org/projects/calendar/sunbird/">SunBird</a>.</p>
<ol>
<li>Export the your palm calendar with iCalendar format to palm.ics</li>
<li>
<pre><code>cat palm.ics | perl -n -e 's/\n/BBRR/g; print;'| \
perl -n -e 's/BBRR //g; print'|perl -n -e 's/BBRR/\n/g; print;'| \
iconv -c -f utf8 -t utf8 &gt; palm4sunbird.ics</code></pre>
</li>
<li>Import palm4sunbird.ics in SunBird.</li>
</ol>
<p>The command converts the multi-line descriptions to single line descriptions (If you know a shortcut for this, please tell me). Afterwards the encoding is fixed to UTF8. With this it was possible to import a palm DB with over 10000 entries. Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2008/08/18/convert-palmdb-to-icalendar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert Image to DIN A4 PDF</title>
		<link>http://www.silef.de/2008/08/18/convert-image-to-din-a4-pdf/</link>
		<comments>http://www.silef.de/2008/08/18/convert-image-to-din-a4-pdf/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 12:52:01 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[info]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[ghostscript]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pdf]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=17</guid>
		<description><![CDATA[Following commands shows how to convert an image to an A4 pdf using ImageMagick&#8217;s convert and GhostScript. $ convert input.jpg output.ps $ gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=output.pdf output.ps $ rm output.ps]]></description>
			<content:encoded><![CDATA[<p>Following commands shows how to convert an image to an A4 pdf using <a href="http://www.imagemagick.org/">ImageMagick&#8217;s</a> convert and <a href="http://www.ghostscript.com/awki/Ghostscript">GhostScript</a>.</p>
<pre><code>$ convert input.jpg output.ps
$ gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -sOutputFile=output.pdf output.ps
$ rm output.ps</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2008/08/18/convert-image-to-din-a4-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Süddeutschlandtour</title>
		<link>http://www.silef.de/2008/03/24/suddeutschlandtour/</link>
		<comments>http://www.silef.de/2008/03/24/suddeutschlandtour/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 20:35:43 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[info]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=8</guid>
		<description><![CDATA[Größere Kartenansicht]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.silef.de/old/silefde/2008/08/mapsueddeuschlandtour.jpg" alt="" /><br />
<small><a style="color:#0000FF;text-align:left" href="http://maps.google.de/maps?f=d&amp;hl=de&amp;geocode=7627265613765497276,48.513710,9.078910%3B834402808780883104,48.627290,9.332000%3B5679213866749568112,48.555990,9.378030%3B13132650058637958284,48.496130,9.190960%3B16587627931166161780,48.335750,8.950160%3B13890190533693965815,47.848410,9.013080%3B5809496943056015614,47.660360,9.177320%3B6434512447624583566,47.606575,9.732944%3B8535178833001874167,48.366100,10.904690%3B6320912963907989470,48.139068,11.663048%3B13513371361839271577,49.003240,12.108960%3B14557917247747082869,49.516280,9.329170%3B13310391152443569420,49.333920,9.105080&amp;saddr=Heidelberg,+Heidelberg,+Baden-W%C3%BCrttemberg,+Deutschland&amp;daddr=B27+%4048.513710,+9.078910+to:B313%2FNeckarstra%C3%9Fe+%4048.627290,+9.332000+to:k%C3%B6ngen+to:Kirchheimer+Stra%C3%9Fe%2FL1210+%4048.555990,+9.378030+to:L384%2FT%C3%BCbinger+Stra%C3%9Fe+%4048.496130,+9.190960+to:B27+%4048.335750,+8.950160+to:Untere+Walkestra%C3%9Fe+%4047.848410,+9.013080+to:Bodman+to:Bahnhofplatz+%4047.660360,+9.177320+to:A96+%4047.606575,+9.732944+to:Ulm+to:Jakoberwallstra%C3%9Fe+%4048.366100,+10.904690+to:A94+%4048.139068,+11.663048+to:Erding+to:Hermann-Geib-Stra%C3%9Fe%2FRS19+%4049.003240,+12.108960+to:Erlangen+to:Schw%C3%A4bisch+Hall+to:L582+%4049.516280,+9.329170+to:B27%2FB292+%4049.333920,+9.105080+to:49.395781,8.801422+to:Heidelberg&amp;mra=dpe&amp;mrcr=6&amp;mrsp=20&amp;sz=10&amp;via=1,2,4,5,6,7,9,10,12,13,15,18,19,20&amp;sll=49.333177,9.371338&amp;sspn=0.801849,1.917114&amp;ie=UTF8&amp;ll=49.333177,9.371338&amp;spn=0.801849,1.917114&amp;source=embed"></a></small></p>
<p><small><a style="color:#0000FF;text-align:left" href="http://maps.google.de/maps?f=d&amp;hl=de&amp;geocode=7627265613765497276,48.513710,9.078910%3B834402808780883104,48.627290,9.332000%3B5679213866749568112,48.555990,9.378030%3B13132650058637958284,48.496130,9.190960%3B16587627931166161780,48.335750,8.950160%3B13890190533693965815,47.848410,9.013080%3B5809496943056015614,47.660360,9.177320%3B6434512447624583566,47.606575,9.732944%3B8535178833001874167,48.366100,10.904690%3B6320912963907989470,48.139068,11.663048%3B13513371361839271577,49.003240,12.108960%3B14557917247747082869,49.516280,9.329170%3B13310391152443569420,49.333920,9.105080&amp;saddr=Heidelberg,+Heidelberg,+Baden-W%C3%BCrttemberg,+Deutschland&amp;daddr=B27+%4048.513710,+9.078910+to:B313%2FNeckarstra%C3%9Fe+%4048.627290,+9.332000+to:k%C3%B6ngen+to:Kirchheimer+Stra%C3%9Fe%2FL1210+%4048.555990,+9.378030+to:L384%2FT%C3%BCbinger+Stra%C3%9Fe+%4048.496130,+9.190960+to:B27+%4048.335750,+8.950160+to:Untere+Walkestra%C3%9Fe+%4047.848410,+9.013080+to:Bodman+to:Bahnhofplatz+%4047.660360,+9.177320+to:A96+%4047.606575,+9.732944+to:Ulm+to:Jakoberwallstra%C3%9Fe+%4048.366100,+10.904690+to:A94+%4048.139068,+11.663048+to:Erding+to:Hermann-Geib-Stra%C3%9Fe%2FRS19+%4049.003240,+12.108960+to:Erlangen+to:Schw%C3%A4bisch+Hall+to:L582+%4049.516280,+9.329170+to:B27%2FB292+%4049.333920,+9.105080+to:49.395781,8.801422+to:Heidelberg&amp;mra=dpe&amp;mrcr=6&amp;mrsp=20&amp;sz=10&amp;via=1,2,4,5,6,7,9,10,12,13,15,18,19,20&amp;sll=49.333177,9.371338&amp;sspn=0.801849,1.917114&amp;ie=UTF8&amp;ll=49.333177,9.371338&amp;spn=0.801849,1.917114&amp;source=embed">Größere Kartenansicht</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2008/03/24/suddeutschlandtour/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diamond Lane</title>
		<link>http://www.silef.de/2007/11/21/diamond-lane/</link>
		<comments>http://www.silef.de/2007/11/21/diamond-lane/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 19:17:16 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[travel]]></category>
		<category><![CDATA[diamond]]></category>
		<category><![CDATA[usa]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=5</guid>
		<description><![CDATA[Als ich vor kurzem in den Staaten war, habe ich mich beim Anflug auf den Flughafen gewundert, warum die linke Spur der Autobahn so leer ist. Als ich später mit dem Taxi zum Hotel fuhr, erklärte mir der Fahrer, dass es eine besondere &#8220;Car Pool&#8221; Regel gibt: Werktags dürfen auf der linken Fahrspur (gut gekennzeichnet [...]]]></description>
			<content:encoded><![CDATA[<p>Als ich vor kurzem in den Staaten war, habe ich mich beim Anflug auf den Flughafen gewundert, warum die linke Spur der Autobahn so leer ist. Als ich später mit dem Taxi zum Hotel fuhr, erklärte mir der Fahrer, dass es eine besondere &#8220;Car Pool&#8221; Regel gibt: Werktags dürfen auf der linken Fahrspur (gut gekennzeichnet mit einem Diamantensymbol) nur Autos mit mehreren Insassen fahren. Dh. auch besetzte Taxis. Und so fuhren wir ohne viel Stau Richtung Hotel während auf der rechten Seite die einsamen Fahrer zu ihrem Ziel dahin krochen. Eine schöne Regel (siehe auch: <a href="http://en.wikipedia.org/wiki/HOV" target="_blank">Wikipedia</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2007/11/21/diamond-lane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash on Ubuntu/Gusty AMD64</title>
		<link>http://www.silef.de/2007/10/21/flash-on-ubuntugusty-amd64/</link>
		<comments>http://www.silef.de/2007/10/21/flash-on-ubuntugusty-amd64/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 09:40:55 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=4</guid>
		<description><![CDATA[OK, finally this was easy. Install the package flashplugin-nonfree and restart firefox&#8230; $ sudo apt-get install flashplugin-nonfree]]></description>
			<content:encoded><![CDATA[<p>OK, finally this was easy. Install the package flashplugin-nonfree and restart firefox&#8230;</p>
<p><code>$ sudo apt-get install flashplugin-nonfree</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2007/10/21/flash-on-ubuntugusty-amd64/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>up2date</title>
		<link>http://www.silef.de/2007/10/03/hello-world/</link>
		<comments>http://www.silef.de/2007/10/03/hello-world/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 15:10:31 +0000</pubDate>
		<dc:creator>sebastian</dc:creator>
				<category><![CDATA[info]]></category>

		<guid isPermaLink="false">http://www.silef.de/?p=1</guid>
		<description><![CDATA[Man muss ja schließlich mit der Zeit gehen! Somit habe ich auch meine Homepage auf ein Blog umgestellt.]]></description>
			<content:encoded><![CDATA[<p>Man muss ja schließlich mit der Zeit gehen! Somit habe ich auch meine Homepage auf ein Blog umgestellt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silef.de/2007/10/03/hello-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

