<?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>Johannes Buchner &#187; thisreallyworks</title>
	<atom:link href="http://johannes.jakeapp.com/blog/category/tag/thisreallyworks/feed" rel="self" type="application/rss+xml" />
	<link>http://johannes.jakeapp.com/blog</link>
	<description>Johannes Buchner&#039;s blog about advanced usage of your operating system</description>
	<lastBuildDate>Sun, 18 Jul 2010 08:30:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Spuren: Desktop Search for tidy people</title>
		<link>http://johannes.jakeapp.com/blog/category/happy-hacking/201006/spuren-desktop-search-for-tidy-people</link>
		<comments>http://johannes.jakeapp.com/blog/category/happy-hacking/201006/spuren-desktop-search-for-tidy-people#comments</comments>
		<pubDate>Fri, 04 Jun 2010 07:51:45 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[thisreallyworks]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=1134</guid>
		<description><![CDATA[Desktop search engines, like beagle, metatracker, strigi, jindex, etc. provide a comfortable way of jumping to the files you want to work with. They do this by indexing all your files, making a database, and searching that database by your keywords.
Unfortunately, these databases are around a gigabyte in size for me (e.g. tracker, strigi). Context [...]]]></description>
			<content:encoded><![CDATA[<p>Desktop search engines, like beagle, metatracker, strigi, jindex, etc. provide a comfortable way of jumping to the files you want to work with. They do this by indexing all your files, making a database, and searching that database by your keywords.</p>
<p>Unfortunately, these databases are around a gigabyte in size for me (e.g. tracker, strigi). Context search is overkill for  me, because I name my files properly and put them in folders.</p>
<h2>Introducing &#8220;Spuren&#8221;</h2>
<p>So I developed a search engine a while ago that works on file names and paths: The keywords a file can be found is the filename and path split by &#8216;/&#8217;,'-&#8217;,'_&#8217;,&#8217;.&#8217;,'\&#8217;. With the feature of exclusive search terms (starting with &#8216;-&#8217;), and being able to open the found file or its parent folder, that is something you can work with.</p>
<p>Now this tool is available as a indexer and search tray icon program, for Unix only. It quickly produces a tiny database of your files, because it is based on unix tools (find+gzip). The search tool is written in Java.</p>
<p><strong>Try out &#8220;spuren&#8221;, the content-free desktop search engine. </strong>Spuren is German for &#8216;tracks&#8217;. Download it at the bottom of this page.</p>
<p>Spuren provides a KISS combination of the ease of use of Beagle et. al. and the simplicity of find.</p>
<h2>Install and Configure</h2>
<ul>
<li>Download the tar and extract it somewhere, for example in ~/bin/</li>
<li>Put the directories you want to have indexed in ~/.local/share/spuren/dirs (line by line)</li>
<li>Put the directory names you want to have skipped in ~/.local/share/spuren/skipdirnames</li>
<li>Put the file names you want to have skipped in ~/.local/share/spuren/skipfilenames</li>
<li>Run spuren-mine. This produces ~/.local/share/spuren/db.gz, which contains all indexed file names.</li>
<li>Run spuren-trayicon (and perhaps make yourself a icon on the desktop or put it into session start preferences).</li>
<li>Click on the icon and search away</li>
</ul>
<h2>Tipps</h2>
<ul>
<li>Separate keywords by spaces (search will be slightly faster if you enter the least generic term first)</li>
<li>You can exclude by prefixing a &#8216;-&#8217;, for example &#8221; houses -skyscrapers  &#8220;</li>
<li>The default is to find files that have tags starting with the given keywords. You can prefix with a &#8216;*&#8217; to find files that have tags containing the given keyword. For example: &#8220;houses *scrape&#8221;.</li>
<li>You can jump down to the results by pressing the down key, and up gets you back. Escape closes the search window.</li>
<li>A double-click launches the file, pressing shift at the same time will open the folder the file is in instead.</li>
<li>You can rebuild the database by right-clicking the icon. It only takes a minute or two.</li>
<li>The result folders are abbreviated to 3 chars to save space. You can find the full path and some other info at the bottom of the window</li>
</ul>
<h2>FAQ</h2>
<ul>
<li>&#8220;Java is ugly&#8221;: You can switch to the GTK theme or <a title="Nimbus" href="http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/nimbus.html">Nimbus</a> LAF. Enable it in the <code>swing.properties</code> file.</li>
</ul>
<p>&#8230; leave feedback and comments &#8230;</p>
<h2>Download</h2>
<ul>
<li><strong>Spuren, release 1.0: <a title="Spuren, release 1.0" href="http://johannes.jakeapp.com/files/spuren/spuren-1.0.tar.bz2">spuren-1.0.tar.bz2</a></strong></li>
<li>Source for Java program: <a title="Spuren source, release 1.0" href="http://johannes.jakeapp.com/files/spuren/spuren-1.0-source.tar.bz2">spuren-1.0-source.tar.bz2</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/happy-hacking/201006/spuren-desktop-search-for-tidy-people/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Maven: Colorized</title>
		<link>http://johannes.jakeapp.com/blog/category/fun-with-linux/200901/maven-colorized</link>
		<comments>http://johannes.jakeapp.com/blog/category/fun-with-linux/200901/maven-colorized#comments</comments>
		<pubDate>Wed, 07 Jan 2009 03:19:07 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[fun with Linux]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[thisreallyworks]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=28</guid>
		<description><![CDATA[Maven was written by people who obviously have no idea on how to create good tui (Text User Interface)-tools. They should sit together with the portage, git or other Linux-devs. 
The output is unreadable (not to mention that the startup is slow). 
So, what I did was wrap maven in a script that colorizes the [...]]]></description>
			<content:encoded><![CDATA[<p>Maven was written by people who obviously have no idea on how to create good tui (Text User Interface)-tools. They should sit together with the portage, git or other Linux-devs. <br />
The output is unreadable (not to mention that the startup is slow). </p>
<p>So, what I did was wrap maven in a script that colorizes the output. The result looks like this:<br />
<img width="400" height="163" title="" src="http://johannes.jakeapp.com/blog/oldblog/images/colorizedmaven.png" alt="colorizedmaven" /></p>
<p>This is how to do it:<br />
create the file ~/bin/mvn with the following content (<a title="" href="http://johannes.jakeapp.com/blog/oldblog/files/mvn." as="link">mvn</a> (0 KB))
<pre><code>#!/bin/bash
/usr/bin/mvn $* | sed -e 's/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/[1;32mTests run: \1[0m, Failures: [1;31m\2[0m, Errors: [1;33m\3[0m, Skipped: [1;34m\4[0m/g' \
-e 's/\(\[WARN\].*\)/[1;33m\1[0m/g' \
-e 's/\(\[INFO\].*\)/[1;34m\1[0m/g' \
-e 's/\(\[ERROR\].*\)/[1;31m\1[0m/g'</code></pre>
<p>replace /usr/bin/mvn with wherever your mvn is (find out with <code>which mvn</code>).<br />
Double-check that you get the encoding right, the weird sign should be hexadecimal 1b. Use a editor that supports encodings for copy+paste.<br />
Give your ~/bin/mvn execute permissions (<code>chmod +x ~/bin/mvn</code>)</p>
<p>Try it out: call <code>~/bin/mvn</code> in one of your maven projects</p>
<p>What is left to do is to register your new mvn-wrapper so it is called everytime. <br />
Add the following line to your ~/.bashrc :
<pre><code>alias mvn=~/bin/mvn</code></pre>
<p>Execute the command you just added in your running shells so you can use it there too.</p>
<p>You are done.</p>
<p><strong>Changing the distributed mvn startup script</strong></p>
<p>Even better, but a little more intrusive (you need root rights): <br />
change the distributed mvn file. It is a bash script actually. <br />
In gentoo:</p>
<pre><code> $ which mvn
/usr/bin/mvn
$ file /usr/bin/mvn
/usr/bin/mvn: symbolic link to `/usr/share/maven-bin-2.0/bin/mvn'
$ file /usr/share/maven-bin-2.0/bin/mvn
/usr/share/maven-bin-2.0/bin/mvn: Bourne shell script text executable
$ </code></pre>
<p>Change the last call in that file to:</p>
<pre><code>exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "${M2_HOME}"/boot/classworlds-*.jar \
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
"-Dmaven.home=${M2_HOME}"  \
${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS |
sed -e 's/Tests run: \([^,]*\), Failures: \([^,]*\), Errors: \([^,]*\), Skipped: \([^,]*\)/[1;32mTests run: \1[0m, Failures: [1;31m\2[0m, Errors: [1;33m\3[0m, Skipped: [1;34m\4[0m/g' \
-e 's/\(\[WARN\].*\)/[1;33m\1[0m/g' \
-e 's/\(\[INFO\].*\)/[1;34m\1[0m/g' \
-e 's/\(\[ERROR\].*\)/[1;31m\1[0m/g'
</code></pre>
<p>That way you have it there directly. Maybe the gentoo devs could add a color use-flag. That&#8217;d be fun&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/fun-with-linux/200901/maven-colorized/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDF merge/join/split</title>
		<link>http://johannes.jakeapp.com/blog/category/happy-hacking/200811/pdf-mergejoinsplit</link>
		<comments>http://johannes.jakeapp.com/blog/category/happy-hacking/200811/pdf-mergejoinsplit#comments</comments>
		<pubDate>Thu, 13 Nov 2008 01:23:26 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[thisreallyworks]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=38</guid>
		<description><![CDATA[You always wanted it to be this simple. Now it is.
.
Download:
=&#62; 8KB	pdfjoin-nosrc.tar.bz2
14712KB	pdfjoin.tar.bz2 (with Ghostscript sources)
I programmed it in Python+Glade+GTK. It uses ghostscript as backend.
Unpack and run &#8220;python pdfjoin.py&#8221;.
I&#8217;ll make a Windows package sometime.
]]></description>
			<content:encoded><![CDATA[<p>You always wanted it to be this simple. Now it is.</p>
<p><img src="http://johannes.jakeapp.com/blog/oldblog/images/Screenshot-PDF join.png" alt="Screenshot-PDF join" width="400" height="225" />.</p>
<p>Download:<br />
<strong>=&gt; <a href="http://johannes.jakeapp.com/oldsite/projekte/pdfjoin-nosrc.tar.bz2">8KB	pdfjoin-nosrc.tar.bz2</a></strong></p>
<p><a style="font-size: x-small;" href="http://johannes.jakeapp.com/oldsite/projekte/pdfjoin.tar.bz2">14712KB	pdfjoin.tar.bz2 (with Ghostscript sources)</a></p>
<p>I programmed it in Python+Glade+GTK. It uses ghostscript as backend.<br />
Unpack and run &#8220;python pdfjoin.py&#8221;.</p>
<p>I&#8217;ll make a Windows package sometime.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/happy-hacking/200811/pdf-mergejoinsplit/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python: HTML database descriptions from create statements</title>
		<link>http://johannes.jakeapp.com/blog/category/happy-hacking/200804/python-html-database-descriptions-from-create-statements</link>
		<comments>http://johannes.jakeapp.com/blog/category/happy-hacking/200804/python-html-database-descriptions-from-create-statements#comments</comments>
		<pubDate>Wed, 02 Apr 2008 00:25:13 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[thisreallyworks]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=53</guid>
		<description><![CDATA[This code produces HTML database descriptions from create statements.
Feed into stdin, await from stdout.
For example: python dbdesc.py &#60; DATASCHEME &#62; dbdesc.html
It isn&#8217;t perfect nor meant to be, but gives a good starting point for a documentation.
#!/usr/bin/python
import sys
import re
a = ''
for i in sys.stdin.readlines():
a = a + " " + re.sub('--.*', '', i).strip()
a = a.strip().lower()
a = [...]]]></description>
			<content:encoded><![CDATA[<p>This code produces HTML database descriptions from create statements.</p>
<p>Feed into stdin, await from stdout.<br />
For example: <b>python dbdesc.py &lt; DATASCHEME &gt; dbdesc.html</b></p>
<p>It isn&#8217;t perfect nor meant to be, but gives a good starting point for a documentation.</p>
<pre><code>#!/usr/bin/python
import sys
import re
a = ''
for i in sys.stdin.readlines():
a = a + " " + re.sub('--.*', '', i).strip()
a = a.strip().lower()
a = re.sub('\/\*[^*]*\*\/', '', a)
print """
&lt;html&gt;
&lt;head&gt;
&lt;link rel="stylesheet" href="dbdesc.css" /&gt;
&lt;/head&gt;
&lt;body&gt;
"""
for m in re.findall('create table ([^ (]*)[ (]*([^;]*)[ )]*;', a):
tablename = m[0]
content = m[1]
print "&lt;h2&gt;%s&lt;/h2&gt;"  % tablename
print """&lt;table class="dbdesc"&gt;&lt;thead&gt;&lt;tr&gt;
&lt;th class="name"&gt;Feldname&lt;/th&gt;
&lt;th class="type"&gt;Typ&lt;/th&gt;
&lt;th class="option"&gt;Option&lt;/th&gt;
&lt;th class="comment"&gt;Bemerkung&lt;/th&gt;
&lt;/tr&gt;&lt;/thead&gt;"""
atts = {}
for l in content.split(','):
l = l.strip()
if l == '':
continue
if l.startswith('constraint') or l.startswith('foreign key'):
continue
l = l.split(None, 2)
if len(l)&lt;2:
continue
name = l[0]
if name == 'constraint' or name.__contains__('(') or name.__contains__(')'):
continue
type = l[1]
if len(l)&lt;3:
l.append('')
op = ""
if 'not null' in l[2]:       op = op + '!'
if 'primary key' in l[2]:    op = op + '1+P'
elif 'unique' in l[2]:       op = op + '1'
print """ &lt;tr&gt;
&lt;td class="name"&gt;%s&lt;/td&gt;
&lt;td class="type"&gt;%s&lt;/td&gt;
&lt;td class="option"&gt;%s&lt;/td&gt;
&lt;td class="comment"&gt;&lt;!-- TODO: Bemerkungen --&gt;&lt;/td&gt;
&lt;/tr&gt;""" % (name, type, op)
print """ &lt;/table&gt; """
print """&lt;/html&gt; """
</code></pre>
<p>CSS file dbdesc.css</p>
<pre><code>table.dbdesc{	width: 40em;	border: 1px solid #080;	border-width: 1px 0;}
table.dbdesc th{	border-bottom: 1px solid #080;}
table.dbdesc td{	border: none;}
table.dbdesc td, table.dbdesc th{	width: 15em;}
table.dbdesc th{	font-style: italic;	font-weight: normal; }
table.dbdesc td.option{	text-align: center;}
table.dbdesc td.type{	text-transform: uppercase;}
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/happy-hacking/200804/python-html-database-descriptions-from-create-statements/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Converter Extension for deskbar</title>
		<link>http://johannes.jakeapp.com/blog/category/happy-hacking/200802/converter-extension-for-deskbar</link>
		<comments>http://johannes.jakeapp.com/blog/category/happy-hacking/200802/converter-extension-for-deskbar#comments</comments>
		<pubDate>Thu, 14 Feb 2008 21:47:13 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[thisreallyworks]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=66</guid>
		<description><![CDATA[Do you know units? It&#8217;s a small forgotten unix program (like cal) that converts units &#8230; It tells me it supports 2411 units, 71 prefixes and 33 nonlinear units. Not bad, huh?
So let&#8217;s use this in the deskbar-applet. Some friendly neighbor already did this, I updated it to 2.20 new-style classes.
Screenshot: 
Code: converter (py, 6 [...]]]></description>
			<content:encoded><![CDATA[<p>Do you know units? It&#8217;s a small forgotten unix program (like cal) that converts units &#8230; It tells me it supports 2411 units, 71 prefixes and 33 nonlinear units. Not bad, huh?</p>
<p>So let&#8217;s use this in the deskbar-applet. Some friendly neighbor already did this, I updated it to 2.20 new-style classes.</p>
<p>Screenshot: <img width="414" height="224" title="" src="http://johannes.jakeapp.com/blog/oldblog/images/Deskbar-Applet-Units.png" alt="Deskbar-Applet-Units" /></p>
<p><span style="text-decoration: line-through">Code: <a title="" href="http://johannes.jakeapp.com/blog/oldblog/files/converter.py" as="link">converter</a> (py, 6 KB)</span><br />
Don&#8217;t use this anymore. <strong><a href="http://twoday.tuwien.ac.at/jo/stories/311493/">Try this updated version!</a></strong></p>
<p>Download to your Desktop, then drag and drop it into the deskbar preferences window. Or copy it to ~/.gnome2/deskbar-applet/modules-2.20-compatible. <br />
Don&#8217;t forget to enable it in the preferences.</p>
<p>Yaha, you need to install the units program first!</p>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/happy-hacking/200802/converter-extension-for-deskbar/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>keeping old revisions</title>
		<link>http://johannes.jakeapp.com/blog/category/fun-with-linux/200801/keeping-old-revisions</link>
		<comments>http://johannes.jakeapp.com/blog/category/fun-with-linux/200801/keeping-old-revisions#comments</comments>
		<pubDate>Mon, 14 Jan 2008 13:40:24 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[fun with Linux]]></category>
		<category><![CDATA[thisreallyworks]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=71</guid>
		<description><![CDATA[One might be to lazy to set up or use a revision control system like CVS, SVN or git for small projects or when working on 2-3 simple files.
This script creates a directory &#8220;backup&#8221;, and places there a archive of the files in the current directory (not recursive) with an increasing number.
e.g. you start it [...]]]></description>
			<content:encoded><![CDATA[<p>One might be to lazy to set up or use a revision control system like CVS, SVN or git for small projects or when working on 2-3 simple files.</p>
<p>This script creates a directory &#8220;backup&#8221;, and places there a archive of the files in the current directory (not recursive) with an increasing number.</p>
<p>e.g. you start it in a Folder &#8220;Bsp-3&#8243;, it will create &#8220;backup/Bsp3-1.tar.bz2&#8243;, next time &#8220;Bsp3-2.tar.bz2&#8243;, etc. <br />
Also cleans up duplicates, so you cannot call it too often!</p>
<p>Small, clean, easy. I love it!</p>
<p><b>backup-point.sh</b></p>
<pre><code>DIRNAME=$(basename $PWD)
EXT=tar.bz2
mkdir -p backup
cleanup_unneeded(){
cd backup
FILES=*.tar.bz2
UNIQ=$(md5sum $FILES|sort|uniq --check-chars=32 | cut -d ' ' -f 3-);
for i in $FILES
do
if ! echo "$UNIQ" | grep -wq "$i"
then
echo "deleting unnecessary $i."
rm "$i"
fi
done
cd ..
}
cleanup_unneeded
for((i=1;i&lt;200;i++)); do
FILENAME="backup/$DIRNAME-$i.$EXT"
if ! test -f "$FILENAME"; then
find  -maxdepth 1 -type f|xargs tar -cjf "$FILENAME"
echo "backup-point $i made."
cleanup_unneeded
exit
fi
done
echo '200 points reached! Clean up a bit?'</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/fun-with-linux/200801/keeping-old-revisions/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LaTeX: Beamer Theme switcher</title>
		<link>http://johannes.jakeapp.com/blog/category/happy-hacking/200706/latex-beamer-theme-switcher</link>
		<comments>http://johannes.jakeapp.com/blog/category/happy-hacking/200706/latex-beamer-theme-switcher#comments</comments>
		<pubDate>Sat, 09 Jun 2007 21:30:46 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[Happy Hacking]]></category>
		<category><![CDATA[thisreallyworks]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=98</guid>
		<description><![CDATA[LaTeX + beamer package &#8230; means cool presentations. 
But how to select a theme and a color theme? Which are there anyway? 
The first script takes you through a tour how your presentation will look like for each theme. 
The second does quite the same thing for the color schemes.
#!/bin/sh
name="switchtheme"
THEMEFILEDIR="/usr/share/texmf/tex/latex/beamer/"
INFILE="presentation.tex"
TMPINFILE="$name.tex"
TMPOUTFILE="$name.pdf"
MAKECMD="pdflatex $TMPINFILE"
DISPLAYCMD="evince $TMPOUTFILE"
THEMELIST=$*
if [ "$THEMELIST" == [...]]]></description>
			<content:encoded><![CDATA[<p>LaTeX + beamer package &#8230; means cool presentations. </p>
<p>But how to select a theme and a color theme? Which are there anyway? </p>
<p>The first script takes you through a tour how your presentation will look like for each theme. <br />
The second does quite the same thing for the color schemes.</p>
<pre><code>#!/bin/sh
name="switchtheme"
THEMEFILEDIR="/usr/share/texmf/tex/latex/beamer/"
INFILE="presentation.tex"
TMPINFILE="$name.tex"
TMPOUTFILE="$name.pdf"
MAKECMD="pdflatex $TMPINFILE"
DISPLAYCMD="evince $TMPOUTFILE"
THEMELIST=$*
if [ "$THEMELIST" == "" ]; then
THEMELIST=$(ls $THEMEFILEDIR |
grep 'beamertheme[A-Z]' | sed 's/beamertheme\([A-Z].*\)\.sty/\1/')
fi
for theme in $THEMELIST; do
echo $theme
cat $INFILE | sed 's/\\usetheme{[^}]*}/\\usetheme{'$theme'}/g' |
sed 's/\\title{\([^}]*\)}/\\title{\1 - '$theme'}/g' |
cat &gt; $TMPINFILE
$MAKECMD
$DISPLAYCMD
done
rm $TMPOUTFILE $TMPINFILE $name.{out,aux,log,nav,snm,toc}</code></pre>
<p></p>
<pre><code>#!/bin/sh
name="switchcolor"
THEMEFILEDIR="/usr/share/texmf/tex/latex/beamer/"
INFILE="presentation.tex"
TMPINFILE="$name.tex"
TMPOUTFILE="$name.pdf"
MAKECMD="pdflatex $TMPINFILE"
DISPLAYCMD="evince $TMPOUTFILE"
THEMELIST=$*
if [ "$THEMELIST" == "" ]; then
THEMELIST=$(ls $THEMEFILEDIR |
grep 'beamercolortheme' | sed 's/beamercolortheme\(.*\)\.sty/\1/')
fi
for theme in $THEMELIST; do
echo $theme
cat $INFILE | sed 's/\\usecolortheme{[^}]*}/\\usecolortheme{'$theme'}/g' |
sed 's/\\title{\([^}]*\)}/\\title{\1 - '$theme'}/g' |
cat &gt; $TMPINFILE
$MAKECMD
$DISPLAYCMD
done
rm $TMPOUTFILE $TMPINFILE $name.{out,aux,log,nav,snm,toc}</code></pre>
<p>Start it where your tex file lives (plus change the INFILE variable). Your .tex file has to have \usetheme{something} as this will be replaced (not in your file, but a temporary). <br />
You can also give it themes names as parameter, and it will show you only these.</p>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/happy-hacking/200706/latex-beamer-theme-switcher/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy files from Playlist (.pls) to usb stick</title>
		<link>http://johannes.jakeapp.com/blog/category/fun-with-linux/200703/copy-files-from-playlist-pls-to-usb-stick</link>
		<comments>http://johannes.jakeapp.com/blog/category/fun-with-linux/200703/copy-files-from-playlist-pls-to-usb-stick#comments</comments>
		<pubDate>Sat, 24 Mar 2007 12:41:42 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[fun with Linux]]></category>
		<category><![CDATA[hint]]></category>
		<category><![CDATA[thisreallyworks]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=115</guid>
		<description><![CDATA[cat TopRated.pls &#124;
grep -Eo "/mnt/.*"&#124;sed "s/%.\{2\}/*/g"&#124;
while read line; do cp "$line" /mnt/sda1/Music/TopRated/ -v; done

]]></description>
			<content:encoded><![CDATA[<pre><code>cat TopRated.pls |
grep -Eo "/mnt/.*"|sed "s/%.\{2\}/*/g"|
while read line; do cp "$line" /mnt/sda1/Music/TopRated/ -v; done
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/fun-with-linux/200703/copy-files-from-playlist-pls-to-usb-stick/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get a nice pic for your desktop every day</title>
		<link>http://johannes.jakeapp.com/blog/category/fun-with-linux/200611/get-a-nice-pic-for-your-desktop-every-day</link>
		<comments>http://johannes.jakeapp.com/blog/category/fun-with-linux/200611/get-a-nice-pic-for-your-desktop-every-day#comments</comments>
		<pubDate>Mon, 13 Nov 2006 01:31:16 +0000</pubDate>
		<dc:creator>JohannesTheDeveloper</dc:creator>
				<category><![CDATA[fun with Linux]]></category>
		<category><![CDATA[thisreallyworks]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://johannes.jakeapp.com/blog/?p=149</guid>
		<description><![CDATA[Gets a daily picture from a site and sets the softlink &#8220;newest&#8221; to it. 
Needs executable rights on the shellscript and a 
The shell script next.sh:
DATE=$(date +%y%m%d)
SERVER=antwrp.gsfc.nasa.gov
URL=http://${SERVER}/apod/ap${DATE}.html
NEWIMG=${DATE}.img
[ -e $NEWIMG ] &#38;&#38; exit;
rm -rf *.jpg *.png *.gif
wget --recursive --level=1 $URL --accept jpg,png,gif --no-clobber --no-directories --tries=0
FIRST=$( ls -U *_f.* *_big.* *.jpg *.png *.gif 2&#62;/dev/null&#124;head -n 1 );
if [...]]]></description>
			<content:encoded><![CDATA[<p>Gets a daily picture from a site and sets the softlink &#8220;newest&#8221; to it. </p>
<p>Needs executable rights on the shellscript and a </p>
<p>The shell script next.sh:</p>
<pre>DATE=$(date +%y%m%d)
SERVER=antwrp.gsfc.nasa.gov
URL=http://${SERVER}/apod/ap${DATE}.html
NEWIMG=${DATE}.img
[ -e $NEWIMG ] &amp;&amp; exit;
rm -rf *.jpg *.png *.gif
wget --recursive --level=1 $URL --accept jpg,png,gif --no-clobber --no-directories --tries=0
FIRST=$( ls -U *_f.* *_big.* *.jpg *.png *.gif 2&gt;/dev/null|head -n 1 );
if [[ "$FIRST" != "" ]]; then
cp $FIRST $NEWIMG
unlink newest
ln -s $NEWIMG newest
fi
</pre>
<p>If you want a cronjob for that, use e.g.:</p>
<pre>0,30 * * * * cd bgimg/astro/data; sh ../next.sh</pre>
<p>Don&#8217;t forget to set the background image of your window manager to the link &#8230; obviously</p>
]]></content:encoded>
			<wfw:commentRss>http://johannes.jakeapp.com/blog/category/fun-with-linux/200611/get-a-nice-pic-for-your-desktop-every-day/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
