<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">byronc bits</title>
  <subtitle type="text">breaking old technology, one bit at a time</subtitle>

  <updated>2012-01-11T04:59:47Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog" />
  <id>http://byron.theclarkfamily.name/blog/feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://byron.theclarkfamily.name/blog/feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[pm-utils and Locked Screens]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2010/04/06/pm-utils-and-locked-screens" />
    <id>http://byron.theclarkfamily.name/blog/2010/04/06/pm-utils-and-locked-screens</id>
    <updated>2010-04-06T05:54:54Z</updated>
    <published>2010-04-06T05:54:54Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <category scheme="http://byron.theclarkfamily.name/blog" term="archlinux" />
    <summary type="html"><![CDATA[pm-utils and Locked Screens]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2010/04/06/pm-utils-and-locked-screens"><![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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[OpenWRT on the D-Link DIR-615]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2010/03/10/openwrt-on-the-d-link-dir-615" />
    <id>http://byron.theclarkfamily.name/blog/2010/03/10/openwrt-on-the-d-link-dir-615</id>
    <updated>2010-03-10T06:41:01Z</updated>
    <published>2010-03-10T06:41:01Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[OpenWRT on the D-Link DIR-615]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2010/03/10/openwrt-on-the-d-link-dir-615"><![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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[gdb and pthread]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2010/02/19/gdb-and-pthread" />
    <id>http://byron.theclarkfamily.name/blog/2010/02/19/gdb-and-pthread</id>
    <updated>2010-02-19T21:33:22Z</updated>
    <published>2010-02-19T21:33:22Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[gdb and pthread]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2010/02/19/gdb-and-pthread"><![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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[Scripting wireshark with lua]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2009/12/09/scripting-wireshark-with-lua" />
    <id>http://byron.theclarkfamily.name/blog/2009/12/09/scripting-wireshark-with-lua</id>
    <updated>2009-12-09T06:44:23Z</updated>
    <published>2009-12-09T06:44:23Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[Scripting wireshark with lua]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2009/12/09/scripting-wireshark-with-lua"><![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="pygments_tomorrow-night"><pre>tshark -T fields -e http.request.method -e http.request.uri -R <span class="s1">&#39;http&#39;</span>
</pre></div>



]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[View a Certificate]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2009/05/20/view-a-certificate" />
    <id>http://byron.theclarkfamily.name/blog/2009/05/20/view-a-certificate</id>
    <updated>2009-05-20T11:10:40Z</updated>
    <published>2009-05-20T11:10:40Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[View a Certificate]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2009/05/20/view-a-certificate"><![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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[Saving ViM Macros]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2009/03/11/saving-vim-macros" />
    <id>http://byron.theclarkfamily.name/blog/2009/03/11/saving-vim-macros</id>
    <updated>2009-03-11T09:32:01Z</updated>
    <published>2009-03-11T09:32:01Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <category scheme="http://byron.theclarkfamily.name/blog" term="vim" />
    <summary type="html"><![CDATA[Saving ViM Macros]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2009/03/11/saving-vim-macros"><![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="pygments_tomorrow-night"><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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[Sparse Files and tar]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2009/03/08/sparse-files-and-tar" />
    <id>http://byron.theclarkfamily.name/blog/2009/03/08/sparse-files-and-tar</id>
    <updated>2009-03-08T18:50:42Z</updated>
    <published>2009-03-08T18:50:42Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[Sparse Files and tar]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2009/03/08/sparse-files-and-tar"><![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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[More Useful ViM Tags]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2009/03/04/more-useful-vim-tags" />
    <id>http://byron.theclarkfamily.name/blog/2009/03/04/more-useful-vim-tags</id>
    <updated>2009-03-04T20:35:04Z</updated>
    <published>2009-03-04T20:35:04Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <category scheme="http://byron.theclarkfamily.name/blog" term="vim" />
    <summary type="html"><![CDATA[More Useful ViM Tags]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2009/03/04/more-useful-vim-tags"><![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="pygments_tomorrow-night"><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="pygments_tomorrow-night"><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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[application/vnd.fdf and pdftk]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2008/10/06/application/vnd.fdf-and-pdftk" />
    <id>http://byron.theclarkfamily.name/blog/2008/10/06/application/vnd.fdf-and-pdftk</id>
    <updated>2008-10-06T20:40:24Z</updated>
    <published>2008-10-06T20:40:24Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[application/vnd.fdf and pdftk]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2008/10/06/application/vnd.fdf-and-pdftk"><![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>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://byron.theclarkfamily.name/blog</uri>
    </author>
    <title type="html"><![CDATA[Using the verbatim Environment and listings Package with Beamer]]></title>
    <link rel="alternate" type="text/html" href="http://byron.theclarkfamily.name/blog/2008/08/13/using-the-verbatim-environment-and-listings-package-with-beamer" />
    <id>http://byron.theclarkfamily.name/blog/2008/08/13/using-the-verbatim-environment-and-listings-package-with-beamer</id>
    <updated>2008-08-13T22:11:25Z</updated>
    <published>2008-08-13T22:11:25Z</published>
    <category scheme="http://byron.theclarkfamily.name/blog" term="LaTeX" />
    <category scheme="http://byron.theclarkfamily.name/blog" term="tips" />
    <summary type="html"><![CDATA[Using the verbatim Environment and listings Package with Beamer]]></summary>
    <content type="html" xml:base="http://byron.theclarkfamily.name/blog/2008/08/13/using-the-verbatim-environment-and-listings-package-with-beamer"><![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="pygments_tomorrow-night"><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="pygments_tomorrow-night"><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>
  </entry>
</feed>

