<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog &#124; edwards research &#187; linux</title>
	<atom:link href="http://blog.edwards-research.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.edwards-research.com</link>
	<description>some notes from our staff...</description>
	<lastBuildDate>Wed, 04 May 2011 02:11:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Linux: Extract audio from .mp4 (video + audio) to .mp3&#160;(audio)</title>
		<link>http://blog.edwards-research.com/2010/12/linux-extract-audio-from-mp4-video-audio-to-mp3-audio/</link>
		<comments>http://blog.edwards-research.com/2010/12/linux-extract-audio-from-mp4-video-audio-to-mp3-audio/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 04:19:31 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mp4]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=431</guid>
		<description><![CDATA[I found myself in a situation where the only access I had to an audio track was having it embedded in an .mp4 file and I wanted just the audio in an .mp3 file. This probably isn&#8217;t a common occurrence, but seeing as this could help extract the audio from .mp4s downloaded from popular video [...]]]></description>
			<content:encoded><![CDATA[<p>I found myself in a situation where the only access I had to an audio track was having it embedded in an .mp4 file and I wanted just the audio in an .mp3 file.  This probably isn&#8217;t a common occurrence, but seeing as this could help extract the audio from .mp4s <a href="http://www.downloadhelper.net/">downloaded</a> from <a href="http://www.youtube.com">popular video sites</a>, this might be of some use.</p>
<p>First of all, I realize there are probably more ways to do this than can be reasonably listed.  In fact, there are probably a bunch of tools that do this exact same thing.  This was a one off thing, really, so I didn&#8217;t spend time looking for a package that did everything.  It was only after I did it once that I decided to turn it into a shell script to make it easy to use again in the future.</p>
<p><strong>Note:</strong> You need mplayer and lame for this.</p>
<pre>
[james@fractal ~]$ lame -?
LAME 64bits version 3.98.3 (http://www.mp3dev.org/)
...
</pre>
<pre>
[james@fractal ~]$ mplayer -h
...
MPlayer SVN-r31628-4.4.4 (C) 2000-2010 MPlayer Team
</pre>
<pre class="brush: bash; title: ;">
#!/bin/bash
#
# EDWARDS RESEARCH
# www.edwards-research.com
#
# This converts the audio from .mp4 files that include video (e.g. youtube.com streams) to
# .mp3 files.
#

# If file exists, set $FILE
#   I know this is a sloppy way to handle command line arguments -- I'm ok with that.  (I
#   was going to provide for options, blah blah...)
if [[ -e ${1} ]] ; then
    FILE=${1}
fi

# Ensure input file exits
if [[ -z $FILE ]] ; then
    echo &quot;File not found -- exiting.&quot;
    exit
fi

# Extract Filename
base=$(basename &quot;${FILE}&quot; .mp4)

# Dump audio from .mp4 to .wav with mplayer
#   So, it looks as if it doesn't make a difference in terms of the output (at least from
#   my small test group) whether you pick pcm:waveheader or pcm:fast. pcm:waveheader takes
#   more than twice as long to convert but pcm:fast complains.  I'm going to leave it at
#   waveheader because I'm not in a rush and I'd rather not have the warnings.  Feel free
#   to change this to pcm:fast and experiment.
#       -ao pcm:waveheader -&gt; 59 seconds, 4625553 byte .mp3
#       -ao pcm:fast       -&gt; 22 seconds, 4625553 byte .mp3
#
#   mplayer  -vc null -vo null -nocorrect-pts -ao pcm:fast &quot;${FILE}&quot;
#
mplayer -vc null -vo null -nocorrect-pts -ao pcm:waveheader &quot;${FILE}&quot;
RV=$?
if [[ $RV != 0 ]] ; then
    echo &quot;mplayer completed unsuccessfully -- exiting.&quot;
    exit
fi

# Convert .wav to .mp3
lame -h -b 192 audiodump.wav &quot;${base}.mp3&quot; ${VERB}
RV=$?
if [[ $RV != 0 ]] ; then
    echo &quot;lame completed unsuccessfully -- exiting.&quot;
    exit
fi

# Cleanup Temporary File
rm audiodump.wav

echo &quot;Conversion complete.&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/12/linux-extract-audio-from-mp4-video-audio-to-mp3-audio/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>gedit syntax coloring for&#160;AMPL</title>
		<link>http://blog.edwards-research.com/2010/10/gedit-syntax-coloring-for-ampl/</link>
		<comments>http://blog.edwards-research.com/2010/10/gedit-syntax-coloring-for-ampl/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 12:09:26 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[ampl]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[gedit]]></category>
		<category><![CDATA[syntax coloring]]></category>
		<category><![CDATA[syntax highlighting]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=423</guid>
		<description><![CDATA[(Note: the coloring is by no means perfect or even all that logical, so please tweak to whatever extent you desire.) I use AMPL a lot in my research and I wanted gedit (my linux IDE of choice) to color the syntax to make programming easier. Below is a quick run down of how to [...]]]></description>
			<content:encoded><![CDATA[<p>(Note: the coloring is by no means perfect or even all that logical, so please tweak to whatever extent you desire.)</p>
<p>I use <a href="http://www.ampl.com/">AMPL</a> a lot in my research and I wanted gedit (my linux IDE of choice) to color the syntax to make programming easier.</p>
<p>Below is a quick run down of how to get syntax coloring / syntax highlighting working in Fedora 14 (same procedure works in F12 and F13 as far as I can tell).</p>
<h2>Create AMPL Language File</h2>
<p>This should be placed in:</p>
<pre>~/.local/share/gtksourceview-2.0/language-specs/ampl.lang</pre>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!--

 Author: Edwards Research &lt;http://www.edwards-research.com&gt;
 Copyright (C) 2010 Edwards Research &lt;http://www.edwards-research.com&gt;

--&gt;
&lt;language id=&quot;ampl&quot; _name=&quot;AMPL&quot; version=&quot;2.0&quot; _section=&quot;Scripts&quot;&gt;
  &lt;metadata&gt;
    &lt;!-- &lt;property name=&quot;mimetypes&quot;&gt;text/x-ampl;text/plain&lt;/property&gt; --&gt;
    &lt;property name=&quot;mimetypes&quot;&gt;&lt;/property&gt;
    &lt;property name=&quot;globs&quot;&gt;*.mod;*.dat;*.run&lt;/property&gt;
    &lt;property name=&quot;line-comment-start&quot;&gt;#&lt;/property&gt;
  &lt;/metadata&gt;

  &lt;styles&gt;
    &lt;style id=&quot;comment&quot; _name=&quot;Comment&quot; map-to=&quot;def:comment&quot;/&gt;
    &lt;style id=&quot;keyword&quot; _name=&quot;Keyword&quot; map-to=&quot;def:keyword&quot;/&gt;
    &lt;style id=&quot;operator&quot; _name=&quot;Operator&quot; map-to=&quot;def:operator&quot;/&gt;
    &lt;style id=&quot;math&quot; _name=&quot;math&quot; map-to=&quot;def:string&quot;/&gt;
    &lt;style id=&quot;logic&quot; _name=&quot;logic&quot; map-to=&quot;def:special-constant&quot;/&gt;
    &lt;style id=&quot;bracket&quot; _name=&quot;Bracket&quot; map-to=&quot;def:operator&quot;/&gt;
    &lt;style id=&quot;floating-point&quot; _name=&quot;Floating point number&quot; map-to=&quot;def:floating-point&quot;/&gt;
    &lt;style id=&quot;decimal&quot; _name=&quot;Decimal number&quot; map-to=&quot;def:decimal&quot;/&gt;
    &lt;style id=&quot;type&quot; _name=&quot;Type&quot; map-to=&quot;def:type&quot;/&gt;
  &lt;/styles&gt;

  &lt;default-regex-options case-sensitive=&quot;false&quot;/&gt;

  &lt;definitions&gt;
    &lt;context id=&quot;ampl&quot;&gt;
      &lt;include&gt;
        &lt;context id=&quot;comment&quot; style-ref=&quot;comment&quot; end-at-line-end=&quot;true&quot;&gt;
          &lt;start&gt;#&lt;/start&gt;
          &lt;end&gt;\n&lt;/end&gt;
        &lt;/context&gt;

        &lt;context id=&quot;comment-multiline&quot; style-ref=&quot;comment&quot; class=&quot;comment&quot; class-disabled=&quot;no-spell-check&quot;&gt;
            &lt;start&gt;/\*&lt;/start&gt;
            &lt;end&gt;\*/&lt;/end&gt;
            &lt;include&gt;
                &lt;context ref=&quot;def:in-comment&quot;/&gt;
            &lt;/include&gt;
        &lt;/context&gt;

        &lt;context id=&quot;keyword&quot; style-ref=&quot;keyword&quot;&gt;
          &lt;keyword&gt;minimize&lt;/keyword&gt;
          &lt;keyword&gt;maximize&lt;/keyword&gt;
          &lt;keyword&gt;subject to&lt;/keyword&gt;
          &lt;keyword&gt;check&lt;/keyword&gt;
          &lt;keyword&gt;within&lt;/keyword&gt;
          &lt;keyword&gt;cross&lt;/keyword&gt;
          &lt;keyword&gt;in&lt;/keyword&gt;
          &lt;keyword&gt;from&lt;/keyword&gt;
          &lt;keyword&gt;to&lt;/keyword&gt;
          &lt;keyword&gt;obj&lt;/keyword&gt;
          &lt;keyword&gt;net_in&lt;/keyword&gt;
          &lt;keyword&gt;net_out&lt;/keyword&gt;
        &lt;/context&gt;

        &lt;context id=&quot;type&quot; style-ref=&quot;type&quot;&gt;
          &lt;keyword&gt;var&lt;/keyword&gt;
          &lt;keyword&gt;set&lt;/keyword&gt;
          &lt;keyword&gt;param&lt;/keyword&gt;
          &lt;keyword&gt;node&lt;/keyword&gt;
          &lt;keyword&gt;arc&lt;/keyword&gt;
          &lt;keyword&gt;let&lt;/keyword&gt;
          &lt;keyword&gt;model&lt;/keyword&gt;
          &lt;keyword&gt;data&lt;/keyword&gt;
          &lt;keyword&gt;display&lt;/keyword&gt;
        &lt;/context&gt;

        &lt;context id=&quot;math&quot; style-ref=&quot;math&quot;&gt;
          &lt;keyword&gt;abs&lt;/keyword&gt;
          &lt;keyword&gt;acos&lt;/keyword&gt;
          &lt;keyword&gt;acosh&lt;/keyword&gt;
          &lt;keyword&gt;asin&lt;/keyword&gt;
          &lt;keyword&gt;ainsh&lt;/keyword&gt;
          &lt;keyword&gt;atan&lt;/keyword&gt;
          &lt;keyword&gt;atan2&lt;/keyword&gt;
          &lt;keyword&gt;atanh&lt;/keyword&gt;
          &lt;keyword&gt;cos&lt;/keyword&gt;
          &lt;keyword&gt;cosh&lt;/keyword&gt;
          &lt;keyword&gt;exp&lt;/keyword&gt;
          &lt;keyword&gt;log&lt;/keyword&gt;
          &lt;keyword&gt;log10&lt;/keyword&gt;
          &lt;keyword&gt;max&lt;/keyword&gt;
          &lt;keyword&gt;min&lt;/keyword&gt;
          &lt;keyword&gt;sin&lt;/keyword&gt;
          &lt;keyword&gt;sinh&lt;/keyword&gt;
          &lt;keyword&gt;sqrt&lt;/keyword&gt;
          &lt;keyword&gt;tan&lt;/keyword&gt;
          &lt;keyword&gt;tanh&lt;/keyword&gt;
          &lt;keyword&gt;sum&lt;/keyword&gt;
          &lt;keyword&gt;prod&lt;/keyword&gt;
          &lt;keyword&gt;\+&lt;/keyword&gt;
          &lt;keyword&gt;-&lt;/keyword&gt;
          &lt;keyword&gt;/&lt;/keyword&gt;
          &lt;keyword&gt;\*&lt;/keyword&gt;
        &lt;/context&gt;

        &lt;context id=&quot;logic&quot; style-ref=&quot;logic&quot;&gt;
          &lt;keyword&gt;if&lt;/keyword&gt;
          &lt;keyword&gt;then&lt;/keyword&gt;
          &lt;keyword&gt;else&lt;/keyword&gt;
          &lt;keyword&gt;or&lt;/keyword&gt;
          &lt;keyword&gt;exists&lt;/keyword&gt;
          &lt;keyword&gt;forall&lt;/keyword&gt;
          &lt;keyword&gt;for&lt;/keyword&gt;
          &lt;keyword&gt;and&lt;/keyword&gt;
          &lt;keyword&gt;not&lt;/keyword&gt;
          &lt;keyword&gt;in&lt;/keyword&gt;
          &lt;keyword&gt;not in&lt;/keyword&gt;
        &lt;/context&gt;

        &lt;context id=&quot;operators&quot; style-ref=&quot;operator&quot; extend-parent=&quot;false&quot;&gt;
          &lt;match&gt;[:;\=&amp;lt;&amp;gt;]&lt;/match&gt;
        &lt;/context&gt;

        &lt;context id=&quot;brackets&quot; style-ref=&quot;bracket&quot; extend-parent=&quot;false&quot;&gt;
          &lt;match&gt;[\{\}()\[\]]&lt;/match&gt;
        &lt;/context&gt;

        &lt;context id=&quot;float&quot; style-ref=&quot;floating-point&quot;&gt;
          &lt;match extended=&quot;true&quot;&gt;
            (?&amp;lt;![\w\.])
            ([0-9]+[Ee][+-]?[0-9]+ |
             ([0-9]*\.[0-9]+ | [0-9]+\.[0-9]*)([Ee][+-]?[0-9]+)?)
            (?![\w\.])
          &lt;/match&gt;
        &lt;/context&gt;

        &lt;context id=&quot;decimal-number&quot; style-ref=&quot;decimal&quot;&gt;
          &lt;match extended=&quot;true&quot;&gt;
            (?&amp;lt;![\w\.])
            [+-]?([1-9][0-9]*|0)
            (?![\w\.])
          &lt;/match&gt;
        &lt;/context&gt;

      &lt;/include&gt;
    &lt;/context&gt;

  &lt;/definitions&gt;
&lt;/language&gt;
</pre>
<p>Since this overloads the text/plain MIME-type, this is all you need to do, however AMPL files may not open in gedit automatically colored correctly.  To fix this, you will want to define a MIME-type of text/x-ampl.</p>
<h2>Define AMPL MIME-type</h2>
<p>This should be placed in:</p>
<pre>~/.local/share/mime/text/x-ampl.xml</pre>
<pre class="brush: xml; title: ;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;mime-type xmlns=&quot;http://www.freedesktop.org/standards/shared-mime-info&quot; type=&quot;text/x-ampl&quot;&gt;
  &lt;!--Created automatically by update-mime-database. DO NOT EDIT!--&gt;
  &lt;comment&gt;AMPL Source&lt;/comment&gt;
  &lt;glob pattern=&quot;*.mod&quot;/&gt;
  &lt;glob pattern=&quot;*.dat&quot;/&gt;
  &lt;glob pattern=&quot;*.run&quot;/&gt;
&lt;/mime-type&gt;
</pre>
<p>Alternatively, you could add lines 2-8 to</p>
<pre>/usr/share/mime/packages/freedesktop.org.xml</pre>
<p>&#8230; and then run</p>
<pre>sudo update-mime-database /usr/local/share/mime</pre>
<p>&#8230; to update the mime database.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/10/gedit-syntax-coloring-for-ampl/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Linux: Refresh group membership without logging&#160;out</title>
		<link>http://blog.edwards-research.com/2010/10/linux-refresh-group-membership-without-logging-out/</link>
		<comments>http://blog.edwards-research.com/2010/10/linux-refresh-group-membership-without-logging-out/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 17:10:44 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[groups]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=420</guid>
		<description><![CDATA[Have you ever added yourself to a group by editing /etc/group then realized the change doesn&#8217;t take effect until next time you log in (or spawn a new shell)? Found this nice trick out today: exec su -l $USER (Note: it makes you re-enter your password, but you don&#8217;t have to restart sessions)]]></description>
			<content:encoded><![CDATA[<p>Have you ever added yourself to a group by editing /etc/group then realized the change doesn&#8217;t take effect until next time you log in (or spawn a new shell)?</p>
<p>Found this nice trick out today:</p>
<pre>exec su -l $USER</pre>
<p>(Note: it makes you re-enter your password, but you don&#8217;t have to restart sessions)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/10/linux-refresh-group-membership-without-logging-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe Air on Fedora 12&#160;x64</title>
		<link>http://blog.edwards-research.com/2010/03/adobe-air-on-fedora-12-x64/</link>
		<comments>http://blog.edwards-research.com/2010/03/adobe-air-on-fedora-12-x64/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 22:24:02 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[adobe air]]></category>
		<category><![CDATA[pandora]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=362</guid>
		<description><![CDATA[I support Pandora and like the Pandora One desktop app (info and download, blog post). Trying to get it to run successfully on Fedora was kind of a hassle. Also, I&#8217;ve done this twice now and have had to do different things, so I&#8217;ll list them all. First I downloaded the Adobe Air Installer. wget [...]]]></description>
			<content:encoded><![CDATA[<p>I support <a href="http://www.pandora.com">Pandora</a> and like the Pandora One desktop app (<a href="http://www.pandora.com/desktop_app">info and download</a>, <a href="http://blog.pandora.com/pandora/archives/2009/05/pandora_one_upg.html">blog post</a>).</p>
<p>Trying to get it to run successfully on Fedora was kind of a hassle.</p>
<p>Also, I&#8217;ve done this twice now and have had to do different things, so I&#8217;ll list them all.</p>
<p>First I downloaded the Adobe Air Installer.</p>
<pre class="brush: bash; title: ;">
wget http://airdownload.adobe.com/air/lin/download/latest/AdobeAIRInstaller.bin
</pre>
<p>&#8230; you could also have downloaded it through Firefox or whatever.</p>
<p>Now change the permissions and attempt to run it:</p>
<pre class="brush: bash; title: ;">
chmod u+x AdobeAIRInstaller.bin
./AdobeAIRInstaller.bin
</pre>
<p>Here I got a little dialog window, it looked like it began to install but then failed when it said that I needed <strong>gnome-keyring-daemon</strong> to be running.</p>
<p>The fact is, I had the gnome-keyring-daemon running.  A simple ps confirmed this:</p>
<pre class="brush: bash; title: ;">
ps aux | grep keyring
</pre>
<p>The problem, it turned out, was that I had the x64 version of the keyring daemon running and was missing some x86 libraries.</p>
<p>I installed the x86 version of the gnome-keyring:</p>
<pre class="brush: bash; title: ;">
sudo yum install gnome-keyring.i686
</pre>
<p>&#8230; but that didn&#8217;t seem to do it &#8212; I was still missing something.</p>
<p>After some googling I came across a <a href=" http://www.fedoraforum.org/forum/showthread.php?t=235193">forum post</a> saying these packages were also necessary:</p>
<pre class="brush: bash; title: ;">
yum install ld-linux.so.2 gtk2-devel.i686 libxml2.i686 libXt.so.6
yum install xterm rpm-libs.i686 nss.i686 libcanberra-gtk2.i686
</pre>
<p>This helped run the installer and it completed but threw an error that didn&#8217;t seem to cause any problems.  For good measure I installed this package too to address the error:</p>
<pre class="brush: bash; title: ;">
sudo yum install PackageKit-gtk-module.i686
</pre>
<p>So now I had Adobe Air successfully installed, but whenever I tried to install an Air application, I would get a segfault.</p>
<pre class="brush: plain; title: ;">Application crashed with an unhandled SIGSEGV</pre>
<p>I was able to see this message by running &#8220;Adobe AIR Application Installer&#8221; from command line, not the Application menu.  Otherwise, the installer would pop up for a split second and immediately disappear.</p>
<p>Anyway, after some more googling, I came across <a href="http://forums.fedoraforum.org/showthread.php?t=230019">a forum post</a> regarding certificates and a fix.</p>
<p>The command basically goes through the Adobe certificates and marks them as trusted (aucm is the <strong>Adobe Unix Certificate-Store Manager</strong>)</p>
<pre class="brush: bash; title: ;">
for c in /etc/opt/Adobe/certificates/crypt/*.0; do sudo aucm -n $(basename $c) -t true; done
</pre>
<p>(I added the sudo because I wasn&#8217;t running as root and that gave me a ton of <strong>&#8220;Root permissions are required to modify the certificate store.&#8221;</strong> errors.)</p>
<p>After running that, I got a lot of <strong>&#8220;Certificate Found, processing&#8230; Property changed.&#8221;</strong> messages.</p>
<p>Once that was complete, I was able to install the Pandora Air Application and run it without problems.</p>
<p>To summarize without the details:</p>
<pre class="brush: bash; title: ;">
cd /tmp
wget http://airdownload.adobe.com/air/lin/download/latest/AdobeAIRInstaller.bin
chmod u+x AdobeAIRInstaller.bin
./AdobeAIRInstaller.bin
sudo yum install gnome-keyring.i686 ld-linux.so.2 gtk2-devel.i686
sudo yum install libxml2.i686 libXt.so.6 xterm rpm-libs.i686
sudo yum install nss.i686 libcanberra-gtk2.i686 PackageKit-gtk-module.i686
for c in /etc/opt/Adobe/certificates/crypt/*.0; do sudo aucm -n $(basename $c) -t true; done
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/03/adobe-air-on-fedora-12-x64/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Moving a Subversion&#160;Repository</title>
		<link>http://blog.edwards-research.com/2010/01/moving-a-subversion-repository/</link>
		<comments>http://blog.edwards-research.com/2010/01/moving-a-subversion-repository/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 08:50:41 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[versioning]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=339</guid>
		<description><![CDATA[Sometimes it is necessary to move a subversion repository. In this case, it was because I wanted to consolidate a few subversion repositories into one directory on a dedicated hard drive. Moving a subversion repository usually consists of two steps: Moving the repository Updating the working copy to reflect the repository move This post will [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is necessary to move a subversion repository.  In this case, it was because I wanted to consolidate a few subversion repositories into one directory on a dedicated hard drive.</p>
<p>Moving a subversion repository usually consists of two steps:</p>
<ol>
<li>Moving the repository</li>
<li>Updating the working copy to reflect the repository move</li>
</ol>
<p>This post will handle both steps.</p>
<h2>Move the repository</h2>
<p>Instead of actually moving the repository as one would expect, we&#8217;re going to backup our existing repository, import out backup into a newly created one.  First we&#8217;ll list the commands, then break down what we&#8217;re doing.</p>
<pre class="brush: plain; title: ;">
svnadmin dump /path/to/old-repository &gt; ~/repo.dmp
svnadmin create /path/to/new-repository
(Update file/directory permissions)
(Update repository permissions)
svnadmin load repository-name &lt; ~/repo.dmp
</pre>
<ol>
<li>L1: We dump the repository into a backup file.</li>
<li>L2: Create a new repository.</li>
<li>L3: Update file / directory permissions (by using some combination of <strong>chown</strong>, <strong>chgrp </strong>and <strong>chmod</strong>)</li>
<li>L4: Update repository permissions (by editing files like <strong>/path/to/new-repository/conf/passwd</strong> and <strong>/path/to/new-repository/conf/svnserve.conf</strong>)</li>
<li>L5: Extract the backup into the new repository.</li>
</ol>
<h2>Update the working copy</h2>
<p>Once we&#8217;ve moved our repository, we now need to update the working copy so that commits and updates will reference our new repository.</p>
<pre class="brush: plain; title: ;">
cd /path/to/working-copy
svn info
svn switch --relocate svn://hostname/path/to/old-repository svn://hostname/path/to/new-repository
svn info
</pre>
<ol>
<li>L1: We change to the path of the working copy.</li>
<li>L2: Display the path to the old repository through the <strong>svn info</strong> command.</li>
<li>L3: Switch the working copy&#8217;s repository.</li>
<li>L4: Display the path the the working copy&#8217;s repository (verify that the switch worked) through the <strong>svn info</strong> command.</li>
</ol>
<h2>Clean up</h2>
<p>Now that we&#8217;re done moving the repository, we want to verify the move and clean up.  To verify the move, we can just check the output of the <strong>svn info </strong>command.  To further verify, we can run <strong>svn update</strong> to ensure that nothing is updated.</p>
<p>We will probably also want to remove both the old repository and the backup file.  A simple <strong>rm -r</strong> for the repository and <strong>rm</strong> for the backup file is fine.</p>
<p>Lastly, its possible that you would want to use a trimmed down set one of these steps.  For example, if you didn&#8217;t care about keeping the version history and just wanted to move the repository location, you could skip steps 1 and 5 in the first section.   Also, if you didn&#8217;t care about moving the working directory but just wanted to make a complete copy of the repository including the version history, you could complete the whole second section.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/01/moving-a-subversion-repository/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>ping fails but dig / nslookup&#160;works?</title>
		<link>http://blog.edwards-research.com/2010/01/ping-fails-but-dig-nslookup-works/</link>
		<comments>http://blog.edwards-research.com/2010/01/ping-fails-but-dig-nslookup-works/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 20:27:11 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[dig]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[nslookup]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[resolv.conf]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=334</guid>
		<description><![CDATA[I&#8217;ve now run into two scenarios where this happened. The most recent was after I had to kill a vpnc process (used to connect to a cisco VPN). It looks like this: [james@workstation ~]$ ping google.com ping: unknown host google.com [james@workstation ~]$ dig google.com +short 72.14.204.147 72.14.204.99 72.14.204.103 72.14.204.104 What ended up happening was that [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve now run into two scenarios where this happened.  The most recent was after I had to kill a vpnc process (used to connect to a cisco VPN).</p>
<p>It looks like this:</p>
<pre class="brush: plain; title: ;">
[james@workstation ~]$  ping google.com
ping: unknown host google.com

[james@workstation ~]$  dig google.com +short
72.14.204.147
72.14.204.99
72.14.204.103
72.14.204.104
</pre>
<p>What ended up happening was that the VPN was configured to tunnel <strong>all</strong> traffic through it, so when it re-wrote the /etc/resolv.conf file, it didn&#8217;t append the VPN nameservers to the nameservers provided to us by our DHCP lease, but completely overwrote them.  I&#8217;m assuming that when you closed the VPN it would replace the resolv.conf file with the one containing the non-VPN nameservers but since I killed it, it was not restored.</p>
<p>Anyway, the fix was easy but finding it out was annoying.</p>
<p>All you have to do is release and renew your DHCP lease.</p>
<p>You could try:</p>
<pre class="brush: bash; title: ;">dhclient -r; dhclient</pre>
<p>&#8230; but I was on an SSH connection and I didn&#8217;t quite trust the second command to be run after I lost the connection when the lease was released (this seems like a silly fear but whatever).</p>
<p>Instead I wrote a bash script and put it in a file:</p>
<pre class="brush: bash; title: ;">
#!/bin/bash
#refreshlease.sh
IFACE=&quot;eth0&quot;

dhclient -r ${IFACE}
dhclient ${IFACE}
</pre>
<p>&#8230; and ran that over the SSH connection.  The connection seemed to get dropped for a few seconds but then came back up.  Checking /etc/resolv.conf showed that my original nameservers were, in fact, back and I was able to resolve DNS queries:</p>
<pre class="brush: plain; title: ;">
[james@workstation ~]$  ping google.com
PING google.com (64.233.169.105) 56(84) bytes of data.
64 bytes from yo-in-f105.1e100.net (64.233.169.105): icmp_seq=1 ttl=238 time=31.1 ms
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/01/ping-fails-but-dig-nslookup-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Bash Trick: Looping through output&#160;lines</title>
		<link>http://blog.edwards-research.com/2010/01/quick-bash-trick-looping-through-output-lines/</link>
		<comments>http://blog.edwards-research.com/2010/01/quick-bash-trick-looping-through-output-lines/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 06:16:53 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[code sippets]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=322</guid>
		<description><![CDATA[Lets say you want to add line numbers to a text file. For example, you want to see this file: The quick brown fox jumps over the lazy dog &#8230; displayed on your screen list this: 1 The quick brown fox 2 jumps over the 3 lazy dog Of course, you could use cat -n [...]]]></description>
			<content:encoded><![CDATA[<p>Lets say you want to add line numbers to a text file.  For example, you want to see this file:</p>
<pre class="brush: plain; title: ;">
The quick brown fox
jumps over the
lazy dog
</pre>
<p>&#8230; displayed on your screen list this:</p>
<pre class="brush: plain; title: ;">
1  The quick brown fox
2  jumps over the
3  lazy dog
</pre>
<p>Of course, you could use <strong>cat -n</strong> if you&#8217;re using <strong>cat</strong> and want line numbers, but if you want to, say, add a 4 space indent to the output of <strong>iwconfig</strong>, the following technique will work.</p>
<p>First, we run the program / script and capture the output:</p>
<pre class="brush: bash; title: ;">output=$(iwconfig 2&gt;/dev/null)</pre>
<p>Here we&#8217;re running <strong>iwconfig</strong> in a subshell and capturing the output.  In this case, I&#8217;m redirecting stderr to /dev/null, otherwise iwconfig returns lines like <em>lo        no wireless extensions.</em> up through the subshell to the shell thats calling the bash script.  I don&#8217;t want this so I&#8217;m throwing it out.</p>
<p>Next, we loop through the output using a for loop:</p>
<pre class="brush: bash; title: ;">
for LINE in ${output} ; do

    echo ${LINE}

done
</pre>
<p>Running this will not get us the output we&#8217;re expecting, it will return each space-separated word/phrase <em>on it&#8217;s own line</em>.  If we are still talking about the pangram above, we would see:</p>
<pre class="brush: plain; title: ;">
The
quick
brown
fox
jumps
over
the
lazy
dog
</pre>
<p>The problem is, the IFS (Internal Field Separator) contains the space character.</p>
<p>(Quick Aside)<br />
To see what the IFS is, type:</p>
<pre class="brush: bash; title: ;">echo -n &quot;$IFS&quot; | hexdump</pre>
<p>My IFS contains 0&#215;09, 0&#215;20, 0x0a (tab, space and newline respectively).<br />
(End Aside)</p>
<p>We can change the $IFS in our script (to only contain the newline character) which lets us iterate through the output where separated by newlines.</p>
<p>First, we save the original IFS and define the newline IFS:</p>
<pre class="brush: bash; title: ;">
OIFS=&quot;${IFS}&quot;
NIFS=$'\n'
</pre>
<p>Next we set the IFS to our newline IFS:</p>
<pre class="brush: bash; title: ;">
IFS=&quot;${NIFS}&quot;
</pre>
<p>Then, we loop through the output (in the loop we reset the IFS incase we expect it to include the space, etc. and then set it to newline IFS before our next iteration)</p>
<pre class="brush: bash; title: ;">
for LINE in ${output} ; do
    IFS=&quot;${OIFS}&quot;

    echo &quot;---- ${LINE}&quot;

    IFS=&quot;${NIFS}&quot;
done
</pre>
<p>Lastly, we reset the IFS:</p>
<pre class="brush: bash; title: ;">IFS=&quot;${OIFS}&quot;</pre>
<p>The final code looks like this:</p>
<pre class="brush: bash; title: ;">
        output=$(iwconfig 2&gt;/dev/null)

        OIFS=&quot;${IFS}&quot;
        NIFS=$'\n'

        IFS=&quot;${NIFS}&quot;

        for LINE in ${output} ; do
            IFS=&quot;${OIFS}&quot;

            echo &quot;---- ${LINE}&quot;

            IFS=&quot;${NIFS}&quot;
        done
        IFS=&quot;${OIFS}&quot;
</pre>
<p>&#8230; and we get what we had hoped:</p>
<pre class="brush: plain; title: ;">
---- The quick brown fox
---- jumps over the
---- lazy dog
</pre>
<p>In closing, it should be noted that I&#8217;ve done this a few different ways (including splitting the output with awk / sed) but I like the simplicity of this method.  I may try to find the other methods and write them up to if I get some time.</p>
<p>P.S.  If you ever need to reset your IFS but don&#8217;t want to close the terminal, type this:</p>
<pre class="brush: bash; title: ;">
IFS=$'\n\t '
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2010/01/quick-bash-trick-looping-through-output-lines/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How To: Speed up X Tunneling over&#160;SSH</title>
		<link>http://blog.edwards-research.com/2009/11/how-to-speed-up-x-tunneling-over-ssh/</link>
		<comments>http://blog.edwards-research.com/2009/11/how-to-speed-up-x-tunneling-over-ssh/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 07:52:26 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[networking]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[putty]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=252</guid>
		<description><![CDATA[I use PuTTY (actually, I use PuTTY tray) and XWin Server to run Linux GUI applications in Windows.  Basically, I have a headless Linux server running and I connect to it via SSH.  While 90% of the things I do on it are command-line based, I&#8217;ve yet to find a real good strategy for developing [...]]]></description>
			<content:encoded><![CDATA[<p>I use <a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/">PuTTY</a> (actually, I use <a href="http://haanstra.eu/putty/">PuTTY tray</a>) and <a href="http://x.cygwin.com/devel/server/">XWin Server</a> to run Linux GUI applications in Windows.  Basically, I have a headless Linux server running and I connect to it via SSH.  While 90% of the things I do on it are command-line based, I&#8217;ve yet to find a real good strategy for developing <em><strong>true</strong></em> linux C/C++ applications from a Windows machine, so I end up running Eclipse on the headless box with the windows tunneled to my Windows system.  (I say true because I know I could use something like MinGW or Cygwin and get 99% of the functionality, but I&#8217;m picky about that last 1%).  Also, I know there is a really interesting project underway in the Eclipse community to get CDT to build and debug remotely (<a href="http://wiki.eclipse.org/PTP/planning/remote">Remote Development Tools</a>), but I ran into all kinds of problems getting it to work and it really wasn&#8217;t worth the time I was spending on it.  Further, X tunneling over SSH worked great.</p>
<p>I wasn&#8217;t satisfied though.</p>
<p>My LAN&#8217;s throughput chokepoint was my router, limiting connections to 100Mbps so I went ahead and ordered a Gigabit switch and upgraded my cabling (it was pretty shoddy) and one of my NICs.  Before they come in though, I decided to explore some ways to improve tunneling without hardware changes.</p>
<p>The first thing I looked into was changing SSH cipers.</p>
<p>You can look at the available ciphers in PuTTY by going into the configuration window, and under Connection, clicking SSH.  You should see something like this:</p>
<p><a href="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Putty-SSH.PNG" rel="lightbox[252]"><img class="alignnone size-full wp-image-253" title="SSH-Cipher-Putty-SSH" src="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Putty-SSH.PNG" alt="SSH-Cipher-Putty-SSH" width="470" height="453" /></a></p>
<p>You can change the the order that these ciphers are considered simply by clicking Up or Down and rearranging them.  I like to put the one I want at the top, then immediately following it with the &#8220;&#8211;warn below here&#8211;&#8221; tag, so I know definitively whether I&#8217;m getting my #1 choice.</p>
<p><strong>But how do I know which ciper to choose? </strong></p>
<p>Thats a good question, and I didn&#8217;t know either.  I did some extremely quick <a href="http://www.google.com/search?hl=en&amp;q=fastest+ssh+cipher+putty">googling</a> and I didn&#8217;t get a very definitive answer in the 2 or 3 pages I landed on, but I did find a nice command to run a benchmark on your local system so you can find out for yourself.  The command was:</p>
<pre class="brush: plain; title: ;">openssl speed -engine padlock -evp *ciper* </pre>
<p>Where *ciper* is replaced by the name of the cipher you wish to test.  Executing this command starts an OpenSSL script which runs through the algorithm on locally on your computer, measuring the number of computations it can perform per second.</p>
<p>I extended this command with a simple tweak that allowed me to loop through the script using mulitple different ciphers:</p>
<pre class="brush: plain; title: ;">for ENC in aes-256-cbc bf bf-ecb rc4 rc4-40 bf-cfb bf-ofb des3 des ; do openssl speed -engine padlock -evp ${ENC} ; done</pre>
<p>After executing this, I walked away for a little (probably takes less than 5 mintutes but I didn&#8217;t want to introduce any more variability by messing around during the benchmark) and when I cameback it has maybe 150 lines of output, about 15 for each ciper.</p>
<p>Being the quantitative dude that I am, I immediately threw the data into Excel and plotted the processing throughput (in KBps and given on the last line of each iteration) vs block size (given on the second to last line).</p>
<p>The results were really surprising.  Here&#8217;s the table I compiled:</p>
<p><a href="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Table.png" rel="lightbox[252]"><img class="alignnone size-full wp-image-254" title="SSH-Cipher-Table" src="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Table.png" alt="SSH-Cipher-Table" width="448" height="261" /></a></p>
<p>Where the highlighted cells indicate maximum throughput for each column or blocksize.  Its pretty apparent from this that RC4 really flys, but the table above doesn&#8217;t do the improvement justice.  Lets look at the data plotted:</p>
<p><strong>Note</strong>: The label on the vertical axis incorrectly states the units as <strong>KBps </strong>when they are, in fact, <strong>MBps</strong>.</p>
<div id="attachment_255" class="wp-caption alignnone" style="width: 310px"><a href="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Graph.PNG" rel="lightbox[252]"><img class="size-medium wp-image-255" title="SSH-Cipher-Graph" src="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Graph-300x197.PNG" alt="(click for full-size)" width="300" height="197" /></a><p class="wp-caption-text">(click for full-size)</p></div>
<p>Wow, that is really a tremendous difference between the two RC4 ciphers and the rest, more often than not doubling the throughput of their alternatives.</p>
<p>So with such a huge difference in performance, certainly the RC4 cipher is the default cipher in PuTTY, right?  Actually, no.  At least in my vanilla PuTTY installations, RC4 (AKA Arcfour in PuTTY) is fairly low on the list, only preferred over DES.</p>
<p>I&#8217;m not a cryptographer, and I&#8217;m not well versed on the differences between the ciphers certainly not well enough to give any informed opinion on which cipher to choose from a security point of view, but from a sheer speed point of view, it would seem that RC4 would preferred.</p>
<p>Now our network is secured from the WAN side by a firewall on our router which we are trusting to prevent unauthorized access to the LAN side, so for us, encrypting SSH sessions that strictly live on the LAN side with a possibly sub-par cipher was acceptable if it provided the latency improvement that it looked like it would.  Your circumstances may differ and I urge you to consider all of them before you go changing settings.</p>
<p>Given that you&#8217;ve considered them, and you&#8217;re comfortable, lets go ahead and change the ciper priorities and see if we get any improvement.</p>
<p>Simply by clicking the cipher we want to move, then the Up / Down buttons, we were able to configure our priorities to this:</p>
<p><a href="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Putty-SSH-Modified.PNG" rel="lightbox[252]"><img class="alignnone size-full wp-image-256" title="SSH-Cipher-Putty-SSH-Modified" src="http://blog.edwards-research.com/wp-content/uploads/2009/11/SSH-Cipher-Putty-SSH-Modified.PNG" alt="SSH-Cipher-Putty-SSH-Modified" width="467" height="453" /></a></p>
<p>The idea here being that if, for some reason, we can&#8217;t establish a link with RC4, we&#8217;ll be notified.  We could then go back into the settings and move the &#8220;&#8211;warn below here&#8211;&#8221; line down a line and try again, hoping to connect with the Blowfish ciper, the second quickest cipher or otherwise receive a warning.</p>
<p><strong>Results</strong></p>
<p>Unfortunately, I don&#8217;t have any quantitative data to show the latency improvement, although I suppose you could demonstrate a bandwidth / throughput increase by doing a file transfer, however it is abundantly clear that there was, in fact, a huge latency improvement.  Things that caused annoying lag (eg clicking on the scrollbar to scroll quickly) showed a noticeable improvement.</p>
<p>As it is, without real data to show the improvement, you are left to experiment with the settings yourself, and, given you feel comfortable, I strongly encourage doing so &#8212; as it really seems to make a difference.</p>
<p>I&#8217;ll be sure to check back here when we receive the Gigabit hardware and present a before and after look at our LAN transfer speeds.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2009/11/how-to-speed-up-x-tunneling-over-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My&#160;.zshrc</title>
		<link>http://blog.edwards-research.com/2009/10/my-zshrc/</link>
		<comments>http://blog.edwards-research.com/2009/10/my-zshrc/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 06:15:16 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=158</guid>
		<description><![CDATA[This is a work-in-progress. Also note that this machine didn&#8217;t have zkbd or any of the useful zsh additions I&#8217;ve become used to: echo &#34;Enabling zsh-specific configuration...&#34; # Useful Aliases #alias l.='ls -d .* --color=tty' #alias ll='ls -l --color=tty' #alias ls='ls --color=tty' alias lsa='ls -al' alias lsd='ls -al &#124; grep &#34;^d&#34;' alias rezsh='. ~/.zshrc' # [...]]]></description>
			<content:encoded><![CDATA[<p>This is a work-in-progress.  Also note that this machine didn&#8217;t have zkbd or any of the useful zsh additions I&#8217;ve become used to:</p>
<pre class="brush: bash; title: ;">
echo &quot;Enabling zsh-specific configuration...&quot;

# Useful Aliases
#alias l.='ls -d .* --color=tty'
#alias ll='ls -l --color=tty'
#alias ls='ls --color=tty'
alias lsa='ls -al'
alias lsd='ls -al | grep &quot;^d&quot;'
alias rezsh='. ~/.zshrc'

# Change Prompt
        # Left Hand Prompt
        export PS1=&quot;%B%n@%M%#%b &quot;
                # Bold-username-hostname-magicprompt-endbold &quot;
        # Right Hand Prompt
        export RPROMPT=&quot;%~&quot;

if [[ $TERM = &quot;xterm&quot; ]] ; then
        echo &quot;  configuring xterm settings...&quot;

        # Fix Backspace
        stty erase &quot;^?&quot;

        # Add some useful keybindings
                # Home Key
                bindkey '^[[1~' beginning-of-line
                # End Key
                bindkey '^[[4~' end-of-line
                # Insert
                bindkey '^[[2~' overwrite-mode
                # Delete Key
                bindkey '^[[3~' delete-char
                # Page Up
                bindkey '^[[5~' beginning-of-history
                # Page Down
                bindkey '^[[6~' end-of-history
                # Ctrl+Left
                bindkey '^[OD' emacs-backward-word
                # Ctrl+Right
                bindkey '^[OC' emacs-forward-word

fi
</pre>
<p>Also, as an interesting aside, I didn&#8217;t have permissions to change my default shell (which was tsch), so I just edited the startup script (.login) of the tsch shell and made it change my shell:</p>
<pre class="brush: bash; title: ;">
echo &quot;Switching shell to zsh...&quot;
setenv SHELL /bin/zsh
exec /bin/zsh --login
</pre>
<p>&#8230; probably not the most elegant solution, but it works for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2009/10/my-zshrc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LAN DNS Resolution with WRT54G DD-WRT&#8217;s DNSMasq (Linux and Windows&#160;7)</title>
		<link>http://blog.edwards-research.com/2009/09/lan-dns-resolution-with-wrt54g-dd-wrts-dsnmasq-linux-and-windows-7/</link>
		<comments>http://blog.edwards-research.com/2009/09/lan-dns-resolution-with-wrt54g-dd-wrts-dsnmasq-linux-and-windows-7/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 07:18:50 +0000</pubDate>
		<dc:creator>Jim</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[tips and tricks]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[dns]]></category>

		<guid isPermaLink="false">http://blog.edwards-research.com/?p=119</guid>
		<description><![CDATA[I have a ton of computers. I have a quad-core AMD box (running Fedora 11), an AMD Phenom II X4 955 Black Edition box (running Windows 7), a few random head-less desktops, a laptop (F11) and a netbook (F11). I run a fileserver on one box, I run an X session through ssh on my [...]]]></description>
			<content:encoded><![CDATA[<p>I have a ton of computers.</p>
<p>I have a quad-core AMD box (running Fedora 11), an AMD Phenom II X4 955 Black Edition box (running Windows 7), a few random head-less desktops, a laptop (F11) and a netbook (F11).</p>
<p>I run a fileserver on one box, I run an X session through ssh on my Windows box to access linux GUI stuff, I frequently transfer files between computers and I wanted to be able to access them by my defined hostname rather than the dynamic IP address my router assigned them (WRT54G running DD-WRT v24 SP1).</p>
<p>Now you may say, &#8220;dude, just give them static IP&#8217;s and be done with it.&#8221;  I considered that, but I would much rather remember &#8220;tophat&#8221; and &#8220;fractal&#8221; than 192.168.1.5 and 192.168.12.  Plus I&#8217;m a nerd and if there&#8217;s a way, I&#8217;ll figure it out.</p>
<p>&#8230; so I figured it out.</p>
<p>Windows will automatically report the Hostname of the computer (I think Windows calls it the Computer Name), so you won&#8217;t have to configure that.  You will however, have to allow your router to cache the hostnames and resolve them to IPs, and you will need to configure Linux to report the hostname when a DHCP lease is acquired.</p>
<p><strong>Configure Router</strong></p>
<ol>
<li>Login to your router</li>
<li>Click on the &#8220;Services&#8221; tab</li>
<li>Under DNSMasq enable both options (&#8220;Enable DNSMasq&#8221; and &#8220;Enable Local DNS&#8221;)</li>
<li>Click &#8220;Apply Settings&#8221;</li>
</ol>
<p><strong>Configure Linux to Report Hostnames</strong></p>
<ol>
<li>Disclaimer: This is using Fedora 11 &#8211; other distros/versions may vary.</li>
<li>You should really pick a unique hostname per interface, so in the case that they&#8217;re both connected there isn&#8217;t a conflict.</li>
<li>As root, or with appropriate permissions, edit /etc/sysconfig/network-scripts/ifcfg-{interface} (ie /etc/sysconfig/network-scripts/ifcfg-eth0).</li>
<li>Add this line:</li>
</ol>
<pre>DHCP_HOSTNAME=fractal</pre>
<ol>
<li>Save the file</li>
<li>Restart the network service (sudo service restart network, or use the GUI)</li>
<li>Release your DHCP lease (sudo dhclient -r)</li>
<li>Renew your DHCP lease (sudo dhclient or ifconfig {interface} down; ifconfig {interface} up)</li>
</ol>
<p><strong>Configure Windows 7 to resolve hostnames</strong> (<a href="http://stackoverflow.com/questions/330395/dns-problem-nslookup-works-ping-doesnt" target="_blank">source</a>)</p>
<ol>
<li>Go into Network Connections (I just typed &#8220;Network Connections&#8221; om the start icon -&gt; run box)</li>
<li>Right click on your Network Adapter and go into Properties</li>
<li>Select &#8220;Internet Protocol Version 4 (TCP/IPv4)&#8221;</li>
<li>Under the General Tab click Advanced</li>
<li>Under the DNS Tab select the radio button that says &#8220;Append these DNS suffixes (in order)&#8221;</li>
<li>Click &#8220;Add&#8230;&#8221;</li>
<li>Enter a single period in the text box and click &#8220;Add.&#8221;</li>
<li>Click OK in the &#8220;Advanced TCP/IP Settings&#8221; Dialog</li>
<li>Click OK in the &#8220;Local Area Connection Properties&#8221; Dialog</li>
</ol>
<p>And there you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.edwards-research.com/2009/09/lan-dns-resolution-with-wrt54g-dd-wrts-dsnmasq-linux-and-windows-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

