<?xml version="1.0" encoding="iso-8859-15"?>
<!-- generator="Kukkaisvoima version 15" -->
<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/"
>
<channel>
<title>Tim's Bits and Pieces: Howto</title>
<link>http://blog.timp.com.au</link>
<description>My personal blog, covering many random topics</description>
<pubDate>Tue, 22 Sep 2009 23:03:54 +0200</pubDate>
<lastBuildDate>Tue, 22 Sep 2009 23:03:54 +0200</lastBuildDate>
<generator>http://23.fi/kukkaisvoima/</generator>
<language>en</language>
<item>
<title>Tech Support
</title>
<link>http://blog.timp.com.au/tech_support%3A2009-09-22%3AComputers%2CHowto%2CHumour%2CLinkage</link>
<comments>http://blog.timp.com.au/tech_support%3A2009-09-22%3AComputers%2CHowto%2CHumour%2CLinkage#comments</comments>
<pubDate>Tue, 22 Sep 2009 23:03:54 +0200</pubDate>
<dc:creator>TimP</dc:creator>
<category>Computers</category>
<category>Howto</category>
<category>Humour</category>
<category>Linkage</category>
<guid isPermaLink="false">http://blog.timp.com.au/tech_support%3A2009-09-22%3AComputers%2CHowto%2CHumour%2CLinkage/</guid>
<description><![CDATA[ <p><a href="http://xkcd.com/627/">Tech Support Cheat Sheet</a></p>
 [...]]]></description>
<content:encoded><![CDATA[
<p><a href="http://xkcd.com/627/">Tech Support Cheat Sheet</a></p>
 ]]></content:encoded>
<wfw:commentRss>http://blog.timp.com.au/tech_support%3A2009-09-22%3AComputers%2CHowto%2CHumour%2CLinkage/feed/</wfw:commentRss>
</item>
<item>
<title>The History of Programming Languages
</title>
<link>http://blog.timp.com.au/the_history_of_programming_languages%3A2009-05-13%3AComputers%2CHowto%2CLinkage</link>
<comments>http://blog.timp.com.au/the_history_of_programming_languages%3A2009-05-13%3AComputers%2CHowto%2CLinkage#comments</comments>
<pubDate>Wed, 13 May 2009 23:03:56 +0200</pubDate>
<dc:creator>TimP</dc:creator>
<category>Computers</category>
<category>Howto</category>
<category>Linkage</category>
<guid isPermaLink="false">http://blog.timp.com.au/the_history_of_programming_languages%3A2009-05-13%3AComputers%2CHowto%2CLinkage/</guid>
<description><![CDATA[ <p>For your reading pleasure may I present <a
 [...]]]></description>
<content:encoded><![CDATA[
<p>For your reading pleasure may I present <a
     href="http://james-iry.blogspot.com/2009/05/brief-incomplete-and-mostly-wrong.html">A
     Brief, Incomplete, and Mostly Wrong History of Programming Languages</a>.</p>
 ]]></content:encoded>
<wfw:commentRss>http://blog.timp.com.au/the_history_of_programming_languages%3A2009-05-13%3AComputers%2CHowto%2CLinkage/feed/</wfw:commentRss>
</item>
<item>
<title>Awk and Trac.ini
</title>
<link>http://blog.timp.com.au/awk_and_tracini%3A2009-05-05%3AComputers%2CHowto%2CLinux%2CScripting</link>
<comments>http://blog.timp.com.au/awk_and_tracini%3A2009-05-05%3AComputers%2CHowto%2CLinux%2CScripting#comments</comments>
<pubDate>Tue, 05 May 2009 23:03:53 +0200</pubDate>
<dc:creator>TimP</dc:creator>
<category>Computers</category>
<category>Howto</category>
<category>Linux</category>
<category>Scripting</category>
<guid isPermaLink="false">http://blog.timp.com.au/awk_and_tracini%3A2009-05-05%3AComputers%2CHowto%2CLinux%2CScripting/</guid>
<description><![CDATA[ <p>You'll notice I'm posting late again, for which I blame <a
 [...]]]></description>
<content:encoded><![CDATA[
<p>You'll notice I'm posting late again, for which I blame <a
     href="http://en.wikipedia.org/wiki/Space_Trilogy">C.S. Lewis</a>, and since
 he's dead he can't defend himself from this <strike>unfounded accusation</strike>
 completely serious and non-trivial explanation for my tardiness.</p>
 
 <p>As for actually post, I work as a support guy for a Subversion
 hosting company. We also host <a href="http://trac.edgewall.org/">Trac</a>, so
 part of my job is occasionally setting up <a
     href="http://trac.edgewall.org/wiki/TracTicketsCustomFields">custom ticket
     fields</a> for customers. This involves editing the <a
     href="http://trac.edgewall.org/wiki/TracIni">trac.ini</a>, a simple text
 file. This is fairly easy when you just have to modify one Trac instance, but
 every now and again I have to modify a couple of dozen files. I have tried this
 using <a href="http://en.wikipedia.org/wiki/Sed"><code>sed</code></a> before, but this is a prime example of the the "When
 all you've got is a hammer, every problem is a nail" fallacy. I'd been sort of
 interested in learning more about <a
     href="http://en.wikipedia.org/wiki/AWK"><code>awk</code></a> and this seemed
 like a prime opportunity to "learn by doing", and now I'll reinforce with
 "learning by teaching". So with out further ado here's my short script
 interspersed with an explanation of how it works, and a complete copy of the
 code at the bottom.</p>
 
 <div class="code">
     <font color="#ff1493">BEGIN</font>&nbsp;{ i = <font
         color="#00cd00">0</font>&nbsp;}<br />
 </div>
 <p>The <code>BEGIN</code> section is a special section that is run once before
 processing the file, it can be used for setting variables, as I have done here.
 The <code>i</code> variable, a more descriptive name would have been good,
 stores the state of the script.</p>
 
 <div class="code">
     {<br />
     &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>if</b></font>&nbsp;( i ==
     <font color="#00cd00">0</font>&nbsp;) { <font
         color="#0000ff"><b>print</b></font>&nbsp;}<br />
 </div>
 <p>The <code>{</code> starts the main <code>awk</code> script, which is run once
 for each line in the file being processed. This first line simply prints out the
 input line being examined if <code>i</code> equals zero, which it does in the
 initial state of the program.</p>
 
 <div class="code">
     &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>else</b></font>&nbsp;<br />
     &nbsp;&nbsp;&nbsp;&nbsp;{<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
         color="#0000ff"><b>if</b></font>&nbsp;( i == <font
         color="#00cd00">1</font>&nbsp;) { <br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
         color="#0000ff"><b>print</b></font>&nbsp;<font color="#00cd00">&quot;#
         Ticket Custom Section</font><font color="#ff1493">\n</font><font
         color="#00cd00">&quot;</font><br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i =
     <font color="#00cd00">2</font>&nbsp;}<br />
 </div>
 <p>The next section is the <code>else</code> clause for the preceding
 <code>if</code> clause, which executes it's own if-else pair. The
 <code>if</code> clause executes if <code>i</code> equals one, which it does if
 we have just passed the "<code>[ticket-custom]</code>" line in the trac.ini
 file. This section prints out the required custom ticket definitions and changes
 <code>i</code> to two, which will prevent anything from being written until it
 gets to the end of the custom ticket section, see below. You need to change the
 <code>print</code> statement to print the the required ticket custom section of
 course; it might be more readable to use a series of individual statements
 rather than just one.</p>
 
 <div class="code">
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
         color="#0000ff"><b>else</b></font>&nbsp;{ <font
         color="#0000ff"><b>if</b></font>&nbsp;( <font
         color="#ff1493">$0</font>&nbsp;~ <font color="#00cd00">/</font><font
         color="#ff1493">\[</font><font color="#ff1493">.*</font><font
         color="#ff1493">\]</font><font color="#00cd00">/</font>&nbsp;) { <font
         color="#0000ff"><b>print</b></font>&nbsp;<font
         color="#ff1493">;</font>&nbsp;i = <font color="#00cd00">0</font>&nbsp;}
     }<br />
     &nbsp;&nbsp;&nbsp;&nbsp;}<br />
 </div>
 <p>This next line is executed if <code>i</code> doesn't equal zero or one,
 meaning that we are currently in the custom field section. It's a single short
 <code>if</code> statement that checks if the line being processed
 (<code>$0</code>) matches (<code>~</code>) a regular expression, in this case
 <code>/\[.*\]/</code>. This will match any line that contains a "[" followed by
 a series of characters, followed by a "]"; basically a trac.ini section head. So
 if it finds the start of a new section in the file it will print it out, and
 then set <code>i</code> back to zero, which means it will just print out the
 rest of the lines in the file.</p>
 
 <div class="code">
     &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>if</b></font>&nbsp;( <font
         color="#ff1493">$0</font>&nbsp;== <font
         color="#00cd00">&quot;[ticket-custom]&quot;</font>&nbsp;) { i = <font
         color="#00cd00">1</font>&nbsp;}<br />
     }<br />
 </div>
 <p>Then here's the final line which is a simple <code>if</code> that is run for each line
 in the file and checks if the line is the start of the custom field section
 (<code>[ticket-custom]</code>), and if so sets <code>i</code> to one; the result
 of which is show above.</p>
 
 <p>Since the code is probably slightly unclear unless you can see the whole
 thing here it is:</p>
  
 <div class="code">
     <font color="#ff1493">BEGIN</font>&nbsp;{ i = <font
         color="#00cd00">0</font>&nbsp;}<br />
     {<br />
     &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>if</b></font>&nbsp;( i ==
     <font color="#00cd00">0</font>&nbsp;) { <font
         color="#0000ff"><b>print</b></font>&nbsp;}<br />
     &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>else</b></font>&nbsp;<br />
     &nbsp;&nbsp;&nbsp;&nbsp;{<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
         color="#0000ff"><b>if</b></font>&nbsp;( i == <font
         color="#00cd00">1</font>&nbsp;) { <br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
         color="#0000ff"><b>print</b></font>&nbsp;<font color="#00cd00">&quot;#
         Ticket Custom Section</font><font color="#ff1493">\n</font><font
         color="#00cd00">&quot;</font><br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;i =
     <font color="#00cd00">2</font>&nbsp;}<br />
     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font
         color="#0000ff"><b>else</b></font>&nbsp;{ <font
         color="#0000ff"><b>if</b></font>&nbsp;( <font
         color="#ff1493">$0</font>&nbsp;~ <font color="#00cd00">/</font><font
         color="#ff1493">\[</font><font color="#ff1493">.*</font><font
         color="#ff1493">\]</font><font color="#00cd00">/</font>&nbsp;) { <font
         color="#0000ff"><b>print</b></font>&nbsp;<font
         color="#ff1493">;</font>&nbsp;i = <font color="#00cd00">0</font>&nbsp;}
     }<br />
     &nbsp;&nbsp;&nbsp;&nbsp;}<br />
     &nbsp;&nbsp;&nbsp;&nbsp;<br />
     &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>if</b></font>&nbsp;( <font
         color="#ff1493">$0</font>&nbsp;== <font
         color="#00cd00">&quot;[ticket-custom]&quot;</font>&nbsp;) { i = <font
         color="#00cd00">1</font>&nbsp;}<br />
     }<br />
 </div>
 ]]></content:encoded>
<wfw:commentRss>http://blog.timp.com.au/awk_and_tracini%3A2009-05-05%3AComputers%2CHowto%2CLinux%2CScripting/feed/</wfw:commentRss>
</item>
<item>
<title>Some tips on speeding up Slackware 12.2 Boot
</title>
<link>http://blog.timp.com.au/some_tips_on_speeding_up_slackware_122_boot%3A2009-02-14%3AComputers%2CHowto%2CLinux</link>
<comments>http://blog.timp.com.au/some_tips_on_speeding_up_slackware_122_boot%3A2009-02-14%3AComputers%2CHowto%2CLinux#comments</comments>
<pubDate>Sat, 14 Feb 2009 23:03:54 +0200</pubDate>
<dc:creator>TimP</dc:creator>
<category>Computers</category>
<category>Howto</category>
<category>Linux</category>
<guid isPermaLink="false">http://blog.timp.com.au/some_tips_on_speeding_up_slackware_122_boot%3A2009-02-14%3AComputers%2CHowto%2CLinux/</guid>
<description><![CDATA[ <p>My <a href="http://slackware.com">Slackware</a> laptop had decently fast boot
 [...]]]></description>
<content:encoded><![CDATA[
<p>My <a href="http://slackware.com">Slackware</a> laptop had decently fast boot
 times (a little over a minute), but I'm impatient and decided to see if I could
 speed it up some more. Here's the changes I made and the results down the
 bottom. This is on a Dell Vostro 1510, with 4GB of ram and a 2.1GHz Core 2 Duo.
 Obviously the results will vary depending on your hardware.</p>
 
 <ul>
     <li><a href="#lilo_and_kernel">Lilo and the Kernel</a></li>
     <li><a href="#rc.M">/etc/rc.d/rc.M</a></li>
     <li><a href="#rc.inet1">/etc/rc.d/rc.inet1</a></li>
     <li><a href="#results">The Results</a></li>
     <li><a href="#refs">References</a></li>
 </ul>
 
 <h3 id="lilo_and_kernel">Lilo and the Kernel</h3>
 <p>Probably the easiest piece of low hanging fruit is Lilo's "compact" option.
 This gets rid of the "Loading Linux................" pause straight after the
 Lilo prompt.</p>
 <blockquote class="code">
 <font color="#ee0000"># Start LILO global section</font><br />
 <font color="#0000ff"><b>boot</b></font>&nbsp;<font color="#ff1493">=</font>&nbsp;<font color="#00cd00">/dev/sda</font><br />
 <font color="#0000ff"><b>compact</b></font><br />
 </blockquote>
 
 <p>Another popular step that can provide not inconsiderable speed advantages is to compile
 yourself a <a href="http://slackwiki.org/Kernel_Compilation">custom
 kernel</a>.</p>
 
 <h3 id="rc.M">/etc/rc.d/rc.M</h3>
 <p>There are quite a few options in rc.M that you can either run in the
 background (add &amp; to the line) to speed up the boot times, and there's even a few that you can just
 comment out and ignore.</p>
 
 <p>Starting from the top and going down we have the optical drive symlinks,
 simply add an "&amp;" to the end of the "<span class="code">/bin/sh
     /lib/udev/rc.optical-symlinks</span>" line in the following code segment:</p>
 <blockquote class="code">
 <font color="#ee0000"># If we're using udev, make /dev/cdrom and any other optical drive symlinks</font><br />
 <font color="#ee0000"># if some udev rule hasn't made them already:</font><br />
 <font color="#0000ff"><b>if </b></font>grep -wq sysfs /proc/mounts <font color="#0000ff"><b>&amp;&amp;</b></font>&nbsp;grep -wq tmpfs /proc/filesystems<font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;<font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>!</b></font>&nbsp;grep -wq nohotplug /proc/cmdline <font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/lib/udev/rc.optical-symlinks <font color="#0000ff"><b>-a</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.udev <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/bin/sh /lib/udev/rc.optical-symlinks <font color="#0000ff"><b>&amp;</b></font><br />
 &nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000ff"><b>fi</b></font><br />
 &nbsp;&nbsp;<font color="#0000ff"><b>fi</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <p>After that there's fc-cache, gtk-update-icon-cache, and ldconfig; these can be run
 manually whenever you install a new Font, icon set, or library, so I simply
 commented out these lines:</p>
 
 <blockquote class="code">
 <font color="#ee0000">## Update the X font indexes:</font><br />
 <font color="#ee0000">#if [ -x /usr/bin/fc-cache ]; then</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;echo &quot;Updating X font indexes:&nbsp;&nbsp;/usr/bin/fc-cache -f &amp;&quot;</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;/usr/bin/fc-cache -f</font><br />
 <font color="#ee0000">#fi</font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000">## Update any existing icon cache files:</font><br />
 <font color="#ee0000">#if find /usr/share/icons 2&gt; /dev/null | grep -q icon-theme.cache ; then</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;for theme_dir in /usr/share/icons/* ; do</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;if [ -r ${theme_dir}/icon-theme.cache ]; then</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Updating icon-theme.cache in ${theme_dir}...&quot;</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/usr/bin/gtk-update-icon-cache -t -f ${theme_dir} 1&gt; /dev/null 2&gt; /dev/null</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;fi</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;done</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;# This would be a large file and probably shouldn't be there.</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;if [ -r /usr/share/icons/icon-theme.cache ]; then</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;Deleting icon-theme.cache in /usr/share/icons...&quot;</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;/usr/bin/gtk-update-icon-cache -t -f /usr/share/icons 1&gt; /dev/null 2&gt; /dev/null</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;&nbsp;&nbsp;rm -f /usr/share/icons/icon-theme.cache</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;fi</font><br />
 <font color="#ee0000">#fi</font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000">## Update all the shared library links:</font><br />
 <font color="#ee0000">## Can do this manually after installing new libraries</font><br />
 <font color="#ee0000">#if [ -x /sbin/ldconfig ]; then</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;echo &quot;Updating shared library links:&nbsp;&nbsp;/sbin/ldconfig&quot;</font><br />
 <font color="#ee0000">#&nbsp;&nbsp;/sbin/ldconfig</font><br />
 <font color="#ee0000">#fi</font><br />
 </blockquote>
 
 <p>Then there's another stack of services that I start running in the background
 by adding ampersands:</p>
 
 <blockquote class="code">
 <font color="#ee0000"># Start networking daemons:</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.inet2 <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;<font color="#0000ff"><b>&nbsp;. </b></font>/etc/rc.d/rc.inet2 <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000"># Start the Network Time Protocol daemon:</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.ntpd <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;sh /etc/rc.d/rc.ntpd start <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000"># SCIM and other GTK+ input methods like this file kept updated:</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/usr/bin/gtk-query-immodules<font color="#00cd00">-2</font>.<font color="#00cd00">0</font>&nbsp;<font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;<font color="#0000ff"><b>echo</b></font><font color="#00cd00">&nbsp;</font><font color="#0000ff"><b>&quot;</b></font><font color="#00cd00">Updating gtk.immodules:&nbsp;&nbsp;gtk-query-immodules-2.0 &gt; /etc/gtk-2.0/gtk.immodules</font><font color="#0000ff"><b>&quot;</b></font><br />
 &nbsp;&nbsp;/usr/bin/gtk-query-immodules<font color="#00cd00">-2</font>.<font color="#00cd00">0</font>&nbsp;<font color="#0000ff"><b>&gt;</b></font>&nbsp;/etc/gtk<font color="#00cd00">-2</font>.<font color="#00cd00">0</font>/gtk.immodules <font color="#00cd00">2</font><font color="#0000ff"><b>&gt;</b></font>&nbsp;/dev/null <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000"># Start the print spooling system.&nbsp;&nbsp;This will usually be LPRng (lpd) or CUPS.</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.cups <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;<font color="#ee0000"># Start CUPS:</font><br />
 &nbsp;&nbsp;/etc/rc.d/rc.cups start <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>elif</b></font>&nbsp;<font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.lprng <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;<font color="#ee0000"># Start LPRng (lpd):</font><br />
 &nbsp;<font color="#0000ff"><b>&nbsp;. </b></font>/etc/rc.d/rc.lprng start <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000"># Start netatalk. (a file/print server for Macs using Appletalk)</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.atalk <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;&nbsp;/etc/rc.d/rc.atalk <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000"># Start the sendmail daemon:</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.sendmail <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;<font color="#0000ff"><b>&nbsp;. </b></font>/etc/rc.d/rc.sendmail start <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <blockquote class="code">
 <font color="#ee0000"># Load ALSA (sound) defaults:</font><br />
 <font color="#0000ff"><b>if </b></font><font color="#0000ff"><b>[</b></font>&nbsp;<font color="#0000ff"><b>-x</b></font>&nbsp;/etc/rc.d/rc.alsa <font color="#0000ff"><b>]</b></font><font color="#0000ff"><b>;</b></font>&nbsp;<font color="#0000ff"><b>then</b></font><br />
 &nbsp;<font color="#0000ff"><b>&nbsp;. </b></font>/etc/rc.d/rc.alsa <font color="#0000ff"><b>&amp;</b></font><br />
 <font color="#0000ff"><b>fi</b></font><br />
 </blockquote>
 
 <h3 id="rc.inet1">/etc/rc.d/rc.inet1</h3>
 <p>Finally I recommend decreasing the DHCP timeout used in rc.inet1; the default
 is 30 seconds (it used to be 60), I decreased mine further down to 15 seconds:
 </p>
 <blockquote class="code">
 <font color="#ee0000"># 30 seconds should be a reasonable default DHCP timeout.&nbsp;&nbsp;60 was too much.&nbsp;&nbsp;:-)</font><br />
 <font color="#0000ff"><b>echo</b></font><font color="#00cd00">&nbsp;</font><font color="#0000ff"><b>&quot;</b></font><font color="#00cd00">/etc/rc.d/rc.inet1:&nbsp;&nbsp;/sbin/dhcpcd -d -t </font><font color="#cd00cd">${</font><font color="#cd00cd">DHCP_TIMEOUT</font><font color="#cd00cd">[</font><font color="#cd00cd">$i</font><font color="#cd00cd">]</font><font color="#0000ff"><b>:-</b></font><span style="background-color: #ff0000"><font color="#ffffff">15</font></span><font color="#cd00cd">}</font><font color="#00cd00">&nbsp;</font><font color="#cd00cd">${</font><font color="#cd00cd">DHCP_OPTIONS</font><font color="#cd00cd">}</font><font color="#00cd00">&nbsp;</font><font color="#cd00cd">${</font><font color="#cd00cd">1</font><font color="#cd00cd">}</font><font color="#0000ff"><b>&quot;</b></font><font color="#00cd00">&nbsp;</font>| <font color="#cd00cd">$LOGGER</font><br />
 /sbin/dhcpcd <font color="#ff1493">-d</font>&nbsp;<font color="#ff1493">-t</font>&nbsp;<font color="#cd00cd">${</font><font color="#cd00cd">DHCP_TIMEOUT</font><font color="#cd00cd">[</font><font color="#cd00cd">$i</font><font color="#cd00cd">]</font><font color="#0000ff"><b>:-</b></font><span style="background-color: #ff0000"><font color="#ffffff">15</font></span><font color="#cd00cd">}</font>&nbsp;<font color="#cd00cd">${</font><font color="#cd00cd">DHCP_OPTIONS</font><font color="#cd00cd">}</font>&nbsp;<font color="#cd00cd">${</font><font color="#cd00cd">1</font><font color="#cd00cd">}</font><br />
 </blockquote>
 
 <h3 id="results">The Results</h3>
 <p>Boot time from Lilo to login prompt was approximately one minute thirty
 before I performed these changes, and that decreased to twenty-five seconds.
 Once you include the time from first power on till Lilo it comes to about 35-40
 seconds boot time, plus another five seconds to login and start X. The biggest
 speed increase seems to be from using compact in Lilo and the custom kernel.</p>
 
 <h3 id="refs">References</h3>
 <p>There where a couple other resources on the Internet that got me started on this, and pointed out several of the ideas that I used:
 The <a
     href="http://www.fprimex.com/computers/slackware-linux/tips#booting-faster">section
     on boot speed</a> in the <a
     href="http://www.fprimex.com/computers/slackware-linux/tips#booting-faster">Slackware
     tips</a> article on <a href="http://fprimex.com">f'(x)</a> and an <a
     href="http://groups.google.com/group/alt.os.linux.slackware/">alt.os.linux.slackware</a>
 thread on <a
     href="http://groups.google.com/group/alt.os.linux.slackware/browse_thread/thread/52a606bf38649d3a">boot
     time</a>.</p>
 ]]></content:encoded>
<wfw:commentRss>http://blog.timp.com.au/some_tips_on_speeding_up_slackware_122_boot%3A2009-02-14%3AComputers%2CHowto%2CLinux/feed/</wfw:commentRss>
</item>
<item>
<title>Browser Startup
</title>
<link>http://blog.timp.com.au/browser_startup%3A2008-03-19%3AHowto%2CComputers%2CScripting</link>
<comments>http://blog.timp.com.au/browser_startup%3A2008-03-19%3AHowto%2CComputers%2CScripting#comments</comments>
<pubDate>Wed, 19 Mar 2008 23:03:56 +0200</pubDate>
<dc:creator>TimP</dc:creator>
<category>Howto</category>
<category>Computers</category>
<category>Scripting</category>
<guid isPermaLink="false">http://blog.timp.com.au/browser_startup%3A2008-03-19%3AHowto%2CComputers%2CScripting/</guid>
<description><![CDATA[ <p>I've noticed an annoying little problem with a couple of open source web
 [...]]]></description>
<content:encoded><![CDATA[
<p>I've noticed an annoying little problem with a couple of open source web
 browsers namely <a href="http://www.seamonkey-project.org/">Seamonkey</a> and <a
 href="http://kazehakase.sourceforge.jp/">Kazehakase</a>. Both of them have the
 same problem when you run them the normal way, <acronym title="latin: illud est,
 english: that is">ie</acronym> by entering they're name on the command line,
 they fail to do anything if you already have the program open nothing happens.
 I'd prefer if they instead opened a new window, so I've written scripts to "fix"
 this. Basically each of the scripts checks to see if the program is already open
 and if so simply open a new window, otherwise they start the program. Both
 scripts work slightly differently but accomplish nearly the same task (the
 Kazehakase one will not open a link in the new window).</p>
 <p>First we have <code>seamonkey-start</code>:</p>
 <blockquote class="code">
         <font color="#0000ff">#!/bin/bash</font><br />
 
         <font color="#0000ff"># Simple start script for seamonkey</font><br />
 
         <font color="#0000ff"># Tries to open a new window with an already
             running instance, if it can't do</font><br />
 
         <font color="#0000ff"># that it starts a new seamonkey
             instance.</font><br />
 
         <font color="#a52a2a"><b>if</b></font>&nbsp;<font
             color="#a52a2a"><b>[</b></font>&nbsp;<font
             color="#a020f0">$#</font>&nbsp;<font
             color="#a52a2a"><b>==</b></font>&nbsp;<font
             color="#ff00ff">0</font>&nbsp;<font
             color="#a52a2a"><b>]</b></font><font
             color="#a52a2a"><b>;</b></font>&nbsp;<font
             color="#a52a2a"><b>then</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;<font
             color="#a52a2a"><b>if</b></font>&nbsp;<font
             color="#a52a2a"><b>!</b></font>&nbsp;seamonkey -remote <font
             color="#a52a2a"><b>&quot;</b></font><font
             color="#ff00ff">xfeDoCommand(openBrowser)</font><font
             color="#a52a2a"><b>&quot;;</b></font>&nbsp;<font
             color="#a52a2a"><b>then</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seamonkey -splash<font
             color="#a52a2a"><b>;</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>fi</b></font><br />
 
         <font color="#a52a2a"><b>else</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;<font
             color="#a52a2a"><b>if</b></font>&nbsp;<font
             color="#a52a2a"><b>!</b></font>&nbsp;seamonkey -remote <font
             color="#a52a2a"><b>&quot;</b></font><font
             color="#ff00ff">openURL(</font><font color="#a020f0">$1</font><font
             color="#ff00ff">, new-window)</font><font
             color="#a52a2a"><b>&quot;;</b></font>&nbsp;<font
             color="#a52a2a"><b>then</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;seamonkey <font
             color="#a020f0">$1</font><font color="#a52a2a"><b>;</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;<font color="#a52a2a"><b>fi</b></font><br />
 
         <font color="#a52a2a"><b>fi</b></font><br />
 </blockquote>
 
 <p>And next up the <code>kazehakase-start</code>:</p>
 <blockquote class="code">
         <font color="#0000ff">#!/bin/bash</font><br />
 
         <font color="#0000ff"># Simple start script for Kazehakase</font><br />
 
         <font color="#0000ff"># Checks for an already running instance, if so opens a
             new window, else starts</font><br />
 
         <font color="#0000ff"># Kazehakase.</font><br />
 
         <font color="#a52a2a"><b>if</b></font>&nbsp;<font
             color="#6a5acd">[[</font>&nbsp;<font color="#6a5acd">`ps -e </font><font
             color="#a52a2a"><b>|</b></font><font color="#6a5acd">&nbsp;</font><font
             color="#a52a2a"><b>grep</b></font><font color="#6a5acd">&nbsp;kazehakase
             </font><font color="#a52a2a"><b>|</b></font><font
             color="#6a5acd">&nbsp;</font><font color="#a52a2a"><b>grep</b></font><font
             color="#6a5acd">&nbsp;-v kazehakase-star`</font>&nbsp;<font
             color="#a52a2a"><b>!=</b></font>&nbsp;<font
             color="#a52a2a"><b>&quot;&quot;</b></font>&nbsp;<font
             color="#6a5acd">]]</font><font color="#a52a2a"><b>;</b></font>&nbsp;<font
             color="#a52a2a"><b>then</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;kazehakase --action <font
             color="#a52a2a"><b>&quot;</b></font><font
             color="#ff00ff">KzWindow/NewWindow</font><font
             color="#a52a2a"><b>&quot;;</b></font><br />
 
         <font color="#a52a2a"><b>else</b></font><br />
 
         &nbsp;&nbsp;&nbsp;&nbsp;kazehakase <font color="#a020f0">$1</font><font
             color="#a52a2a"><b>;</b></font><br />
 
         <font color="#a52a2a"><b>fi</b></font><br />
 </blockquote>
 
 <p>I'm placing both scripts in the public domain so your welcome to do what ever
 you like with them. If you want to use them on your own computer just copy and
 paste.</p>
 ]]></content:encoded>
<wfw:commentRss>http://blog.timp.com.au/browser_startup%3A2008-03-19%3AHowto%2CComputers%2CScripting/feed/</wfw:commentRss>
</item>
<item>
<title>Installing Kazehakase 0.5.1 on Slackware 12
</title>
<link>http://blog.timp.com.au/installing_kazehakase_051_on_slackware_12%3A2008-01-30%3AHowto%2CLinux%2CComputers</link>
<comments>http://blog.timp.com.au/installing_kazehakase_051_on_slackware_12%3A2008-01-30%3AHowto%2CLinux%2CComputers#comments</comments>
<pubDate>Wed, 30 Jan 2008 23:03:54 +0200</pubDate>
<dc:creator>TimP</dc:creator>
<category>Howto</category>
<category>Linux</category>
<category>Computers</category>
<guid isPermaLink="false">http://blog.timp.com.au/installing_kazehakase_051_on_slackware_12%3A2008-01-30%3AHowto%2CLinux%2CComputers/</guid>
<description><![CDATA[ <p>I recently decided to install <a
 [...]]]></description>
<content:encoded><![CDATA[
<p>I recently decided to install <a
 href="http://kazehakase.sourceforge.jp/">Kazehakase</a> 0.5.1 on my computer. As with any
 software installation of Slackware my first step was to check for a SlackBuild
 on <a href="http://slackbuilds.org">SlackBuilds.org</a>. There is <a
 href="http://slackbuilds.org/repository/12.0/network/kazehakase/">one</a> but
 it is for version 0.4.7. OK, that's often not a problem, you just change the
 <code>$VERSION</code> variable to the version you actually want. So I tried that, the
 SlackBuild printed out the usual range of progress reports, <acronym
     title="Latin: Et Cetera; English: and so on">etc</acronym>, then gave me
 this:</p>
 <blockquote class="code">
     gcc -DHAVE_CONFIG_H -I. -I../.. -I../../src -I../../src/bookmarks -I../../src/libegg/pixbufthumbnail -DGTK_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DG_LOG_DOMAIN=\"Kazehakase-Utils\" -DG_DISABLE_DEPRECATED=1 -O2 -march=i486 -mtune=i686 -Wall -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wcast-align -MT glib-utils.lo -MD -MP -MF .deps/glib-utils.Tpo -c glib-utils.c  -fPIC -DPIC -o .libs/glib-utils.o<br />
     In file included from glib-utils.c:27:<br />
     glib-utils.h:24:18: error: glib.h: No such file or directory<br />
     glib-utils.h:25:21: error: gtk/gtk.h: No such file or directory<br />
     In file included from glib-utils.c:27:<br />
     glib-utils.h:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before
     'G_END_DECLS'<br />
     make[5]: *** [glib-utils.lo] Error 1<br />
     make[5]: Leaving directory `/tmp/SBo/kazehakase-0.5.1/src/utils'<br />
     make[4]: *** [all] Error 2<br />
     make[4]: Leaving directory `/tmp/SBo/kazehakase-0.5.1/src/utils'<br />
     make[3]: *** [all-recursive] Error 1<br />
     make[3]: Leaving directory `/tmp/SBo/kazehakase-0.5.1/src'<br />
     make[2]: *** [all] Error 2<br />
     make[2]: Leaving directory `/tmp/SBo/kazehakase-0.5.1/src'<br />
     make[1]: *** [all-recursive] Error 1<br />
     make[1]: Leaving directory `/tmp/SBo/kazehakase-0.5.1'<br />
     make: *** [all] Error 2<br />
 </blockquote>
 
 <p>What the? It can't find the libraries? Isn't that what <code>configure</code>
 is supposed to do? Oh, well I guess I'll just modify the SlackBuild to pass the
 locations of the libraries required. It can't find some others as well? Darn, I
 guess I'll have to add them as well.</p>
 <p>Fortunately before I went through adding a dozen different libraries
 locations to the SlackBuild, I noticed to following way up in the
 <code>configure</code> output:</p>
 
 <blockquote class="code">
     checking for GTK+ - version &gt;= 2.12.0... no<br />
     *** Could not run GTK+ test program, checking why...<br />
     *** The test program failed to compile or link. See the file config.log for the<br />
     *** exact error that occured. This usually means GTK+ is incorrectly installed.<br />
 </blockquote>
 
 <p>Wait so one of the required libraries is not present (or in my case the
 version was too low), but <code>configure</code> happily lets my continue with
 the build process anyhow? It should just return an error and quit.</p>
 <p>Fortunately, this is not going to stop me, I'll simply upgrade GTK, so I go
 to the <a href="ftp://ftp.slackware.com/pub/">Slackware FTP site</a> find the
 <a
     href="ftp://ftp.slackware.com/pub/slackware/slackware-12.0/source/l/gtk+2">GTK+2</a>
 official SlackBuild and change the <code>$VERSION</code> to 2.12.5 and
 compile the source from <a href="ftp://ftp.gtk.org/pub/gtk/">ftp.gtk.org</a>. 
 There now I should be able to compile Kazehakase, wait no I need to upgrade <a
     href="ftp://ftp.slackware.com/pub/slackware/slackware-12.0/source/l/glib2">glib2</a> 
 and <a
     href="ftp://ftp.slackware.com/pub/slackware/slackware-12.0/source/l/pango">pango</a>
 before I can upgrade GTK+, so I upgrade them to 2.14.5 and 1.18.4 respectively
 and now I can compile GTK+ 2.12.5, and then finally compile Kazehakase 0.5.1.</p>
 <p>Aaah, the joy of a job well done.</p>
 ]]></content:encoded>
<wfw:commentRss>http://blog.timp.com.au/installing_kazehakase_051_on_slackware_12%3A2008-01-30%3AHowto%2CLinux%2CComputers/feed/</wfw:commentRss>
</item>
</channel>
</rss>
