<?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"
	>

<channel>
	<title>Dr Jan's Tips From The Top &#187; unix</title>
	<atom:link href="http://www.dr-jan.com/tips/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dr-jan.com/tips</link>
	<description>Handy hints and techy tips from Dr Jan.</description>
	<pubDate>Sat, 08 Nov 2008 15:13:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Fedora 9 and KDE 4</title>
		<link>http://www.dr-jan.com/tips/2008/09/25/fedora-9-and-kde-4/</link>
		<comments>http://www.dr-jan.com/tips/2008/09/25/fedora-9-and-kde-4/#comments</comments>
		<pubDate>Thu, 25 Sep 2008 21:10:18 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[email]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[kde]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[macintosh]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[thunderbird]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[clock]]></category>

		<category><![CDATA[dual-screen]]></category>

		<category><![CDATA[Fedora]]></category>

		<category><![CDATA[Fedora 9]]></category>

		<category><![CDATA[fuzzy clock]]></category>

		<category><![CDATA[KDE 4]]></category>

		<category><![CDATA[KDE 4.0]]></category>

		<category><![CDATA[KDE 4.1]]></category>

		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/?p=48</guid>
		<description><![CDATA[I&#8217;ve recently upgraded my home PC from Fedora 8 to Fedora 9. One of the big benefits (apart from getting the very latest Firefox and Thunderbird packages) is that F9 features KDE 4, the latest version of the KDE desktop window manager.
Fedora 9
To upgrade, I followed the excellent instructions at http://www.gagme.com/greg/linux/f9-tips.php. The key point is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently upgraded my home PC from Fedora 8 to <a href="http://fedoraproject.org/" onclick="javascript:urchinTracker ('/outbound/article/fedoraproject.org');">Fedora 9</a>. One of the big benefits (apart from getting the very latest Firefox and Thunderbird packages) is that F9 features <a href="http://www.kde.org/" onclick="javascript:urchinTracker ('/outbound/article/www.kde.org');">KDE 4</a>, the latest version of the KDE desktop window manager.</p>
<p><strong>Fedora 9</strong><br />
To upgrade, I followed the <em>excellent</em> instructions at <a href="http://www.gagme.com/greg/linux/f9-tips.php" onclick="javascript:urchinTracker ('/outbound/article/www.gagme.com');">http://www.gagme.com/greg/linux/f9-tips.php</a>. The key point is to use the &#8216;preupgrade&#8217; package to sort everything out:</p>
<p><code>yum -y install preupgrade<br />
preupgrade</code></p>
<p>This downloads new F9 versions of all the RPM packages you have on your system and then sets everything up so that when you re-boot your machine it will start F9.</p>
<p>It&#8217;s an excellent idea, and for me It Just Worked.</p>
<p><strong>KDE 4</strong><br />
KDE version 4 is all rather new. Initially I had version 4.0 installed. The biggest drawback to this version was the absence of the <a href="http://www.dr-jan.com/tips/2008/03/24/kde/" >Fuzzy Clock</a>. However, I&#8217;m pleased to say that on my first &#8216;yum update&#8217;, my system was upgraded to KDE 4.1, complete with Fuzzy Clock. Whilst version 4.0 was looking a bit rough round the edges, 4.1 is a far more polished affair.</p>
<p>One of the new features (on System Settings, Desktop, General tab) is the ability to &#8216;Enable desktop effects&#8217;, which makes the whole machine much more Mac-like in the prettyness of the desktop. However, I noticed that with this turned on, even when nothing else was running, I was using about 50% of my CPU power just to run the desktop. So I turned that off <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The other annoyance in KDE4 was the lack of launch buttons on the panel for my favourite applications. This was really getting on my nerves until I realised that the default &#8216;tab&#8217; shown initially when clicking on the &#8216;K&#8217; menu button is the Favourites tab. To add things to the Favourites tab just find the application in the labyrinth of menus on the &#8216;K&#8217; menu, click it with the secondary mouse button and select &#8216;Add to Favourites&#8217; from the context-sensitive menu. Now all your favourite applications are just 2 clicks away on the &#8216;K&#8217; menu button.</p>
<p><strong>UPDATE:</strong> Neither KDE 4.0 nor KDE 4.1 can cope with dual screen display systems! I&#8217;ve seen comments that imply dual screen configurations are very rare and so fixing the problems is not a priority. Boo : -( See my comments below for details.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2008/09/25/fedora-9-and-kde-4/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Units</title>
		<link>http://www.dr-jan.com/tips/2008/06/11/units/</link>
		<comments>http://www.dr-jan.com/tips/2008/06/11/units/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 23:07:29 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[howto]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[units unix command-line]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/?p=45</guid>
		<description><![CDATA[I was recently reminded of the excellent &#8216;units&#8217; program, available with all good Unix systems.
Units will convert quantities expressed in one unit in to another unit. Here&#8217;s an example:

$ units
2439 units, 71 prefixes, 33 nonlinear units
You have: 12 miles
You want: kilometres
        * 19.312128
      [...]]]></description>
			<content:encoded><![CDATA[<p>I was recently reminded of the excellent &#8216;units&#8217; program, available with all good Unix systems.</p>
<p>Units will convert quantities expressed in one unit in to another unit. Here&#8217;s an example:</p>
<p><code><br />
$ units<br />
2439 units, 71 prefixes, 33 nonlinear units</p>
<p>You have: 12 miles<br />
You want: kilometres<br />
        * 19.312128<br />
        / 0.051780933<br />
You have:<br />
</code></p>
<p>So, 12 miles is equivalent to 19.312128 kilometres. OK, that was an easy one to warm up with. Units knows about all kinds of arcane measures and can happily convert between them all. Here&#8217;s an example from the man page:</p>
<p><code><br />
$ units<br />
2439 units, 71 prefixes, 33 nonlinear units</p>
<p>You have: furlongs per fortnight<br />
You want: m/s<br />
        * 0.00016630952<br />
        / 6012.8848<br />
You have:<br />
</code></p>
<p>I actually needed to use units to find out my weight in kilos:<br />
<code><br />
$ units<br />
2439 units, 71 prefixes, 33 nonlinear units</p>
<p>You have: 20 stone + 1 lb<br />
You want: kilos<br />
conformability error<br />
        127.45946 kg<br />
        1000<br />
You have:<br />
</code></p>
<p>My goodness, <a href="http://www.dr-jan.com/newblog/2008/06/10/im_thin/" >that&#8217;s a large number</a>!</p>
<p>Units should be available in most versions of Unix and Linux - just get a terminal session (telnet or ssh for example) and type in &#8216;units&#8217;. As usual, read the manual page by typing &#8216;man units&#8217;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2008/06/11/units/feed/</wfw:commentRss>
		</item>
		<item>
		<title>KDE</title>
		<link>http://www.dr-jan.com/tips/2008/03/24/kde/</link>
		<comments>http://www.dr-jan.com/tips/2008/03/24/kde/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 00:45:10 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[kde]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[active badge]]></category>

		<category><![CDATA[bluetooth]]></category>

		<category><![CDATA[clock]]></category>

		<category><![CDATA[fuzzy clock]]></category>

		<category><![CDATA[kbluelock]]></category>

		<category><![CDATA[presence]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2008/03/24/kde/</guid>
		<description><![CDATA[Fedora Linux is the operating system of choice for both my home PC and my work laptop. KDE is my preferred window manager.
The main reason I use KDE rather than Gnome or another system is the Fuzzy Clock. The clock in the lower right hand corner of my screen uses real English to tell the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://fedoraproject.org/" onclick="javascript:urchinTracker ('/outbound/article/fedoraproject.org');">Fedora Linux</a> is the operating system of choice for both my home PC and my work laptop. <a href="http://www.kde.org/" onclick="javascript:urchinTracker ('/outbound/article/www.kde.org');">KDE</a> is my preferred window manager.</p>
<p>The main reason I use KDE rather than <a href="http://www.gnome.org/" onclick="javascript:urchinTracker ('/outbound/article/www.gnome.org');">Gnome</a> or another system is the Fuzzy Clock. The clock in the lower right hand corner of my screen uses real English to tell the time. So, for example, 11:22 would appear as &#8216;Twenty past eleven&#8217;. The fuzziness is adjustable, but the minimum setting changes the time every 5 minutes, which is more than good enough for most things. This means that the clock will say &#8216;Twenty past eleven&#8217; until it changes to &#8216;Twenty five past eleven&#8217;.</p>
<p>Recent versions of KDE also include a nifty utility called &#8216;kbluelock&#8217;. When you enable kbluelock, it scans for Bluetooth devices nearby. Select your phone from the list shown, and if your phone ever goes out of range, kbluelock will enable the screen saver, automatically locking the screen. Effectively your phone is being used as a &#8216;presence detector&#8217; - it indicates if you are at your computer. </p>
<p>This reminds me of the <a href="http://www.cl.cam.ac.uk/research/dtg/attarchive/ab.html" onclick="javascript:urchinTracker ('/outbound/article/www.cl.cam.ac.uk');">Active Badge</a> system, although that used infra-red technology rather than Bluetooth wireless. I like the idea of using my phone to indicate where I am (within limits <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2008/03/24/kde/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Disabling Thunderbird Addons</title>
		<link>http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/</link>
		<comments>http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/#comments</comments>
		<pubDate>Sun, 30 Dec 2007 23:48:58 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[calendars]]></category>

		<category><![CDATA[email]]></category>

		<category><![CDATA[howto]]></category>

		<category><![CDATA[software]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[add-ons]]></category>

		<category><![CDATA[google data provider]]></category>

		<category><![CDATA[lightning]]></category>

		<category><![CDATA[safe mode]]></category>

		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/</guid>
		<description><![CDATA[Today I was in the unfortunate position of not being able to use Thunderbird to read my email. I recently installed the Lightning calendar addon together with the Provider for Google Calendar addon. What&#8217;s supposed to happen is the calendar within Thunderbird (provided by the Lightning addon) is automatically updated from (and updates) my Google [...]]]></description>
			<content:encoded><![CDATA[<p>Today I was in the unfortunate position of not being able to use Thunderbird to read my email. I recently installed the Lightning calendar addon together with the Provider for Google Calendar addon. What&#8217;s supposed to happen is the calendar within Thunderbird (provided by the Lightning addon) is automatically updated from (and updates) my Google Calendars.</p>
<p>In practice, what happens is that when Thunderbird starts, not much happens until I get a popup dialog box telling me that a script on this page is taking a long time to finish. Even if I try and cancel the script, nothing responds until I manually kill off Thunderbird completely.</p>
<p>Which is a shame.</p>
<p>So, Dr Jan&#8217;s Tip From The Top for today is&#8230;</p>
<p>You can start Thunderbird with all addons disabled by using the command line:<br />
<code><br />
thunderbird -safe-mode<br />
</code></p>
<p>Once Thunderbird has started it&#8217;s then a simple matter to use the Addons screen to disable or uninstall the offending addon.</p>
<p>It seems that the problem for me was the Provider for Google Calendar addon. The Lightning calendar is excellent, and getting better at a good rate too. Unfortunately, without the Google Calendar synchronisation it&#8217;s not much use to me at the moment.</p>
<p>I&#8217;ll probably try again when a new version is released <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2007/12/31/disabling-thunderbird-addons/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Surely Not!</title>
		<link>http://www.dr-jan.com/tips/2007/02/14/surely-not/</link>
		<comments>http://www.dr-jan.com/tips/2007/02/14/surely-not/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 00:37:45 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[hardware]]></category>

		<category><![CDATA[humour]]></category>

		<category><![CDATA[macintosh]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2007/02/14/surely-not/</guid>
		<description><![CDATA[From Tactile Logic: &#8220;I Hate Macs&#8221;
I hate Macs. I have always hated Macs. I hate people who use Macs. I even hate people who don&#8217;t use Macs but sometimes wish they did. Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people [...]]]></description>
			<content:encoded><![CDATA[<p>From <a href="http://www.tactilelogic.org/2007/02/05/i-hate-macs/"target="_blank" title="Tactile Logic blog entry."  onclick="javascript:urchinTracker ('/outbound/article/www.tactilelogic.org');">Tactile Logic</a>: &#8220;I Hate Macs&#8221;</p>
<blockquote><p>I hate Macs. I have always hated Macs. I hate people who use Macs. I even hate people who don&#8217;t use Macs but sometimes wish they did. Macs are glorified Fisher-Price activity centres for adults; computers for scaredy cats too nervous to learn how proper computers work; computers for people who earnestly believe in feng shui.</p></blockquote>
<p>Just don&#8217;t look under the hood - there&#8217;s a big, hairy, scary Unix system driving it all. With just a small effort you can get a bash shell. Phew <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2007/02/14/surely-not/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Cron</title>
		<link>http://www.dr-jan.com/tips/2007/01/12/using-cron/</link>
		<comments>http://www.dr-jan.com/tips/2007/01/12/using-cron/#comments</comments>
		<pubDate>Fri, 12 Jan 2007 14:16:34 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2007/01/12/using-cron/</guid>
		<description><![CDATA[Cron is a handy utility available on (as far as I know) all Unix systems. It provides a mechanism for starting specified jobs at pre-determined times. So, for example, on my Linux laptop I have a cron job which runs every day which removes any files older than 7 days from the /tmp directory. Cron [...]]]></description>
			<content:encoded><![CDATA[<p>Cron is a handy utility available on (as far as I know) all Unix systems. It provides a mechanism for starting specified jobs at pre-determined times. So, for example, on my Linux laptop I have a cron job which runs every day which removes any files older than 7 days from the /tmp directory. Cron is excellent for dealing with these kinds of housekeeping tasks which otherwise are easily forgotten.</p>
<p>Cron is normally implemented as a daemon, &#8216;crond&#8217;, which is started automatically when the machine is booted. The cron daemon spends most of its life asleep, but once a minute it wakes up and checks if there are any jobs which need to be started at the current time. If there are, they are started and left to run. Any output from these programs will be captured and sent by email to the user that started the job, unless the output (and the error output) is explicitly redirected on the command line in the crontab file.</p>
<p>You may not have permission to use cron on your system, in which case you will need to (or ask your system administrator to) add your details to /etc/cron.allow and make sure they don&#8217;t appear in /etc/cron.deny.</p>
<p>Each user can set up their own personal crontab file, which specifies the schedule and the commands to run.</p>
<p>The crontab file is a plain text file with 6 whitespace delimited fields per line. The first 5 fields specify when to run the commands (which form the sixth field).</p>
<p>Here&#8217;s a sample line which removes old temporary files as mentioned in the example above:</p>
<p><code>0 0 * * * /usr/local/bin/find /tmp -depth -mtime +7 -exec /usr/local/bin/remove {} \;</code></p>
<p>This is what the numbers at the front of a crontab file mean:</p>
<table border="1">
<tr>
<th>Schedule</th>
<th>Valid Values</th>
</tr>
<tr>
<td>minute</td>
<td>0-59</td>
</tr>
<tr>
<td>hour</td>
<td>0-23</td>
</tr>
<tr>
<td>day of month</td>
<td>1-31</td>
</tr>
<tr>
<td>month</td>
<td>1-12</td>
</tr>
<tr>
<td>day of week</td>
<td>0-6 (Sunday is zero)</td>
</tr>
</table>
<p>Use a star (*) to indicate all possible values.</p>
<p>So, the example above is executed at 0:00 (midnight) every day.</p>
<p>As you can see, the scheduling scheme is very flexible, allowing everything from once every minute (* * * * *) to once a year (10:00 on the third of January would be represented as 00 10 3 1 *) and almost everything in between.</p>
<p>An important point to bear in mind when using cron is the environment which is used to run the jobs. Cron uses &#8217;sh&#8217;, the Bourne shell to run the commands you specify. There is only a minimal PATH statement set up,  which is why in the example above the full path name is specified for the find and remove commands.</p>
<p>It can be a good idea to prefix your cron commands with &#8216;. .profile&#8217; to execute your .profile and set up all your default settings. One thing to be aware of here is that most interactive logins use either ksh (the Korn shell) or bash (the Bourne Again SHell), and there may be commands in your .profile which work fine in ksh or bash but which fail in sh.</p>
<p>The classic example is setting up environment variables. For example,</p>
<p><code>export PATH=$PATH:$HOME/bin</code></p>
<p>is valid syntax in ksh and bash, but not in sh. You need to export the variable as a separate step:</p>
<p><code>PATH=$PATH:$HOME/bin<br />
export PATH</code></p>
<p>The crontab command is used to configure cron jobs.</p>
<table border="1">
<tr>
<td>crontab -l</td>
<td>lists the current cron jobs on the screen</td>
</tr>
<tr>
<td>crontab -e</td>
<td>edits the current cron jobs with the default editor (often vi)</td>
</tr>
<tr>
<td>crontab filename</td>
<td>removes the current crontab file and replaces it with the contents of filename</td>
</tr>
</table>
<p>Do a &#8216;man crontab&#8217; for more details <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Do be careful when using the crontab command, because if you mistype the switches they can be interpreted as a non-existent filename which will effectively remove your existing crontab.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2007/01/12/using-cron/feed/</wfw:commentRss>
		</item>
		<item>
		<title>The Unix Programming Environment</title>
		<link>http://www.dr-jan.com/tips/2006/12/08/the-unix-programming-environment/</link>
		<comments>http://www.dr-jan.com/tips/2006/12/08/the-unix-programming-environment/#comments</comments>
		<pubDate>Fri, 08 Dec 2006 00:49:10 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[books]]></category>

		<category><![CDATA[review]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2006/12/08/the-unix-programming-environment/</guid>
		<description><![CDATA[This is a review of the book The Unix Programming Environment by Brian W. Kernighan and Rob Pike.
Anyone familiar with the early days of Unix will recognise the authors as key members of the Bell Labs team that created and nurtured Unix through its early years. Brian Kernighan is rightly famous as the co-author, with [...]]]></description>
			<content:encoded><![CDATA[<p>This is a review of the book The Unix Programming Environment by Brian W. Kernighan and Rob Pike.</p>
<p>Anyone familiar with the early days of Unix will recognise the authors as key members of the Bell Labs team that created and nurtured Unix through its early years. Brian Kernighan is rightly famous as the co-author, with Dennis Ritchie, of The C Programming Language (a similarly concise tome).</p>
<p>This book is slim by computer book standards, but it manages to cover a huge amount of ground. The copyright date is 1984. Don&#8217;t let that put you off, it&#8217;s still an enormously useful and very relevant book.</p>
<p>When I first read this book I had already been using the Xenix flavour of Unix for several years, so I wasn&#8217;t exactly a newbie.</p>
<p>OK, enough waffle. This is a FANTASTIC book! Reading through it for the first time, suddenly everything clicked into place and it all made a lot more sense.</p>
<p>The strength of this book is that it explains the philosophy of Unix, the approach and the grand design behind it all. Once you have that everything becomes much more obvious and it&#8217;s easy to see how everything fits together.</p>
<p>The key parts of the Unix philosophy are</p>
<ul>
<li>write programs to do one thing and only one thing well</li>
<li>use plain text to store information in a human-readable format</li>
<li>don&#8217;t use headers or footers - every line should be real data</li>
<li>use pipes and redirection to combine programs to achieve your goals</li>
</ul>
<p>The book starts with information about getting access to your Unix system and progresses logically through the file system, pipes, filters, shell programming and on to C programming. The C chapters start with using standard I/O and end up with using lex and yacc to write a programming language of similar complexity to BASIC.</p>
<p>Computing in 1984 meant using a VDU or, if you were not that fortunate, a hard-copy terminal to access the central computer. Home computers of the period were things like the Apple II (mainly in America I assume), and the British Broadcasting Corporation Microcomputer (in the UK).</p>
<p>I was attending Middlesex Polytechnic and using a DECSystem10 mainframe, so VDUs and teletype printers were familiar items. The description of powering up a terminal or using a dial-up connection seems rather quaint now, but at the time a 600 baud connection was fast.</p>
<p>After this first (somewhat amusing) section the text becomes much more relevant as it moves on to cover software rather than hardware <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>There is a fairly in-depth review of the Unix filesystem, including a discussion of i-nodes.</p>
<p>The pipes and filters section gives an excellent grounding in the subject and illustrates the Unix philosophy perfectly.</p>
<p>The book covers all the essential command line tools in a concise and informative way. If you follow the examples in the text you will end up with a bunch of useful utilities which just make your life easier. I still refer to the sections on &#8216;awk&#8217; and &#8217;sed&#8217; quite regularly.</p>
<p>Anyone from a programming background will find this book an excellent introduction to Unix. The extra bonus is that if you follow it through to the end, you&#8217;ll have covered some sophisticated language building tools and become proficient with the C language. There is also a chapter about using nroff for document preparation. The entire book was written on a Unix system, and nroff and troff were used to process the text into a format suitable for a typesetter. The proud boast at the front of the book is that all the code within it is automatically taken from working programs.</p>
<p>The best guide to any technical book is the quality of its index, and this is easily one of the best indices I&#8217;ve encountered.</p>
<p>All in all, this book was a revelation to me.</p>
<p>If you would like to buy your own copy of this book, and I&#8217;d heartily recommend that you do, I encourage you to click on the Amazon link below. This is my first experiment in earning some dosh with my blog - given that no-one reads it, the chances of anyone buying the book and me getting a commission seem extremely remote to me <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><iframe scrolling="no" frameborder="0" marginheight="0" marginwidth="0" style="width: 120px; height: 240px" src="http://rcm-uk.amazon.co.uk/e/cm?t=drjancom-21&#038;o=2&#038;p=8&#038;l=as1&#038;asins=013937681X&#038;fc1=000000&#038;IS2=1&#038;lt1=_blank&#038;lc1=0000FF&#038;bc1=000000&#038;bg1=FFFFFF&#038;f=ifr">&amp;amp;amp;amp;lt;/p&amp;amp;amp;amp;gt;</iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2006/12/08/the-unix-programming-environment/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Transferring Lots Of Small Data</title>
		<link>http://www.dr-jan.com/tips/2006/11/23/transferring-lots-of-small-data/</link>
		<comments>http://www.dr-jan.com/tips/2006/11/23/transferring-lots-of-small-data/#comments</comments>
		<pubDate>Thu, 23 Nov 2006 20:41:37 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[backups]]></category>

		<category><![CDATA[networks]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2006/11/23/transferring-lots-of-small-data/</guid>
		<description><![CDATA[I was in the situation recently where I needed to transfer about 500Gb of data from one HP-UX box to another.
Unfortunately most of these data were in small files - the largest probably a megabyte or so.
I ran some speed tests. We had gigabit ethernet connecting the 2 boxes on a little used LAN.
I wrote [...]]]></description>
			<content:encoded><![CDATA[<p>I was in the situation recently where I needed to transfer about 500Gb of data from one HP-UX box to another.</p>
<p>Unfortunately most of these data were in small files - the largest probably a megabyte or so.</p>
<p>I ran some speed tests. We had gigabit ethernet connecting the 2 boxes on a little used LAN.</p>
<p>I wrote a small script to start 6 copy processes in parallel and another to periodically measure how much disk space had been used on the target machine.</p>
<p>I found that 6 simultaneous scp commands ran at about 15Mb/s (Megabytes per second). scp has the overhead of encrypting the data stream before it is transferred, so I tried plain old rcp as well. That gave me worse results than scp.</p>
<p>Thinking that the large number of small files was slowing things down I tried using tar to batch up the files. I wrote a tiny script to pipe the output of the tar command across to the target machine directly in to a receiving tar process which unbundled the files.</p>
<p>The tar approach almost doubled the rate of transfer to about 30Mb/s.</p>
<p>Here are the tar commands. Note that you&#8217;ll need to enable r-commands by creating .rhosts files in the home directories of each machine (remove these after they copy is complete - they are notorious security problems). Note also that, as usual, HP-UX is awkward - whereas the rest of the world uses &#8216;rsh&#8217; for the remote-shell command, HP-UX uses &#8216;remsh&#8217;. &#8216;rsh&#8217; is some kind of <em>restricted</em> shell in HP parlance.</p>
<pre>box1> cd source_directory; tar cf - . | remsh box2 "cd target_directory; tar xf - "</pre>
<p>The first tar command creates a file called &#8216;-&#8217;, which is a special token meaning &#8217;standard output&#8217; in this case. The archive created contains all the files in the current directory (.) plus all subdirectories (tar is recursive by default). This archive file is piped into the remsh command which sends it to the box2 machine. On box 2 I first change to the proper receiving directory, then I extract from &#8216;-&#8217;, or &#8217;standard input&#8217; the incoming files.</p>
<p>I had 6 of these tar commands running simultaneously to ensure the network link was saturated with data, although I suspect that disk access may have been the limiting factor.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2006/11/23/transferring-lots-of-small-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Finding Infinite Symlink Loops</title>
		<link>http://www.dr-jan.com/tips/2006/11/02/finding-infinite-symlink-loops/</link>
		<comments>http://www.dr-jan.com/tips/2006/11/02/finding-infinite-symlink-loops/#comments</comments>
		<pubDate>Thu, 02 Nov 2006 14:18:37 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2006/11/02/finding-infinite-symlink-loops/</guid>
		<description><![CDATA[Sometimes you can find yourself in symlinking hell when you&#8217;ve inadvertently created a loop of links, where link A refers to file B, and file B is another link back to A, for example.
You can use the GNU version of &#8216;find&#8217; to discover where the link loops are. This information is from a bug report [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you can find yourself in symlinking hell when you&#8217;ve inadvertently created a loop of links, where link A refers to file B, and file B is another link back to A, for example.</p>
<p>You can use the GNU version of &#8216;find&#8217; to discover where the link loops are. This information is from a bug report <a href="http://savannah.gnu.org/bugs/?func=detailitem&#038;item_id=13381"title="Bug description." target="_blank"  onclick="javascript:urchinTracker ('/outbound/article/savannah.gnu.org');">here</a>.</p>
<p>Note that this doesn&#8217;t work if you have version 4.2.19 of find. You can check the version with rpm, assuming you are using an rpm-based Linux distribution (RedHat anything, CentOS, etc.).</p>
<p>&#8216;rpm -q findutils&#8217; should show the current version.</p>
<pre>find . -follow

find: Symbolic link 'some/path/or/another' is
part of a loop in the directory hierarchy;
we have already visited the directory to which it points.</pre>
<p>Once you have found the location of the loop you can manually fix things <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2006/11/02/finding-infinite-symlink-loops/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Backup</title>
		<link>http://www.dr-jan.com/tips/2006/09/04/backup/</link>
		<comments>http://www.dr-jan.com/tips/2006/09/04/backup/#comments</comments>
		<pubDate>Sun, 03 Sep 2006 23:20:33 +0000</pubDate>
		<dc:creator>drjan</dc:creator>
		
		<category><![CDATA[backups]]></category>

		<category><![CDATA[tutorial]]></category>

		<category><![CDATA[unix]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.dr-jan.com/tips/2006/09/04/backup/</guid>
		<description><![CDATA[If the first step in any procedure is &#8216;backup your data&#8217;, for goodness&#8217; sake do as it says!
Don&#8217;t think that because you&#8217;re more technical/brighter/don&#8217;t really care about the existing data that you&#8217;ll be OK.
If you don&#8217;t have a back up Murphy&#8217;s Law dictates that something disastrous will happen and you&#8217;ll lose everything.
If you do have [...]]]></description>
			<content:encoded><![CDATA[<p>If the first step in any procedure is &#8216;backup your data&#8217;, for goodness&#8217; sake do as it says!</p>
<p>Don&#8217;t think that because you&#8217;re more technical/brighter/don&#8217;t really care about the existing data that you&#8217;ll be OK.</p>
<p>If you don&#8217;t have a back up Murphy&#8217;s Law dictates that something disastrous will happen and you&#8217;ll lose everything.</p>
<p>If you <em>do</em> have a backup, by the same logic you&#8217;ll be fine. Think of it as an insurance policy <img src='http://www.dr-jan.com/tips/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dr-jan.com/tips/2006/09/04/backup/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 3.088 seconds -->
