<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="/xslt/html.xsl"?>
<page 
	title="software - various | robert klep" 
	keywords="mplayer, resume, less, lessopen, webarchive"
	>
	<content>

		<paragraph title="Various software">
			I'm a big fan of <i>Terminal.app</i> on Mac OS X, and use it all the
			time. During the years, I've made little scripts in various languages
			(shell, Perl, Python) to perform certain tasks. This page contains some
			of those scripts, since they might be useful to others besides me &#9786;
		</paragraph>

		<paragraph title="mplayer-resume">
			<link url="dl/mplayer-resume">mplayer-resume</link> is a zsh-script which
			wraps <link url="http://www.mplayerhq.hu/">mplayer</link> to keep track
			of the current playback position in the moviefile. When you stop playing,
			the position is saved and the next time you open the same moviefile,
			playback will be resumed at the saved location. I use this script on my
			<link url="http://mythtv.org">MythTV</link> frontends (specifically, with
			the <link url="http://www.mythtv.org/wiki/MythVideo">MythVideo</link>
			plug-in).
		</paragraph>

		<paragraph title="unwebarchive">
			<link url="dl/unwebarchive">unwebarchive</link> is a Perl-script to
			unpack <i>.webarchive</i> files written by Safari. A webarchive is
			a simple containerfile (in the form of a <i>property list</i> file,
			common to Mac OS X) which contains all (read: most) resources for
			a webpage to be able to browse that page offline.
		</paragraph>

		<paragraph title="lessopen">
			<link url="dl/lessopen">lessopen</link> is a Perl-script to enable the
			<i>less</i> fileviewer to interpret a whole bunch of different
			fileformats. For instance, if you use it to view a <i>.ZIP</i>-file, you
			get to see the contents of that .ZIP-file.
		</paragraph>
		<paragraph>
			To use this scripts, download it, save it somewhere (perhaps in
			<code>/usr/local/bin</code> or <code>/usr/bin</code>), and edit your
			shells startupfile (usually <code>~/.bashrc</code>) to include the
			following line:
			<pre>
export LESSOPEN=/usr/local/bin/lessopen
</pre>
			(assuming you saved it it <code>/usr/local/bin</code>).
		</paragraph>
		<paragraph>
			Reload the said startupfile (<code>source ~/.bashrc</code>) and see
			the intelligence of <i>less</i> increase!
		</paragraph>
		<paragraph>
			<b>Tip:</b> for most archivefiles (.ZIP, .TAR), you can view individual
			archivemembers by prepending <code>~FILENAME</code> to the commandline.
			For instance, if you want to view the file <code>README</code> in the
			.ZIP-file <code>somearchive.zip</code>, use this:
			<pre>
less somearchive.zip~README
</pre>
		</paragraph>
		<paragraph>
			<b>NB:</b> <i>lessopen</i> depends on several external programs which
			aren't commonly installed on Mac OS X. If you find that for certain
			files <i>lessopen</i> doesn't function, this might be the cause.
		</paragraph>

	</content>
</page>

