<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>MacLovin</title>
	
	<link>http://www.maclovin.de</link>
	<description>An Apple a day keeps the doctor away</description>
	<lastBuildDate>Wed, 16 Feb 2011 22:52:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Maclovin" /><feedburner:info uri="maclovin" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Access OS X keychain from Terminal</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/8JR6PC7hVlE/</link>
		<comments>http://www.maclovin.de/2010/02/access-os-x-keychain-from-terminal/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 20:57:44 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=526</guid>
		<description><![CDATA[At everyday scripting, you often need to access sensible information like passwords. A common practice is to just write them plain text into your script, but at least on a Mac, we can do better. OS X ships with a tool called keychain. It is a central database where tools can store sensitive information like [...]]]></description>
			<content:encoded><![CDATA[<p>At everyday scripting, you often need to access sensible information like passwords. A common practice is to just write them plain text into your script, but at least on a Mac, we can do better.</p>
<p>OS X ships with a tool called keychain. It is a central database where tools can store sensitive information like logins. Luckily, it is accessible from shell scripts with the command line utility <strong>security</strong>.</p>
<p>Let&#8217;s say you want to securely access an FTP server&#8217;s username and password. First of all, add a new Internet password to your keychain. To do so, just fire it up, select <em>New password</em> and enter the credentials. Remember to add the prefix http:// or ftp:// to your service name to create an Internet password.</p>
<div id="_mcePaste"><a href="http://www.maclovin.de/wp-content/uploads/2010/02/keychain-internet-password.png"><img class="aligncenter size-full wp-image-532" title="Keychain Internet Password" src="http://www.maclovin.de/wp-content/uploads/2010/02/keychain-internet-password.png" alt="" width="425" height="394" /></a></div>
<p>Now you read the username like this from the command line</p>
<div id="_mcePaste">
<pre class="brush: bash;light: true">security find-internet-password -s ftp.home.com | grep "acct" | cut -d '"' -f 4</pre>
</div>
<p>The service is what you entered in keychain, but without the prefix. And finally your password</p>
<div id="_mcePaste">
<pre class="brush: bash;light: true">security 2&gt;&amp;1 &gt;/dev/null find-internet-password -gs ftp.home.com | cut -d '"' -f 2</pre>
</div>
<div id="_mcePaste">That&#8217;s all. No more plain text passwords in your script.</div>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/8JR6PC7hVlE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2010/02/access-os-x-keychain-from-terminal/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2010/02/access-os-x-keychain-from-terminal/</feedburner:origLink></item>
		<item>
		<title>How to patch binary files with Java</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/JrU6SKxAO1Y/</link>
		<comments>http://www.maclovin.de/2010/02/how-to-patch-binary-files-with-java/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 21:09:36 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=500</guid>
		<description><![CDATA[Recently, I wanted to create an &#8220;intelligent&#8221; binary patcher, which not only replaces some chunk of binary data at a file&#8217;s predefined offset, but instead performs search and replace. Here is the Java class I came up with. import java.io.*; import java.math.BigInteger; public class BinaryPatcher { private String content; private final String filename; private final [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I wanted to create an &#8220;intelligent&#8221; binary patcher, which not only replaces some chunk of binary data at a file&#8217;s predefined offset, but instead performs search and replace. Here is the Java class I came up with.</p>
<pre class="brush: java">import java.io.*;
import java.math.BigInteger;

public class BinaryPatcher {
	private String content;

	private final String filename;
	private final String searchPattern;
	private final String replacePattern;

	public BinaryPatcher(String filename, String searchPattern,
			String replacePattern) throws IOException {

		this.filename = filename;
		this.searchPattern = convertHexStringToBinaryString(searchPattern);
		this.replacePattern = convertHexStringToBinaryString(replacePattern);

		initializeContent();
	}

	public boolean isPatchable() {
		return getContent().contains(searchPattern);
	}

	public void patch() throws IOException {
		if (!isPatchable()) {
			throw new IOException("Search pattern not found");
		}

		String originalContent = getContent();
		String patchedContent = originalContent.replace(searchPattern,
				replacePattern);

		saveStringToFile(patchedContent, filename);
	}

	public void createBackup(String filename) throws IOException {
		saveStringToFile(getContent(), filename);
	}

	private static String convertHexStringToBinaryString(String theHexString) {
		byte[] byteSequence = new BigInteger(theHexString, 16).toByteArray();
		return new String(byteSequence);
	}

	private void initializeContent() throws IOException {
		byte[] buffer = new byte[(int) new File(filename).length()];
		FileInputStream in = new FileInputStream(filename);
		in.read(buffer);
		in.close();
		content = new String(buffer);
	}

	private void saveStringToFile(String content, String filename)
			throws IOException {
		FileOutputStream out = new FileOutputStream(filename);
		out.write(content.getBytes());
		out.close();
	}

	private String getContent() {
		return content;
	}
}</pre>
<p>The usage is pretty straight forward. Let&#8217;s have a look at an basic example:</p>
<pre class="brush: java">class Tester {
	public static void main(String[] args) {
		try {
			String filename = "patchme";
			BinaryPatcher p = new BinaryPatcher(filename, "AB00FF14", "AB11FF14");

			if (p.isPatchable()) {
				p.createBackup(filename + ".org");
				p.patch();
			}
		} catch(IOException e) {
			System.out.println("ERROR: " + e.getMessage());
		}
	}
}</pre>
<p>We try to patch the file <em>patchme</em>. The search and replace binary data is given by hex sequences, in this example <em>AB00FF14</em> is replaced by <em>AB11FF14</em>. If the file is patchable, i.e. it contains the search pattern, a backup named <em>patchme.org</em> is created an finally, the original file is modified.</p>
<p>That&#8217;s all. Pretty simple but useful. You can download the BinaryPatcher class <a href="http://www.maclovin.de/wp-content/uploads/2010/02/BinaryPatcher.java">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/JrU6SKxAO1Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2010/02/how-to-patch-binary-files-with-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2010/02/how-to-patch-binary-files-with-java/</feedburner:origLink></item>
		<item>
		<title>Robust HTML parsing the Groovy way</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/qbBDZE3lEAY/</link>
		<comments>http://www.maclovin.de/2010/02/robust-html-parsing-the-groovy-way/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 19:50:06 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=445</guid>
		<description><![CDATA[With Groovy, it&#8217;s very easy to parse XML data and extract arbitrary information. This works great as long as the input data is well-formed, but you can&#8217;t always guarantee that in real-world scenarios. Think of extracting data from HTML pages. They are very often a mess when it comes to XML validity and that&#8217;s where [...]]]></description>
			<content:encoded><![CDATA[<p>With Groovy, it&#8217;s very easy to parse XML data and extract arbitrary information. This works great as long as the input data is well-formed, but you can&#8217;t always guarantee that in real-world scenarios. Think of extracting data from HTML pages. They are very often a mess when it comes to XML validity and that&#8217;s where the <a title="TagSoup" href="http://home.ccil.org/~cowan/XML/tagsoup/" target="_blank">TagSoup library</a> comes to the rescue.</p>
<p><span id="more-445"></span></p>
<p>There are two major problems with HTML input:</p>
<ul>
<li>DTD resolution</li>
<li>Missing closing tags</li>
</ul>
<p>We are going to build a simple Groovy script that prints the list of questions on StackOverflow&#8217;s start page. The straight forward solution looks something like that</p>
<pre class="brush: groovy">def slurper = new XmlSlurper()
def htmlParser = slurper.parse("http://stackoverflow.com/")

htmlParser.'**'.findAll{ it.@class == 'question-hyperlink'}.each {
	println	it
}</pre>
<p>We parse <a href="http://stackoverflow.com" target="_blank">http://stackoverflow.com</a> with XMLSlurper, loop over all tags with the class attribute &#8216;question-hyperlink&#8217; and print it. But when running the script we get the following exception:</p>
<blockquote>
<div id="_mcePaste">Caught: java.io.IOException: Server returned HTTP response code: 503 for URL: http://www.w3.org/TR/html4/strict.dtd at html_parser.run(html_parser.groovy:7)</div>
</blockquote>
<div>XMLSlurper has problems with HTML DTDs. By using the information in <a title="Groovy XmlSlurper and HTTP 503 Response Code" href="http://stevefinck.blogspot.com/2009/12/groovy-xmlslurper.html" target="_blank">this post</a>, we get rid of the exception.</div>
<div>
<pre class="brush: groovy;highlight: 2">def slurper = new XmlSlurper()
slurper.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false)
def htmlParser = slurper.parse("http://stackoverflow.com/")

htmlParser.'**'.findAll{ it.@class == 'question-hyperlink'}.each {
	println	it
}</pre>
</div>
<div>So next try. The DTD exception is gone, but we get another one saying the closing link-tag is missing. And here comes TagSoup. It&#8217;s a library that tries to transform invalid HTML data into well-formed XML. And best of all, it works great together with XMLSlurper. Here is the final Script:</div>
<div>
<pre class="brush: groovy">@Grab(group='org.ccil.cowan.tagsoup',
      module='tagsoup', version='1.2' )
def tagsoupParser = new org.ccil.cowan.tagsoup.Parser()
def slurper = new XmlSlurper(tagsoupParser)
def htmlParser = slurper.parse("http://stackoverflow.com/")

htmlParser.'**'.findAll{ it.@class == 'question-hyperlink'}.each {
	println	it
}</pre>
</div>
<div>The first command uses the @Grab-annotation to load the TagSoup library. Next we create a TagSoup-Parser instance and pass it as constructor-parameter to XMLSlurper. That&#8217;s all and we even got rid of the <em>setFeature</em> workaround.</div>
<div>You know other tricks to make HTML parsing more robust? Then please leave them in the comments.</div>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/qbBDZE3lEAY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2010/02/robust-html-parsing-the-groovy-way/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2010/02/robust-html-parsing-the-groovy-way/</feedburner:origLink></item>
		<item>
		<title>Launchbar: Dialing phone numbers with Fritz!Box Part 2</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/lAlQkluvKVY/</link>
		<comments>http://www.maclovin.de/2010/02/launchbar-dialing-phone-numbers-with-fritzbox-part-2/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 21:25:46 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[launchbar]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=458</guid>
		<description><![CDATA[This is a follow-up article of Launchbar: Dialing phone numbers with Fritz!Box, where I explained how to use Launchbar for dialing phone numbers via FritzBox. Meanwhile, AVM has changed the login procedure and the original script no longer works. With the help of this example, it&#8217;s finally doing its job again. Special thanks go to [...]]]></description>
			<content:encoded><![CDATA[<p>This is a follow-up article of <a href="http://www.maclovin.de/2009/05/launchbox-dialing-phone-numbers-with-fritzbox-applescript/" target="_self">Launchbar: Dialing phone numbers with Fritz!Box</a>, where I explained how to use Launchbar for dialing phone numbers via FritzBox.</p>
<p>Meanwhile, AVM has changed the login procedure and the original script no longer works. With the help of <a href="http://wehavemorefun.de/fritzbox/Hilfsprogramme_/_Tipps_&amp;_Tricks#Anrufliste_von_der_Box_holen_.28Beispiel_f.C3.BCr_neues_Loginverfahren_mit_SID.29" target="_blank">this example</a>, it&#8217;s finally doing its job again.</p>
<p>Special thanks go to Christopher Füseschi (ICQ 40520202) for pointing me to this issue and also for doing final tests.</p>
<p>You can download the updated script <a href="http://www.maclovin.de/wp-content/uploads/2010/02/dial-with-fritzbox.scpt">here</a>.</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/lAlQkluvKVY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2010/02/launchbar-dialing-phone-numbers-with-fritzbox-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2010/02/launchbar-dialing-phone-numbers-with-fritzbox-part-2/</feedburner:origLink></item>
		<item>
		<title>WordPress Plugin SyntaxHL-Editor officially released</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/3kOZABM6G84/</link>
		<comments>http://www.maclovin.de/2009/10/wordpress-plugin-syntaxhl-editor-officially-released/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 16:52:46 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[syntaxhl-editor]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=431</guid>
		<description><![CDATA[I&#8217;m proud to announce the official release of my first WordPress plugin: SyntaxHL-Editor. It offers an easy to use graphical user interface for Syntax Highlighter and Code Colorizer for WordPress. You can easily enter and modify source-code highlighted in your posts as well as specify options for every single snippet. The plugin is also hosted at [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce the official release of my first WordPress plugin: SyntaxHL-Editor.</p>
<p>It offers an easy to use graphical user interface for <a href="http://www.lastengine.com/syntax-highlighter-wordpress-plugin/" target="_blank">Syntax Highlighter and Code Colorizer for WordPress</a>. You can easily enter and modify source-code highlighted in your posts as well as specify options for every single snippet.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/08/syntaxhl-editor-1.png"><img class="aligncenter size-medium wp-image-378" title="SyntaxHL Editor toolbar button" src="http://www.maclovin.de/wp-content/uploads/2009/08/syntaxhl-editor-1-500x77.png" alt="SyntaxHL Editor toolbar button" width="500" height="77" /></a></p>
<p>The plugin is also hosted at the <a href="http://wordpress.org/extend/plugins/syntaxhl-editor/" target="_blank">WordPress plugin database</a>. More information as well as the download can be found on the <a href="http://www.maclovin.de/syntaxhl-editor/">project specific site</a>. If you discover a bug, then please report it in the comments.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/08/syntaxhl-editor-2.png"><img class="aligncenter size-medium wp-image-379" title="SyntaxHL Editor input form" src="http://www.maclovin.de/wp-content/uploads/2009/08/syntaxhl-editor-2-500x273.png" alt="SyntaxHL Editor input form" width="500" height="273" /></a></p>
<p>I wish you a lot of fun with the plugin and hope you like it as much as I do. If you&#8217;ve got some feedback, please write it in the comments on this or the project page.</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/3kOZABM6G84" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2009/10/wordpress-plugin-syntaxhl-editor-officially-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2009/10/wordpress-plugin-syntaxhl-editor-officially-released/</feedburner:origLink></item>
		<item>
		<title>Make Time Machine backups bootable</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/3E9O0dhwYxY/</link>
		<comments>http://www.maclovin.de/2009/09/make-time-machine-backups-bootable/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 18:06:58 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=400</guid>
		<description><![CDATA[Time Machine is a great backup application shipped with Mac OS X Leopard and Snow Leopard. You can either restore single files in your running OS X or do a full system restore by booting the OS X install DVD. Using the latter method, it would be nice to boot directly from your backup drive [...]]]></description>
			<content:encoded><![CDATA[<p>Time Machine is a great backup application shipped with Mac OS X Leopard and Snow Leopard. You can either restore single files in your running OS X or do a full system restore by booting the OS X install DVD. Using the latter method, it would be nice to boot directly from your backup drive and not to be dependent on the install DVD. Here is a short guide how to achieve this.</p>
<p>We will first create a new partition on the backup drive, then clone the install DVD to this partition and finally boot from the external hard disk.</p>
<p><span id="more-400"></span></p>
<h5>Add new partition</h5>
<p>First of all, we need a new partition on the backup drive to boot from. Thanks to the OS X disk utility, this is quite easy. I use an SATA drive with 1 TB capacity living in a <a title="Sharkoon Quickport Pro" href="http://www.sharkoon.com/html/produkte/externe_gehaeuse/sata_quickport_pro/index_en.html?id=11" target="_blank">Sharkoon Quickport Pro</a> connected via USB. So fire up disk utility, select your backup drive and open the Partition tab.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/09/Disk-utility-partition-tab.png"><img class="aligncenter size-medium wp-image-401" title="Disk utility partition tab" src="http://www.maclovin.de/wp-content/uploads/2009/09/Disk-utility-partition-tab-500x391.png" alt="Disk utility partition tab" width="500" height="391" /></a></p>
<p>As you can see, there is already plenty of space used on the drive, but that&#8217;s no problem at all, as disk utility can resize partitions. Just drag the lower right corner of the partition upwards until it frees the space you need. I set up a 10 GB partition. Finally apply the changes.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/09/Disk-utility-create-partition.png"><img class="aligncenter size-medium wp-image-402" title="Disk utility create partition" src="http://www.maclovin.de/wp-content/uploads/2009/09/Disk-utility-create-partition-500x394.png" alt="Disk utility create partition" width="500" height="394" /></a></p>
<h5>Clone Install DVD to new partition</h5>
<p>Next we clone the install DVD (Snow Leopard in my case) to the new partition. Insert the DVD, select your new partition in disk utility and go to <em>Restore</em>. Drag the <em>Mac OS X Install DVD</em> to source and your new partition on the backup drive to target. Then click on restore and wait.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/09/Disk-utility-restore-from-image.png"><img class="aligncenter size-medium wp-image-403" title="Disk utility restore from image" src="http://www.maclovin.de/wp-content/uploads/2009/09/Disk-utility-restore-from-image-500x394.png" alt="Disk utility restore from image" width="500" height="394" /></a></p>
<p>That&#8217;s all you need to do. Let&#8217;s try to boot.</p>
<h5>Boot from the backup drive</h5>
<p>Finally, reboot your Mac and hold down <em>option key</em> on startup. If everything went well, the new partition appears in the list of bootable devices. Select it and be amazed how fast you enter the OS X setup.</p>
<h4><span style="font-weight: normal;"><strong><br />
</strong></span></h4>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/3E9O0dhwYxY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2009/09/make-time-machine-backups-bootable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2009/09/make-time-machine-backups-bootable/</feedburner:origLink></item>
		<item>
		<title>Using WordPress as URL redirection service</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/KdYWVnWOMEE/</link>
		<comments>http://www.maclovin.de/2009/08/using-wordpress-as-url-redirection-service/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 09:28:18 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=359</guid>
		<description><![CDATA[Redirection is a WordPress plugin that let&#8217;s you add URL redirections to your blog. This is very useful if the addess of some or even all of your blog posts changed. The setup is straight forward: just enter source and target URL and the redirection is set up. The more advanced users can even add redirections [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Redirection" href="http://urbangiraffe.com/plugins/redirection/" target="_blank">Redirection</a> is a WordPress plugin that let&#8217;s you add URL redirections to your blog. This is very useful if the addess of some or even all of your blog posts changed. The setup is straight forward: just enter source and target URL and the redirection is set up. The more advanced users can even add redirections based on regular expressions.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/08/redirection.png"><img class="aligncenter size-medium wp-image-368" title="Redirection for WordPress" src="http://www.maclovin.de/wp-content/uploads/2009/08/redirection-500x131.png" alt="Redirection for WordPress" width="500" height="131" /></a></p>
<p>I (mis)used this plugin to setup short URLs to my profiles on social networks. I own the domain <a title="Frommknecht.net" href="http://www.frommknecht.net" target="_blank">frommknecht.net</a>, which happens to be my surname followed by the .net extension. So I thought it would be a great idea to forward <a title="Facebook" href="http://frommknecht.net/fb" target="_blank">frommknecht.net/fb</a> to my Facebook profile, <a title="Twitter" href="http://frommknecht.net/twitter" target="_blank">frommknecht.net/twitter</a> to my Twitter page and so on. With Redirection, that&#8217;s very easy. Just go to the Redirection-settings, enter e.g. <em>/twitter</em> as &#8220;Source URL&#8221; and the link to your Twitter page as target. That&#8217;s all. After adding the redirection, your Twitter page will be available via <em>http://&lt;your-blog-url&gt;/twitter</em>.</p>
<p>This way, you could even use WordPress as your private short-URL service ala <a title="Bit.ly" href="http://bit.ly" target="_blank">bit.ly</a>.</p>
<p>You have other cool tipps for Redirection? Then please leave a comment.</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/KdYWVnWOMEE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2009/08/using-wordpress-as-url-redirection-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2009/08/using-wordpress-as-url-redirection-service/</feedburner:origLink></item>
		<item>
		<title>Logitech G5 Laser mouse on Mac OS X (updated)</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/odtDZPk19bU/</link>
		<comments>http://www.maclovin.de/2009/08/logitech-g5-laser-mouse-on-mac-os-x/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:56:46 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=348</guid>
		<description><![CDATA[I recently bought Logitech&#8217;s G5 Laser mouse. It&#8217;s meant to be a gamer mouse but is also great for daily work. The only problem for us OSX users is that Logitech in contrast to most of its devices doesn&#8217;t offer drivers. The mouse works just fine out of the box without any proprietary driver, but [...]]]></description>
			<content:encoded><![CDATA[<p>I recently bought <a title="Logitech G5 Laser mouse" href="http://www.logitech.com/index.cfm/mice_pointers/mice/devices/359" target="_blank">Logitech&#8217;s G5 Laser mouse</a>. It&#8217;s meant to be a gamer mouse but is also great for daily work. The only problem for us OSX users is that Logitech in contrast to most of its devices doesn&#8217;t offer drivers. The mouse works just fine out of the box without any proprietary driver, but you can&#8217;t reassign buttons. Luckily, there is third party software addressing this issue.</p>
<h5><span id="more-348"></span>SteerMouse</h5>
<p>First I tried <a title="SteerMouse" href="http://plentycom.jp/en/steermouse/" target="_blank">SteerMouse</a> from Plentycom-Systems. It&#8217;s a solid and stable piece of Software with a fair price of $20. You can easily reassign mouse buttons, fine-tune tracking speed and much more. But there is a major drawback: the mouse sensibility can no longer be changed on the device. Because I like this feature very much, the search went on.</p>
<h5>USB Overdrive</h5>
<p>The second tool was <a title="USB Overdrive" href="http://www.usboverdrive.com/USBOverdrive/" target="_blank">USB Overdrive</a> by Alessandro Levi Montalcini, also priced at $20. This tool is equally easy to use, offers reassignment of mouse buttons, but without disabling the sensibility adjustments. So that&#8217;s the way I go.</p>
<h5>Summary</h5>
<p>Both tools, SteerMouse and USB Overdrive let you reassign buttons on the Logitech G5. They work equally stable (that&#8217;s at least my impression) and cost exactly the same. While SteerMouse has the nicer interface and was updated more recently, USB Overdrive let&#8217;s you still change the sensibility on the mouse. So it really depends if you want to use the later feature or not. If so, you have to use USB Overdrive, choose SteerMouse otherwise.</p>
<p><strong>Update:</strong> USB Overdrive also works in Snow Leopard, even without updating to version 3.0</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/odtDZPk19bU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2009/08/logitech-g5-laser-mouse-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2009/08/logitech-g5-laser-mouse-on-mac-os-x/</feedburner:origLink></item>
		<item>
		<title>My Top 3 Finder Toolbar Scripts</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/iScYOZZLQfg/</link>
		<comments>http://www.maclovin.de/2009/07/my-top-3-finder-toolbar-scripts/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 19:37:32 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Main]]></category>
		<category><![CDATA[finder]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=326</guid>
		<description><![CDATA[With Leopard&#8217;s Finder, you can not only add applications to the toolbar, but also scripts. That&#8217;s an extremely useful feature I use every day and so I put together an introduction to my favorite three. But let&#8217;s first talk about the installation. That&#8217;s pretty easy. Just extract the downloaded archive, copy the script to an [...]]]></description>
			<content:encoded><![CDATA[<p>With Leopard&#8217;s Finder, you can not only add applications to the toolbar, but also scripts. That&#8217;s an extremely useful feature I use every day and so I put together an introduction to my favorite three.</p>
<p><a href="http://www.maclovin.de/wp-content/uploads/2009/07/finder-toolbar.png"><img class="aligncenter size-medium wp-image-327" title="Finder with toolbar scripts" src="http://www.maclovin.de/wp-content/uploads/2009/07/finder-toolbar-500x71.png" alt="Finder with toolbar scripts" width="500" height="71" /></a></p>
<p>But let&#8217;s first talk about the installation. That&#8217;s pretty easy. Just extract the downloaded archive, copy the script to an arbitrary location and then drag it to Finder&#8217;s toolbar. That&#8217;s all. Now let the fun begin.</p>
<p><span id="more-326"></span></p>
<h5>Open in Textmate</h5>
<p><a title="Textmate" href="http://macromates.com/" target="_blank">Textmate</a> is my favorite text editor. I use it a lot and so the <a title="Open in Textmate" href="http://henrik.nyh.se/2007/10/open-in-textmate-from-leopard-finder" target="_blank">Open in Textmate</a> script comes in handy. It allows you to open the selected file directly in Textmate or if none is selected, open the whole directory for tabbed browsing.</p>
<h5>Enhanced Open in Terminal Here</h5>
<p>This <a title="Enhanced Open in Terminal" href="http://maururu.net/2007/enhanced-open-terminal-here-for-leopard/" target="_blank">script</a> opens a Terminal window and changes to the directory shown in Finder. Very useful, but because it&#8217;s enhanced, it can do even more. Holding the Command-Key while clicking on the button opens a new tab instead of a new Terminal window. The Option-Key tries to recylcle an already running Terminal session and just changes to the directory. However, if this fails because the session is busy executing a program, a new window is created instead.</p>
<h5>LSelect</h5>
<p>Last but not least: <a title="LSelect" href="http://anoved.net/software/lselect/" target="_blank">LSelect</a>. This script opens a dialog box where you can enter a globbing pattern like &#8220;*.jpg&#8221; and hitting enter selects all files with extension JPG. I think, you got the idea. It&#8217;s extremely useful for moving or deleting multiple files.</p>
<p>These were my top 3 Finder toolbar scripts making my daily work so much easier. If you happen to know scripts worth mentioning, then please leave a comment.</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/iScYOZZLQfg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2009/07/my-top-3-finder-toolbar-scripts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2009/07/my-top-3-finder-toolbar-scripts/</feedburner:origLink></item>
		<item>
		<title>Batch renaming files in shell</title>
		<link>http://feedproxy.google.com/~r/Maclovin/~3/B5EDG0VqoII/</link>
		<comments>http://www.maclovin.de/2009/06/batch-renaming-files-in-shell/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 11:05:38 +0000</pubDate>
		<dc:creator>Dennis</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.maclovin.de/?p=300</guid>
		<description><![CDATA[Did you ever have to rename a lot of files using a similar pattern? And did you end up sitting in front of Finder or whatever your favorite file manager is and stripped of a certain prefix from the file-name or changed the extension? Well, I did. But as long as you have a terminal [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever have to rename a lot of files using a similar pattern? And did you end up sitting in front of Finder or whatever your favorite file manager is and stripped of a certain prefix from the file-name or changed the extension? Well, I did. But as long as you have a terminal at hand, you can do better. Here is how.<span id="more-300"></span></p>
<h5>Adjusting a prefix</h5>
<p>Let&#8217;s say you want to rename your ripped Futurama episodes. The current naming convention is<em> &#8220;Futurama 02&#215;12 Raging Bender.mp4&#8243;.</em> So it&#8217;s Futurama followed by a space and the season-episode identifier (season 2, episode 12), then the episode&#8217;s name and finally the extension.</p>
<p>First of all, we strip off &#8220;Futurama&#8221; and the space, because all the files are stored in a directory named &#8220;Futurama&#8221;, so we don&#8217;t need that info in the file-name anymore.</p>
<pre class="brush: bash">for i in Futurama*; do mv "$i" "${i##Futurama }"; done</pre>
<p>What we do here is to loop over all files in the current directory that start with &#8220;Futurama&#8221; and assign the file-name to the variable <em>$i</em>. We use <em>$i</em> as parameter to the <em>mv</em> command for actually renaming the file. The interesting part is its second parameter, <em>${i##Futurama }</em></p>
<p>Here we apply a modifier to the variable $i, which adjusts the returned value, but not the variable&#8217;s value itself. In this case, the modifier is <strong>##</strong> which removes a certain prefix from the variable, &#8220;Futurama &#8221; (including the space), leaving &#8220;02&#215;12 Raging Bender.mp4&#8243;.</p>
<p>Make sure to surround both parameters by quotation marks, because the file names may contain spaces.</p>
<h5>Modifying the suffix</h5>
<p>Now that we have removed the leading &#8220;Futurama &#8220;, we want to adjust the <em>mp4</em>-extension. iTunes prefers m4v, so let&#8217;s change this.</p>
<pre class="brush: bash">for i in *.mp4; do mv "$i" "${i%mp4}m4v"; done</pre>
<p>It&#8217;s very similar to what we did in the first part, except that we loop over all mp4-files and use a different variable modifier.</p>
<p>The <strong>%</strong> modifier removes the given text from the end of the variable&#8217;s value, so <em>${i%mp4}</em> removes the mp4-extension, returning <em>&#8220;02&#215;12 Raging Bender.&#8221;</em>. To add the new m4v-extension, we just include it after the braces.</p>
<p>That&#8217;s all, the files are renamed the way we wanted to. There are two tips when using this way to rename files. First of all, put the file-name in quotation marks, otherwise you will run into problems if files contain spaces, leading to undesired behaviour or errors in the best case, to loss of data in the worst case. And the second recommendation is to <em>echo</em> out the result first before actually using <em>mv</em>, just to make sure the modifier produces the expected result.</p>
<p>Do you have other tips for batch renaming files? Please explain them in the comments.</p>
<img src="http://feeds.feedburner.com/~r/Maclovin/~4/B5EDG0VqoII" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.maclovin.de/2009/06/batch-renaming-files-in-shell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.maclovin.de/2009/06/batch-renaming-files-in-shell/</feedburner:origLink></item>
	</channel>
</rss>

