<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>byronc bits</title>
    <link>http://byron.theclarkfamily.name/blog</link>
    <description>breaking old technology, one bit at a time</description>
    <pubDate>Fri, 04 Jun 2010 03:12:24 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>pm-utils and Locked Screens</title>
      <link>http://byron.theclarkfamily.name/blog/2010/04/06/pm-utils-and-locked-screens</link>
      <pubDate>Tue, 06 Apr 2010 05:54:54 MDT</pubDate>
      <category><![CDATA[tips]]></category>
      <category><![CDATA[archlinux]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2010/04/06/pm-utils-and-locked-screens</guid>
      <description>pm-utils and Locked Screens</description>
      <content:encoded><![CDATA[<p><a href="http://pm-utils.freedesktop.org/wiki/">pm-utils</a> seems to be the clear winner
   to userspace suspend and hibernate setup.  It's a great back, but, for those of
   us who don't run a desktop environment with a power manager, there's one thing
   missing: screen locking.  I'd like the screen to be locked when my computer
   resumes from either suspend or hibernate, and I don't want to run
   gnome-power-manager to get that functionality.  So,
   <a href="/dump/00lock-screen">00lock-screen</a> to the rescue.  Just drop that file in
   <code>/etc/pm/sleep.d</code> and, as long as you have <code>xscreensaver</code>, <code>gnome-screensaver</code>,
   <code>i3lock</code>, or <code>xlock</code> setup, the screen will lock as your computer suspends or
   hibernates.
</p>
<p>For the Archlinux users, it's already packaged in the AUR:
   <a href="http://aur.archlinux.org/packages.php?ID=36219">pm-utils-screen-lock</a>
</p>]]></content:encoded>
    </item>
    <item>
      <title>OpenWRT on the D-Link DIR-615</title>
      <link>http://byron.theclarkfamily.name/blog/2010/03/10/openwrt-on-the-d-link-dir-615</link>
      <pubDate>Wed, 10 Mar 2010 06:41:01 MST</pubDate>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2010/03/10/openwrt-on-the-d-link-dir-615</guid>
      <description>OpenWRT on the D-Link DIR-615</description>
      <content:encoded><![CDATA[<p>Last night, I finally got around to installing the <a href="https://forum.openwrt.org/viewtopic.php?id=23829">OpenWRT 10.03
Beta</a> on my D-Link
   DIR-615.  The short version: it works and works well.  There were only
   two surprises I ran into.
</p>
<p>The first surprise is that the wireless drivers are not included in
   the install image.  Running <code>opkg update; opkg install kmod-ath9k</code>
   takes care of that.  The drivers are left out by design at least on
   <a href="https://dev.openwrt.org/ticket/6835">this router</a> and the
   <a href="https://dev.openwrt.org/ticket/6833">WRT160NL</a>.  Bonus points to
   OpenWRT for allowing me to file a bug without creating an account on
   their bug tracker.
</p>
<p>The second surprise is that the dynamic dns client doesn't know about
   <a href="http://www.dnsomatic.com">DNS-O-Matic</a>.  I installed the
   <code>ddns-scripts</code> package and used the following config to get it
   working:
</p>
<pre>
config 'service' 'myddns'
	option 'ip_source' 'network'
	option 'ip_network' 'wan'
	option 'check_unit' 'minutes'
	option 'enabled' '1'
	option 'domain' 'all.dnsomatic.com'
	option 'username' 'username'
	option 'password' 'password'
	option 'update_url' 'http://[USERNAME]:[PASSWORD]@updates.dnsomatic.com/nic/update?hostname=[DOMAIN]&myip=[IP]'
	option 'check_interval' '5'
	option 'force_interval' '480'
	option 'force_unit' 'hours'
</pre>]]></content:encoded>
    </item>
    <item>
      <title>gdb and pthread</title>
      <link>http://byron.theclarkfamily.name/blog/2010/02/19/gdb-and-pthread</link>
      <pubDate>Fri, 19 Feb 2010 21:33:22 MST</pubDate>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2010/02/19/gdb-and-pthread</guid>
      <description>gdb and pthread</description>
      <content:encoded><![CDATA[<p>Error message translation time.  Here's an error gdb gave me today:
</p>
<pre>
[Thread debugging using libthread_db enabled]             
Cannot find new threads: generic error
</pre>

<p>Translation: Programs that use pthread functions should really be linked with
   the <code>-lpthread</code> option.
</p>]]></content:encoded>
    </item>
    <item>
      <title>Scripting wireshark with lua</title>
      <link>http://byron.theclarkfamily.name/blog/2009/12/09/scripting-wireshark-with-lua</link>
      <pubDate>Wed, 09 Dec 2009 06:44:23 MST</pubDate>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2009/12/09/scripting-wireshark-with-lua</guid>
      <description>Scripting wireshark with lua</description>
      <content:encoded><![CDATA[
<p>While attempting to wrap some <a
    href="http://www.wireshark.org/">wireshark</a> processing with a bash
script, I discovered that I didn't need to write complex bash code at all,
because wireshark has a built-in scripting language.  Even better, it's a
common scripting language: <a href="http://www.lua.org/">lua</a>.  It looks
like Debian and its derivatives ship wireshark with lua support, but for
everything else, you'll have to rebuild the package to enable it. There's a
great page of <a href="http://wiki.wireshark.org/Lua/Examples">examples</a> and
the <a
    href="http://www.wireshark.org/docs/wsug_html_chunked/wsluarm.html">api</a>
is really simple.  And for those cases where you don't want to use the
wireshark GUI, lua scripts work just fine with tshark.</p>

<p>If lua is overkill for the task at hand, tshark also offers decent control
over what shows up in the output.  If you want to see all HTTP requests and
their request URI and method, without any other information about the packet,
this tshark command will do the trick:</p>

<div class="highlight"><pre>tshark -T fields -e http.request.method -e http.request.uri -R <span class="s1">&#39;http&#39;</span>
</pre></div>

]]></content:encoded>
    </item>
    <item>
      <title>View a Certificate</title>
      <link>http://byron.theclarkfamily.name/blog/2009/05/20/view-a-certificate</link>
      <pubDate>Wed, 20 May 2009 11:10:40 MDT</pubDate>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2009/05/20/view-a-certificate</guid>
      <description>View a Certificate</description>
      <content:encoded><![CDATA[<p>Yet another command I'll never remember unless I write it down.  Here's how to
   view a certificate.  In my case I was viewing a certificate that Mutt had
   stored:
</p>
<pre><code>openssl x509 -in .mutt_certs -noout -text
</code></pre>]]></content:encoded>
    </item>
    <item>
      <title>Saving ViM Macros</title>
      <link>http://byron.theclarkfamily.name/blog/2009/03/11/saving-vim-macros</link>
      <pubDate>Wed, 11 Mar 2009 09:32:01 MDT</pubDate>
      <category><![CDATA[tips]]></category>
      <category><![CDATA[vim]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2009/03/11/saving-vim-macros</guid>
      <description>Saving ViM Macros</description>
      <content:encoded><![CDATA[<p>I use ViM macros (aka <code>complex-repeat</code>) all the time. Occasionally, I find that it would be nice to reuse one of my macros across editing sessions. Turns out it's pretty easy to save the macro. Just add a line like the following to a file that gets sourced when your file is opened by ViM (This example is from <code>~/.vim/ftplugin/rst.vim</code>).
</p>
<div class="highlight"><pre><span class="k">let</span> @<span class="k">h</span> <span class="p">=</span> <span class="c">&quot;yypVr&quot;</span>
</pre></div>


<p>Now, whenever I open a ReStructured Text file, I can hit <code>@h</code> and my macro will run.
</p>]]></content:encoded>
    </item>
    <item>
      <title>Sparse Files and tar</title>
      <link>http://byron.theclarkfamily.name/blog/2009/03/08/sparse-files-and-tar</link>
      <pubDate>Sun, 08 Mar 2009 18:50:42 MDT</pubDate>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2009/03/08/sparse-files-and-tar</guid>
      <description>Sparse Files and tar</description>
      <content:encoded><![CDATA[<p>GNU tar provides the <code>-S</code> option to efficiently handle sparse files. Of course
   it only works if you <em>create</em> the tarball with the <code>-S</code> option. That is all.
</p>]]></content:encoded>
    </item>
    <item>
      <title>More Useful ViM Tags</title>
      <link>http://byron.theclarkfamily.name/blog/2009/03/04/more-useful-vim-tags</link>
      <pubDate>Wed, 04 Mar 2009 20:35:04 MST</pubDate>
      <category><![CDATA[tips]]></category>
      <category><![CDATA[vim]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2009/03/04/more-useful-vim-tags</guid>
      <description>More Useful ViM Tags</description>
      <content:encoded><![CDATA[<p>Frequently, I find myself writing C code that requires the use of <code>struct
ifreq</code>.  There are plenty of fields there and of course there are other
   structures that I never remember.  I could always look in the headers, but it
   ends up being a good amount of digging before I find the real definition and
   all its accompanying pieces.  So, I decided to let ctags and ViM do the work
   for me.  I created <code>~/bin/update_local_tags</code> with the following contents:
</p>
<div class="highlight"><pre><span class="c">#!/bin/sh</span>
<span class="o">[</span> -d ~/.localtags <span class="o">]</span> <span class="o">||</span> mkdir ~/.localtags
ctags -f ~/.localtags/usrinclude.ctags --exclude<span class="o">=</span>vector<span class="se">\*</span>.hpp -R /usr/include &gt;/dev/null 2&gt;&amp;1
</pre></div>


<p>Then I created <code>~/.vim/ftplugin/c.vim</code> with the following contents:
</p>
<div class="highlight"><pre><span class="k">setlocal</span> <span class="k">tags</span><span class="p">+=</span>$HOME<span class="sr">/.localtags/</span>usrinclude.ctags
</pre></div>


<p>For good measure I copied <code>c.vim</code> to <code>cpp.vim</code> so it would be loaded for C++
   file types also.
</p>
<p>Now I just have to run <code>update_local_tags</code> to generate a tag file for
   everything in <code>/usr/include</code> and ViM automatically includes that list whenever
   I edit a C or C++ file.  Updating the tags file is still a manual process, I
   should probably attempt to hook it into apt.  Observant readers will have
   noticed that I exclude <code>vector*.hpp</code> when generating the tags.  Boost includes
   a few generated header files that match this pattern and swell the tag file to
   almost 750 MiB.
</p>]]></content:encoded>
    </item>
    <item>
      <title>application/vnd.fdf and pdftk</title>
      <link>http://byron.theclarkfamily.name/blog/2008/10/06/application/vnd.fdf-and-pdftk</link>
      <pubDate>Mon, 06 Oct 2008 20:40:24 MDT</pubDate>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2008/10/06/application/vnd.fdf-and-pdftk</guid>
      <description>application/vnd.fdf and pdftk</description>
      <content:encoded><![CDATA[<p>So, if a webserver ever serves you a fdf file, you can view the resulting form with evince or your favorite pdf viewer.  Just check the beginning of the fdf file to see which form the fields should be applied to and then run
</p>
<pre><code>pdftk form.pdf fill_form my.fdf output filledform.pdf
</code></pre>]]></content:encoded>
    </item>
    <item>
      <title>Using the verbatim Environment and listings Package with Beamer</title>
      <link>http://byron.theclarkfamily.name/blog/2008/08/13/using-the-verbatim-environment-and-listings-package-with-beamer</link>
      <pubDate>Wed, 13 Aug 2008 22:11:25 MDT</pubDate>
      <category><![CDATA[LaTeX]]></category>
      <category><![CDATA[tips]]></category>
      <guid isPermaLink="true">http://byron.theclarkfamily.name/blog/2008/08/13/using-the-verbatim-environment-and-listings-package-with-beamer</guid>
      <description>Using the verbatim Environment and listings Package with Beamer</description>
      <content:encoded><![CDATA[<p>I finally figured out how to make the <code>verbatim</code> environment work with Beamer. Beamer can't handle the following code:
</p>
<div class="highlight"><pre><span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}{</span>A Title<span class="nb">}</span>
    <span class="k">\begin</span><span class="nb">{</span>verbatim<span class="nb">}</span>
    Don&#39;t mess with my text.
    <span class="k">\end</span><span class="nb">{</span>verbatim<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>
</pre></div>


<p>To make it work, you need to include the fragile option for the frame.  Example:
</p>
<div class="highlight"><pre><span class="k">\begin</span><span class="nb">{</span>frame<span class="nb">}</span>[fragile]<span class="nb">{</span>A Title<span class="nb">}</span>
    <span class="k">\begin</span><span class="nb">{</span>verbatim<span class="nb">}</span>
    Don&#39;t mess with my text.
    <span class="k">\end</span><span class="nb">{</span>verbatim<span class="nb">}</span>
<span class="k">\end</span><span class="nb">{</span>frame<span class="nb">}</span>
</pre></div>


<p>If you use the <code>listings</code> package, the same trick works for the <code>lstlistings</code> environment.
</p>]]></content:encoded>
    </item>
  </channel>
</rss>
