<?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>Random Wisdom &#187; tools</title>
	<atom:link href="http://scrolls.mafgani.net/tag/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://scrolls.mafgani.net</link>
	<description>An attempt at organizing my thoughts ...</description>
	<lastBuildDate>Sun, 13 Mar 2011 22:54:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Create links with absolute paths in Linux</title>
		<link>http://scrolls.mafgani.net/2010/01/create-links-with-absolute-paths-in-linux/</link>
		<comments>http://scrolls.mafgani.net/2010/01/create-links-with-absolute-paths-in-linux/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 19:10:18 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[file processing]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=420</guid>
		<description><![CDATA[The default behaviour of the linking command (ln) is a little strange under certain circumstances. Since it creates the links using the literal value of the target, symbolic links created using relative path structures can often fail. Consider the following: $ ln -s targetfile ../src/targetfile_link Without a doubt, &#8216;targetfile_link&#8217; will be a broken symlink since [...]]]></description>
			<content:encoded><![CDATA[<p>The default behaviour of the linking command (<strong>ln</strong>) is a little strange under certain circumstances. Since it creates the links using the literal value of the target, symbolic links created using relative path structures can often fail. Consider the following:</p>
<pre>$ ln -s targetfile ../src/targetfile_link</pre>
<p>Without a doubt, &#8216;targetfile_link&#8217; will be a broken symlink since it links to a target that it assumes is in the same directory:</p>
<pre>$ cd ../src &amp;&amp; ls -l targetfile_link
lrwxrwxrwx 1 mafgani mafgani 5 2010-01-16 18:19 targetfile_link -&gt; targetfile</pre>
<p>This is quite unfortunate since it clearly clashes with the way that the linking mechanism should work intuitively.</p>
<p>The solution is to force <strong>ln</strong> into automatically appending the absolute path to the target files. This can be achieved by using a simple shell script that acts as a wrapper for the real linking command:</p>
<pre style="color: #99ccff">
#!/bin/sh

# Step through the supplied arguments and append the absolute
# path to targets that exist
for ARG in $@
do
  if [ -e $ARG ]; then
    LNARGS="${LNARGS} ${PWD}/${ARG}";
  else
    LNARGS="${LNARGS} ${ARG}";
  fi
done

# Execute the actual link command with the modified args
exec /bin/ln ${LNARGS};
</pre>
<p>There are two known caveats:</p>
<ul>
<li> The link is &#8216;sub-optimal&#8217; if created from within the destination directory (the absolute path contains &#8216;../&#8217;s). It will still work however.</li>
<li>  The links will always be absolute. If that is undesirable, save the script as &#8216;absln&#8217; or something other than &#8216;ln&#8217;.</li>
</ul>
<p>Using &#8216;absln&#8217; instead of &#8216;ln&#8217; in the previously described scenario now produces a working symlink:</p>
<pre>$ absln -s targetfile ../src/targetfile_link
$ cd ../src/ &#038;&#038; ls -l targetfile_link
lrwxrwxrwx 1 mafgani mafgani 16 2010-01-16 19:13 targetfile_link -> /tmp/files/targetfile</pre>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2010/01/create-links-with-absolute-paths-in-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Graphics format conversion</title>
		<link>http://scrolls.mafgani.net/2009/12/graphics-format-conversion/</link>
		<comments>http://scrolls.mafgani.net/2009/12/graphics-format-conversion/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 01:28:02 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[eps]]></category>
		<category><![CDATA[file processing]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[sam2p]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=408</guid>
		<description><![CDATA[Up until now I have been using the &#8216;convert&#8216; tool that comes with ImageMagick to switch between image formats &#8212; mainly for creating EPS files from JPG/PNG (raster format) files for use with LaTeX. Then I came across sam2p. It is a light-weight utility that does one thing only and it does it well: convert [...]]]></description>
			<content:encoded><![CDATA[<p>Up until now I have been using the &#8216;<strong>convert</strong>&#8216; tool that comes with <a href="http://www.imagemagick.org">ImageMagick</a> to switch between image formats &#8212; mainly for creating EPS files from JPG/PNG (raster format) files for use with LaTeX. Then I came across <a href="http://code.google.com/p/sam2p/">sam2p</a>. </p>
<p>It is a light-weight utility that does one thing only and it does it well: convert between image formats. I&#8217;ve been using it for a while now and find that it can greatly reduce files sizes with minimal drop in quality. I&#8217;ve even used it to process existing EPS files just to get the reduction in file size. Best of all, it is multi-platform &#8212; executables are available for both Windows and Linux on the <a href="http://code.google.com/p/sam2p/">project homepage</a>.</p>
<p>Goodbye <strong>convert</strong> and hello <strong>sam2p</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2009/12/graphics-format-conversion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Realtime collaborative text editing</title>
		<link>http://scrolls.mafgani.net/2008/11/realtime-collaborative-text-editing/</link>
		<comments>http://scrolls.mafgani.net/2008/11/realtime-collaborative-text-editing/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 18:42:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[collaborative]]></category>
		<category><![CDATA[etherpad]]></category>
		<category><![CDATA[gobby]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=104</guid>
		<description><![CDATA[A while ago, I came across Etherpad. It a web based platform that allows multiple users to simultaneously edit a single text file. Since it doesn&#8217;t seem to support any kind of mark-up at the moment, it would seem that it&#8217;s not terribly useful for word processing tasks. Perhaps it&#8217;s good for real-time collaborative coding [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I came across <a href="http://etherpad.com/">Etherpad</a>. It a web based platform that allows multiple users to simultaneously edit a single text file. Since it doesn&#8217;t seem to support any kind of mark-up at the moment, it would seem  that it&#8217;s not terribly useful for word processing tasks. Perhaps it&#8217;s good for real-time collaborative coding and the creation of agenda type lists &#8230;</p>
<p>The software equivalent of Etherpad is <a href="http://gobby.0x539.de/trac/">Gobby</a>. It&#8217;s a multi-platform tool that claims to run on Microsoft Windows, Mac OS X, Linux and other Unix-like platforms &#8212; making it almost as flexible as a web-based service. There are a number of other advantages:</p>
<ul>
<li>Flexibility and security that comes from having absolute control over the sessions.</li>
<li>Syntax highlighting!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2008/11/realtime-collaborative-text-editing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re-encoding MP3 files using LAME</title>
		<link>http://scrolls.mafgani.net/2008/06/re-encoding-mp3-files-using-lame/</link>
		<comments>http://scrolls.mafgani.net/2008/06/re-encoding-mp3-files-using-lame/#comments</comments>
		<pubDate>Fri, 06 Jun 2008 14:41:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[transcoding]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=99</guid>
		<description><![CDATA[I have some MP3 files encoded at a constant bitrate of 320kbps that my phone seems to have trouble playing smoothly. So, I looked into LAME. The files I had were named using the following scheme: 01 - Title of track 01.mp3 02 - Title of track 02.mp3 ... I used the BASH for-loop construct [...]]]></description>
			<content:encoded><![CDATA[<p>I have some MP3 files encoded at a constant bitrate of 320kbps that my phone seems to have trouble playing smoothly. So, I looked into <a href="http://en.wikipedia.org/wiki/LAME">LAME</a>.</p>
<p>The files I had were named using the following scheme:</p>
<pre>
01 - Title of track 01.mp3
02 - Title of track 02.mp3
...
</pre>
<p>I used the BASH <span style="font-family: courier new;">for-loop</span> construct to process the files:</p>
<pre>
$ for A in *.mp3;\              # Process one mp3 at a time
  do B=${A%.mp3};\              # Extract track number and title
     C=${B#?? -};\              # Extract the title
     D=${B%% - *};\             # Extract the track number
     lame --vbr-new -V0 -q0\    # Variable-bitrate, high-quality
          --mp3input\           # Inputs are MP3 files
          --tt "$C"\            # ID3v2 tags: title
          --ta 'Artist Name'\   # ID3v2 tags: artist
          --tl 'Album Title'\   # ID3v2 tags: album
          --ty 2007\            # ID3v2 tags: year
          --tn "$D"\            # ID3v2 tags: track no.
          --tg 'GENRE'\         # ID3v2 tags: genre
          "$A" processed/"$A";\ # Keep filename and save in ./processed/
  done
</pre>
<p>Since no bit-rate bounds are explicitly provided, the re-encoded files can contain anything between 32kbps and 320kbps. The LAME man-page provides an extensive list of options and their meanings.</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2008/06/re-encoding-mp3-files-using-lame/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Blacklisting</title>
		<link>http://scrolls.mafgani.net/2007/11/ssh-blacklisting/</link>
		<comments>http://scrolls.mafgani.net/2007/11/ssh-blacklisting/#comments</comments>
		<pubDate>Thu, 29 Nov 2007 18:27:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[blacklist]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=94</guid>
		<description><![CDATA[After getting around 1500 failed ssh login attempts a day for a while on a server I manage, I decided to look into tools that automatically blacklist offending IPs. Sshblack fits the bill perfectly. A HOWTO (including an init-script) for REDHAT-like systems is available from the OSS Watch Wiki.]]></description>
			<content:encoded><![CDATA[<p>After getting around 1500 failed ssh login attempts a day for a while on a server I manage, I decided to look into tools that automatically blacklist offending IPs.</p>
<p><a href="http://www.pettingers.org/code/sshblack.html">Sshblack</a> fits the bill perfectly. A HOWTO (including an init-script) for REDHAT-like systems is available from the <a href="http://wiki.oss-watch.ac.uk/InstallingSshblack">OSS Watch Wiki</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2007/11/ssh-blacklisting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux and DVD Regions</title>
		<link>http://scrolls.mafgani.net/2007/04/linux-and-dvd-regions/</link>
		<comments>http://scrolls.mafgani.net/2007/04/linux-and-dvd-regions/#comments</comments>
		<pubDate>Thu, 12 Apr 2007 17:52:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[dvd region]]></category>
		<category><![CDATA[multimedia]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=84</guid>
		<description><![CDATA[Typically, Linux DVD playback software are capable of decrypting (libdvdcss must be installed) and playing back DVDs from any region, irrespective of the region code of the drive. Therefore, there should be no need to change the region code of the drive to watch discs from a different region. Regardless, there exists a very handy [...]]]></description>
			<content:encoded><![CDATA[<p>Typically, Linux DVD playback software are capable of decrypting (<span style="font-weight:bold;">libdvdcss</span> must be installed) and playing back DVDs from any region, irrespective of the region code of the drive. Therefore, there should be no need to change the region code of the drive to watch discs from a different region. Regardless, there exists a very handy program that allows the user to change the region code and view other relevant information such as the number of changes remaining. It is called &#8220;<span style="font-weight:bold;">regionset</span>&#8221; and is available for Fedora from the Extras repository. The project website is:</p>
<p><a href="http://linvdr.org/projects/regionset/">http://linvdr.org/projects/regionset/</a></p>
<p>There is also a useful article on Linux.com about DVD playback:</p>
<p><a href="http://www.linux.com/howtos/DVD-Playback-HOWTO/">DVD Playback HOWTO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2007/04/linux-and-dvd-regions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generate BibTeX Entry from IEEEXplore Citations</title>
		<link>http://scrolls.mafgani.net/2006/01/generate-bibtex-entry-from-ieeexplore-citations/</link>
		<comments>http://scrolls.mafgani.net/2006/01/generate-bibtex-entry-from-ieeexplore-citations/#comments</comments>
		<pubDate>Mon, 30 Jan 2006 11:18:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[How To ...]]></category>
		<category><![CDATA[LaTeX]]></category>
		<category><![CDATA[bibliography]]></category>
		<category><![CDATA[bibtex]]></category>
		<category><![CDATA[IEEE]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=52</guid>
		<description><![CDATA[Very useful: BibConverter v 1.5.3 [edited Aug 20, 2006]:The link now redirects to: BibConverter v. 3.0beta]]></description>
			<content:encoded><![CDATA[<p>Very useful:</p>
<p><a href="http://www.unik.no/%7Efauske/bibconverter/index.php">BibConverter v 1.5.3</a></p>
<p><span style="font-weight:bold;">[edited Aug 20, 2006]:</span><br />The link now redirects to:</p>
<p><a href="http://www.bibconverter.net/">BibConverter v. 3.0beta</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2006/01/generate-bibtex-entry-from-ieeexplore-citations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxy tools</title>
		<link>http://scrolls.mafgani.net/2006/01/proxy-tools/</link>
		<comments>http://scrolls.mafgani.net/2006/01/proxy-tools/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 12:10:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[anonymity]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=50</guid>
		<description><![CDATA[There&#8217;s a very nice list of servers here: Proxyz.net This Firefox extension is handy for changing Proxies quickly: SwitchProxy]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a very nice list of servers here:</p>
<p><a href="http://proxyz.net/index.php">Proxyz.net</a></p>
<p>This Firefox extension is handy for changing Proxies quickly: <a href="http://www.roundtwo.com/product/switchproxy">SwitchProxy</a></p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2006/01/proxy-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inkscape</title>
		<link>http://scrolls.mafgani.net/2005/09/inkscape/</link>
		<comments>http://scrolls.mafgani.net/2005/09/inkscape/#comments</comments>
		<pubDate>Sat, 17 Sep 2005 10:09:00 +0000</pubDate>
		<dc:creator>Mostafa</dc:creator>
				<category><![CDATA[Art]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[inkscape]]></category>
		<category><![CDATA[svg]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[vector graphics]]></category>

		<guid isPermaLink="false">http://scrolls.mafgani.net/?p=18</guid>
		<description><![CDATA[I installed Inkscape a few days ago out of pure curiosity. Today I&#8217;m glad that I did .. I needed to touch up some diagrams with a few translucent windows here and there and GIMP didn&#8217;t seem to have any easy of doing it. So came the first field test of Inkscape .. It works [...]]]></description>
			<content:encoded><![CDATA[<p>I installed <a href="http://www.inkscape.org/">Inkscape</a> a few days ago out of pure curiosity. Today I&#8217;m glad that I did .. I needed to touch up some diagrams with a few translucent windows here and there and GIMP didn&#8217;t seem to have any easy of doing it. So came the first field test of Inkscape ..</p>
<p><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3504/251/1600/opt_frame008b1.jpg"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3504/251/200/opt_frame008b.jpg" border="0" alt="" /></a></p>
<p>It works quite well &#8211; at least from the first impression. I can already see it giving MS Visio a run for its money &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://scrolls.mafgani.net/2005/09/inkscape/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

