<?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>nerdnotes.org &#187; bash</title>
	<atom:link href="http://nerdnotes.org/category/nerdnotes/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdnotes.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 17 Dec 2010 22:55:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Two ways of generating white noise</title>
		<link>http://nerdnotes.org/2009/01/two-ways-of-generating-white-noise/</link>
		<comments>http://nerdnotes.org/2009/01/two-ways-of-generating-white-noise/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 11:46:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2009/01/14/two-ways-of-generating-white-noise/</guid>
		<description><![CDATA[Goal: generate a white noise .wav fille of 1.5 hours In matlab: % create a matrix with random values: >> noise = 2 * rand(90 * 60 * 44100, 2, 'double') - 1; % write the wav file with a sample frequency o 44.1kHz >> wavwrite(noise, 44100, 16, 'noise.wav'); This process takes a while and [...]]]></description>
			<content:encoded><![CDATA[<p>Goal: generate a white noise .wav fille of 1.5 hours<br />
In matlab:</p>
<p><code><br />
% create a matrix with random values:<br />
>> noise = 2 * rand(90 * 60 * 44100, 2, 'double') - 1;</p>
<p>% write the wav file with a sample frequency o 44.1kHz<br />
>> wavwrite(noise, 44100, 16, 'noise.wav');<br />
</code><br />
This process takes a while and it consumes quite some of your system RAM.</p>
<p>More efficient, in bash:<br />
<code><br />
$ dd if=/dev/urandom count=5400 bs=176400 | sox -s -c 2 -r 44100 -t raw -w - noise.wav<br />
</code><br />
This took only 2 minutes!</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2009/01/two-ways-of-generating-white-noise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove duplicate files</title>
		<link>http://nerdnotes.org/2008/12/remove-duplicate-files/</link>
		<comments>http://nerdnotes.org/2008/12/remove-duplicate-files/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 12:24:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://nerdnotes.org/2008/12/03/remove-duplicate-files/</guid>
		<description><![CDATA[This is a slightly modified version of the script published here. It allows you to scan files for duplicates based on md5 checksums. The script is safe to use, it is not able to actually delete files itself. Instead, it generates a script that does the risky stuff. Usage To see what files are marked [...]]]></description>
			<content:encoded><![CDATA[<p>This is a slightly modified version of the script published <a href="http://elonen.iki.fi/code/misc-notes/remove-duplicate-files/">here</a>. It allows you to scan files for duplicates based on md5 checksums.</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/bash
# rd - remove dupliactes

# find the files using the specified 'find arguments'
find &quot;$@&quot; -type f -print0 |

# calculate checksum for each file
xargs -0 -n1 md5sum |

# sort on the checksum
sort --key=1,32 |

# show remove command for each duplicate file
awk 'dup[$1]++{print &quot;rm -f &quot; $2}'

exit 0
</pre>
<p>The script is safe to use, it is not able to actually delete files itself. Instead, it generates a script that does the risky stuff.</p>
<p><strong>Usage</strong><br />
To see what files are marked as duplicate in the current working directory:</p>
<pre class="brush: css; title: ; notranslate">
$ rd .
rm -f ./config_backup_2008-11-06_11.30.01.tar.bz2
rm -f ./config_backup_2008-11-07_11.30.01.tar.bz2
rm -f ./config_backup_2008-11-08_11.30.01.tar.bz2
</pre>
<p>If you like the result, you can execute the generated commands. This can by piping the output to the shell:</p>
<pre class="brush: css; title: ; notranslate">
$ rd . | sh
</pre>
<p>Processing the rd command might take some time. So you can also copy and paste the output in the terminal when there are a lot of (big) files.<br />
Since the script passes all arguments to the find command. It&#8217;s also possible to fine tune the find command. For example, you only want to remove duplicates in the current directory, without searching in sub directories:</p>
<pre class="brush: css; title: ; notranslate">
#  rd . -maxdepth 1
</pre>
<p>I&#8217;m using the script to remove duplicate backup sets.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2008/12/remove-duplicate-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>vmcp</title>
		<link>http://nerdnotes.org/2007/12/vmcp/</link>
		<comments>http://nerdnotes.org/2007/12/vmcp/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 19:55:17 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://45</guid>
		<description><![CDATA[Vmcp (vm-copy) is a simple script that allows you to copy/clone a VMware virtual computer image. Just specify the source directory and the destination directory. It will first just copy the wmware directory recursively en then change the configuration option &#8216;displayName&#8217; in the vmx file.]]></description>
			<content:encoded><![CDATA[<p>Vmcp (vm-copy) is a simple script that allows you to copy/clone a VMware virtual computer image. Just specify the source directory and the destination directory. It will first just copy the wmware directory recursively en then change the configuration option &#8216;displayName&#8217; in the vmx file.</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/sh

source=$1
dest=$2

echo copying virtual machine
cp -rv $source $dest

vmxsourcefile=`ls $source/*.vmx`
vmxdestfile=`ls $dest/*.vmx`

grep -v displayName $vmxsourcefile &gt; $vmxdestfile
echo displayName = \&quot;$dest\&quot; &gt;&gt; $vmxdestfile

exit 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/12/vmcp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preparing plogger thumbnails</title>
		<link>http://nerdnotes.org/2007/10/preparing-plogger-thumbnails/</link>
		<comments>http://nerdnotes.org/2007/10/preparing-plogger-thumbnails/#comments</comments>
		<pubDate>Fri, 12 Oct 2007 09:08:41 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://90</guid>
		<description><![CDATA[I recently started to use Plogger to publish family pictures. The photo blogger package is nice, but still in beta stage. The latter doesn&#8217;t go unnoticed when setting it up. One of the things that has been bothering me is the fact that thumbnails are not only generated during import, but also during the first [...]]]></description>
			<content:encoded><![CDATA[<p>I recently started to use <a href="http://www.plogger.org">Plogger</a> to publish family pictures. The photo blogger package is nice, but still in beta stage. The latter doesn&#8217;t go unnoticed when setting it up.</p>
<p>One of the things that has been bothering me is the fact that thumbnails are not only generated during import, but also during the first visit of the new albums. Especially on my very slow web host, it can take up to minutes to view a single picture that hasn&#8217;t been processed before.</p>
<p>A solution is a <a href="http://nerdnotes.org/plog-browse">shell script</a> that finds out what pages to download after adding a new set of pictures. It will then download those pages, forcing Plogger to generate all the necessary cache files. The script should be executed form the web server itself. It requires 3 lines (upper part of the script) of configuration: the url and filesystem path to the plogger installation and a log file that keeps track of the url&#8217;s already downloaded. If you want to redo the downloading, just remove this log file.</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/10/preparing-plogger-thumbnails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reminder: Local documentation!</title>
		<link>http://nerdnotes.org/2007/09/reminder-local-documentation/</link>
		<comments>http://nerdnotes.org/2007/09/reminder-local-documentation/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 19:23:01 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://89</guid>
		<description><![CDATA[I&#8217;ve been searching for some &#8216;getopt&#8217; examples on the internet. Many tutorials show the same basic tricks. I completely looked over the local documentation, which in fact has very nice examles for bash and tcsh:]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been searching for some &#8216;getopt&#8217; examples on the internet. Many tutorials show the same basic tricks. I completely looked over the local documentation, which in fact has very nice examles for bash and tcsh:</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/bash

# A small example program for using the new getopt(1) program.
# This program will only work with bash(1)
# An similar program using the tcsh(1) script language can be found
# as parse.tcsh

# Example input and output (from the bash prompt):
# ./parse.bash -a par1 'another arg' --c-long 'wow!*\?' -cmore -b &quot; very long &quot;
# Option a
# Option c, no argument
# Option c, argument `more'
# Option b, argument ` very long '
# Remaining arguments:
# --&gt; `par1'
# --&gt; `another arg'
# --&gt; `wow!*\?'

# Note that we use `&quot;$@&quot;' to let each command-line parameter expand to a
# separate word. The quotes around `$@' are essential!
# We need TEMP as the `eval set --' would nuke the return value of getopt.
TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
     -n 'example.bash' -- &quot;$@&quot;`

if [ $? != 0 ] ; then echo &quot;Terminating...&quot; &gt;&amp;2 ; exit 1 ; fi

# Note the quotes around `$TEMP': they are essential!
eval set -- &quot;$TEMP&quot;

while true ; do
        case &quot;$1&quot; in
                -a|--a-long) echo &quot;Option a&quot; ; shift ;;
                -b|--b-long) echo &quot;Option b, argument \`$2'&quot; ; shift 2 ;;
                -c|--c-long)
                        # c has an optional argument. As we are in quoted mode,
                        # an empty parameter will be generated if its optional
                        # argument is not found.
                        case &quot;$2&quot; in
                                &quot;&quot;) echo &quot;Option c, no argument&quot;; shift 2 ;;
                                *)  echo &quot;Option c, argument \`$2'&quot; ; shift 2 ;;
                        esac ;;
                --) shift ; break ;;
                *) echo &quot;Internal error!&quot; ; exit 1 ;;
        esac
done
echo &quot;Remaining arguments:&quot;
for arg do echo '--&gt; '&quot;\`$arg'&quot; ; done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/09/reminder-local-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL re-installation</title>
		<link>http://nerdnotes.org/2007/08/mysql-re-installation/</link>
		<comments>http://nerdnotes.org/2007/08/mysql-re-installation/#comments</comments>
		<pubDate>Sat, 04 Aug 2007 13:17:33 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://87</guid>
		<description><![CDATA[De-installation is sometimes not so easy with APT. For example when you screwed up your mysql installation or lost mysql passwords you may want to reinstall mysql and start from scratch again. You probably installed mysql server using: Then you might think that you need this command for removal: However, this is not the case. [...]]]></description>
			<content:encoded><![CDATA[<p>De-installation is sometimes not so easy with APT. For example when you screwed up your mysql installation or lost mysql passwords you may want to reinstall mysql and start from scratch again. You probably installed mysql server using:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get install mysql-server
</pre>
<p>Then you might think that you need this command for removal:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get remove mysql-server
</pre>
<p>However, this is not the case. The mysql-server package is a sort of meta-package that makes sure that the latest (and greatest) available mysql server version will be installed. Currently, this means that you actually installed mysql-server version 5.0. Above command will only remove the meta-package, while mysql server 5 happily continues running on your system. To de-install the mysql-server, remove the package, the meta package pulled in:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get remove mysql-server-5.0
</pre>
<p>To also remove the configuration and the binary data, use instead:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get remove --purge mysql-server-5.0
# and for ubuntu Gutsy:
$ sudo apt-get purge mysql-server-5.0
</pre>
<p>Now that mysql server is &#8216;really&#8217; gone, you can start over and install the mysql-server package:</p>
<pre class="brush: css; title: ; notranslate">
$ sudo apt-get install mysql-server
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/08/mysql-re-installation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8216;Compact&#8217; bash prompt</title>
		<link>http://nerdnotes.org/2007/07/compact-bash-prompt/</link>
		<comments>http://nerdnotes.org/2007/07/compact-bash-prompt/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 20:47:25 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://86</guid>
		<description><![CDATA[Especially when working with cakephp, the following line in your .bash_profile script might come in handy: It will print out the current working directory on the first line and the actual bash prompt on the second line. Making it less likely that your command will wrap lines after the first few typed characters. It changes [...]]]></description>
			<content:encoded><![CDATA[<p>Especially when working with cakephp, the following line in your .bash_profile script might come in handy:</p>
<pre class="brush: css; title: ; notranslate">
HOSTCOLOR=&quot;31m&quot;
PS1=&quot;\u@\[\e[${HOSTCOLOR}\]\h\[\e[0m\]:\w\n\[\e[33m\]\!\[\e[0m\] \$ &quot;
</pre>
<p>It will print out the current working directory on the first line and the actual bash prompt on the second line. Making it less likely that your command will wrap lines after the first few typed characters.<br />
It changes the command prompt from:</p>
<p><img id="image112" src="http://nerdnotes.org/wp-content/uploads/2007/07/cmdline-long.png" alt="command line long" /></p>
<p>&#8230;.into:</p>
<p><img id="image110" src="http://nerdnotes.org/wp-content/uploads/2007/07/cmdline-short.png" alt="command line 'short'" /></p>
<p>The login prompt now shows the following info:</p>
<ul>
<li>username</li>
<li>hostname in red (in my bash script, it will print red for one group of servers and blue for other servers)</li>
<li>current working directory</li>
<li>command history number, ie: use !520 to execute the previous command</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/07/compact-bash-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extracting layers from a XCF (gimp) file</title>
		<link>http://nerdnotes.org/2007/07/extracting-layers-from-a-xcf-gimp-file/</link>
		<comments>http://nerdnotes.org/2007/07/extracting-layers-from-a-xcf-gimp-file/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 22:15:05 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://83</guid>
		<description><![CDATA[This is a script that extracts the layers of a XCF file to individual PNG files. It uses xcftools (debian/ubuntu package):]]></description>
			<content:encoded><![CDATA[<p>This is a <a href="http://nerdnotes.org/scripts/xtractlayers.sh.php">script</a> that extracts the layers of a XCF file to individual PNG files. It uses xcftools (debian/ubuntu package):</p>
<pre class="brush: css; title: ; notranslate">
#!/bin/bash

xcffile=$1

layers=`xcfinfo $xcffile  | awk '{ print $NF }'`

destdir=`dirname $xcffile`/layers
mkdir $destdir

for layer in $layers
do
        echo saving $layer to $destdir/$layer.png
        xcf2png -o $destdir/$layer.png $xcffile $layer
done

exit 0
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2007/07/extracting-layers-from-a-xcf-gimp-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Batch conversion of images</title>
		<link>http://nerdnotes.org/2006/12/batch-conversion-of-images/</link>
		<comments>http://nerdnotes.org/2006/12/batch-conversion-of-images/#comments</comments>
		<pubDate>Fri, 15 Dec 2006 10:27:03 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nerdnotes]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://73</guid>
		<description><![CDATA[For batch image conversion, file renaming, etc, I usually use these kind of one-liners: When you&#8217;re satisfied with the result, have it executed by the shell:]]></description>
			<content:encoded><![CDATA[<p>For batch image conversion, file renaming, etc, I usually use these kind of one-liners:</p>
<pre class="brush: css; title: ; notranslate">
$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done
convert screendump_01.bmp screendump_01.png
convert screendump_02.bmp screendump_02.png
convert screendump_03.bmp screendump_03.png
</pre>
<p>When you&#8217;re satisfied with the result, have it executed by the shell:</p>
<pre class="brush: css; title: ; notranslate">
$ for i in `ls *.bmp` ; do echo convert $i ${i%.*}.png ;done | sh
</pre>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/12/batch-conversion-of-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scripting the Unscriptable</title>
		<link>http://nerdnotes.org/2006/10/scripting-the-unscriptable/</link>
		<comments>http://nerdnotes.org/2006/10/scripting-the-unscriptable/#comments</comments>
		<pubDate>Wed, 11 Oct 2006 21:49:44 +0000</pubDate>
		<dc:creator>Bram</dc:creator>
				<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[MS Windows]]></category>
		<category><![CDATA[nerdnotes]]></category>

		<guid isPermaLink="false">http://68</guid>
		<description><![CDATA[I&#8217;ve been looking for different ways to send keystrokes, mouse movements and clicks to GUI applications. Under Windows, this is straight forward with AutoIt. The BASIC-like language allows you to read files, start applications, send keystrokes move the mouse etc. A nice feature is to wait for certain dialogs, for example: This makes sure that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for different ways to send keystrokes, mouse movements and clicks to GUI applications. Under Windows, this is straight forward with AutoIt. The BASIC-like language allows you to read files, start applications, send keystrokes move the mouse etc. A nice feature is to wait for certain dialogs, for example:</p>
<pre class="brush: css; title: ; notranslate">
; wait for tightvnc window
WinWaitActive(&quot;New TightVNC Connection&quot;)
; send hostname and port number
Send($hostname &amp; &quot;:&quot; &amp; $displaynumber)
</pre>
<p>This makes sure that the keystrokes actually end up in the right window. Mouse coordinates can be specified relative to the application window. Using these features allows you to write &#8216;reasonably&#8217; robust code. But don&#8217;t expect your AutoIt script to run flawlessly on other PC&#8217;s. There are a lot of dependencies, like dialogs that look different in another version. Internationalization might cause the window title to read &#8220;Nieuwe TightVNC Verbinding&#8221; (Dutch) and the above code snippet will fail. Even user preferences like font sizes,  window themes and screen resolution might result in unexpected behavior.</p>
<p>Anyway, it&#8217;s just fun to figure out which sequences to send to an application and let it process a batch of documents!<br />
Ok, this works pretty nice under windows. But what about my favorite platform?<br />
<span id="more-68"></span><br />
I thought it couldn&#8217;t be difficult manipulating mouse clicks and keystrokes with the Penguin&#8230;<br />
Well, the most difficult task was collecting the required tools! I ended up with vnc and <a href="http://cyberelk.net/tim/rfbplaymacro/index.html">rfbplaymacro</a>.<br />
Let me explain <img src='http://nerdnotes.org/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . VNC uses the RFB (Remote FrameBuffer) protocol to remotely control another computer. While vncviewer (vnc client) is an interactive application (you interact with the remote computer as if you where sitting behind it), rfbplaymacro is &#8216;headless&#8217;. It allows you to send over the keystrokes and mouse clicks, but it doesn&#8217;t show you what happens. Instead of actually using your mouse and keyboard, rfbplaymacro expects a macro fed into stdin. The macro is a plain text list of mouse and keyboard events. The demo macro that is supplied with the <a href="http://cyberelk.net/tim/data/rfbplaymacro/stable/rfbplaymacro-0.2.2.tar.bz2">rfbplaymacro source code</a> displays an xclock for 10 seconds:</p>
<pre class="brush: css; title: ; notranslate">
RFM 001.000
password &quot;mypasswd123&quot;
pointer 100 20 delay 1s
type &quot;xclock -geometry +400+200 &amp;&quot;
press Return
type &quot;xkill&quot;
press Return
pointer 410 210 delay 10s
click 0
</pre>
<p>The first line tells the parser which of the possible macro versions is used. I&#8217;ve only seen just one version. The <tt>password</tt> statement is optional, it&#8217;s also possible to specify the password when playing the macro, see the next code snippet. This script assumes the remote desktop runs an xterminal in the upper left of the screen. By moving the mouse to the upper left (<tt>pointer 100 20</tt>), the xterm gets the input focus (depending on the window manager). After the mouse movement, the macro pauses for one second, specified by <tt>delay</tt>. Then the xclock is started in the background, by typing the <tt>xclock</tt> command and hitting return. Xkill is fired up in the same fashion. The mouse pointer is transformed in a deadly weapon! Another pointer instruction moves the cursor to xclock. The dangling &#8216;Sword of Damocles` is hanging for the full 10 seconds before final and deadly mouse click is sent.</p>
<p>To play back this rather useless, but illustrating macro, use:</p>
<pre class="brush: css; title: ; notranslate">
$ rfbplaymacro --server=linuxbox:9 &lt; test.rfm
</pre>
<p>This will connect to a running vncserver (desktop :9) on &#8216;linuxbox&#8217; and sends over the mouse and keyboard events specified in the marcro <tt>test.rfm</tt>. Connect a vncviewer to the same desktop and you will see it happen!</p>
]]></content:encoded>
			<wfw:commentRss>http://nerdnotes.org/2006/10/scripting-the-unscriptable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

