<?xml version="1.0"?>
<!-- name="generator" content="blosxom/2.0" -->
<!DOCTYPE rss PUBLIC "-//Netscape Communications//DTD RSS 0.91//EN" "http://my.netscape.com/publish/formats/rss-0.91.dtd">

<rss version="0.91">
  <channel>
    <title>The Shoes of the Fisherman's Wife Are Some Jive-Ass Slippers   </title>
    <link>http://frungy.org/~tpot/weblog</link>
    <description>tpot's weblog</description>
    <language>en</language>

  <item>
    <title>The Missing Motivational Poster</title>
    <link>http://frungy.org/~tpot/weblog/2008/05/20#the-missing-rant</link>
    <description>
&lt;p&gt; Inspired by &lt;a href=&quot;http://video.google.com/videoplay?docid=-1331906677993764413&amp;hl=en
&quot;&gt;ECLM 2008: The Missing Rant&lt;/a&gt;&lt;/li&gt;. 

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/timothypotter/2506759353/&quot; title=&quot;automotivator picture by timothy.potter, on Flickr&quot;&gt;&lt;img src=&quot;http://farm4.static.flickr.com/3230/2506759353_85f6504364_o.jpg&quot; width=&quot;608&quot; height=&quot;626&quot; alt=&quot;automotivator picture&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description>
  </item>
  <item>
    <title>Building RPMs in SCons</title>
    <link>http://frungy.org/~tpot/weblog/2008/05/02#scons-rpm2</link>
    <description>
&lt;p&gt;Here's a recipe I've developed for building a RPM in SCons with out
too much mucking around.  My big issue with RPM is the whole
&lt;tt&gt;/usr/src/redhat&lt;/tt&gt; thing which is silly from a permissions point
of view, and also prevent multiple users on the same machine from
building at the same time.

&lt;blockquote&gt;&lt;pre&gt;import string, os

# Sources for RPM

arch = 'i386'

sources = [
    'foo.spec',
    'foo-upstream.tar.gz',
    'bippity.patch',
    'flippity.patch',
]

# Create RPM build environment

env = Environment()

env.Append(
    ENV = {'HOME': os.environ['HOME']},
    TARFLAGS = '-z')

# Build tar file of sources

tarfile = env.Tar(
    'foo.tar.gz',
    sources)

# Build RPM from tarfile with included spec

rpm_defines = {
    '_topdir': Dir('#build').abspath,
}

rpm = env.Command(
    'rpm_dummy',
    tarfile,
    'rpmbuild %s -tb %s' % (
        string.join(['--define &quot;%s %s&quot; ' % (i[0], i[1])
                     for i in rpm_defines.items()], ' '),
        tarfile[0]))

# Take care of creating and removing various temporary directories
# required by RPM.

env.AddPreAction(rpm, Delete('#build'))

env.AddPreAction(rpm, [Mkdir('#build/SPECS'),
                       Mkdir('#build/BUILD'),
                       Mkdir('#build/RPMS/%s' % arch)])

env.AddPostAction(rpm, [Delete('#build/BUILD'),
                        Delete('#build/SPECS')])

# Clean up after ourselves

env.Clean(rpm, ['#build/BUILD', '#build/SRPMS', '#build/RPMS'])
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;p&gt;I like the use of pre and post actions here to create the
directory structure expected by RPM and the cleanup of it afterwards.
Running &lt;tt&gt;scons -c&lt;/tt&gt; will delete all the generated RPM files as well 
as the tar file of sources.&lt;/p&gt;

&lt;p&gt;Oh yeah, installing and using &lt;a href=&quot;http://ccache.samba.org/&quot;&gt;ccache&lt;/a&gt;
is absolutely essential for debugging RPM files.&lt;/p&gt;</description>
  </item>
  <item>
    <title>Because All the Cool Kids are Doing It</title>
    <link>http://frungy.org/~tpot/weblog/2008/04/14#shell-history-meme</link>
    <description>
&lt;pre&gt;$ history|awk '{a[$2]++} END{for(i in a){printf &quot;%5d\t%s\n&quot;,a[i],i}}'|sort -rn|head
   68   ls
   51   cd
   35   ssh
   34   svn
   33   git
   25   less
   25   ./bbc
   19   rm
   14   mv
   14   erlc
   &lt;/pre&gt;
I think running &lt;tt&gt;ls&lt;/tt&gt; is the command line equivalent of saying 
&lt;em&gt;umm&lt;/em&gt; when you need something to fill an awkward silence.&lt;/p&gt;
&lt;p/&gt;</description>
  </item>
  <item>
    <title>Getting Started with smbpython</title>
    <link>http://frungy.org/~tpot/weblog/2008/01/06#smbpython-getting-started</link>
    <description>
&lt;p&gt;After many false starts, Samba is starting to acquire some
client-side scripting support.  The language being used is Python,
although &lt;a href=&quot;http://www.swig.org/&quot;&gt;Swig&lt;/a&gt; is being used to
generate bindings.  At a later stage perhaps other scripting languages
might be supported.&lt;/p&gt;

&lt;p&gt;At the moment the Python bindings are in their infancy, but it's
still possible to do some useful things.  To start hacking on the
Samba Python bindings check out a copy of the source from Subversion
and build as per usual:

&lt;blockquote&gt;&lt;pre&gt;$ svn co svn://svn.samba.org/samba/branches/SAMBA_4_0
[...stuff...]
$ cd SAMBA_4_0/source
$ ./autogen.sh &amp;&amp; ./configure.developer &amp;&amp; make
[...more stuff...]
&lt;/pre&gt;&lt;/blockquote&gt;

Now these commands will build a complete Samba environment including
the Python bindings.  For the moment we will be working directly out
of the build directory and not bother installing libraries,
executables, etc.  The only tweak we need to do is to set
&lt;tt&gt;LD_LIBRARY_PATH&lt;/tt&gt; to point at the shared libraries we have just
built and then run a Python executable with all the Samba goodies
compiled in:

&lt;blockquote&gt;&lt;pre&gt;$ export LD_LIBRARY_PATH=`pwd`/bin/shared
$ bin/smbpython
Python 2.5.1 (r251:54863, Oct  5 2007, 13:38:40) 
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.
&gt;&gt;&gt; 
&lt;/pre&gt;&lt;/blockquote&gt;

What can we do from here?  I'm hoping to write some more entries about
some of the existing Python bindings, starting with tdb and ldb.&lt;/p&gt; 

&lt;p&gt;Thanks to &lt;a href=&quot;http://jelmer.vernstok.nl/&quot;&gt;Jelmer Vernooij&lt;/a&gt;
for taking my bits and pieces of decrepit Swig bindings and turning it
into something useful.&lt;/p&gt;</description>
  </item>
  <item>
    <title>No Worrie's</title>
    <link>http://frungy.org/~tpot/weblog/2007/09/30#fncenter</link>
    <description>
&lt;p&gt;&lt;img src=&quot;http://www.frungy.org/~tpot/images/fncenter.jpg&quot;/&gt;&lt;/p&gt;</description>
  </item>
  <item>
    <title>SCons Builder for Ragel</title>
    <link>http://frungy.org/~tpot/weblog/2007/05/08#ragel</link>
    <description>
&lt;p&gt;Here's a SCons builder for the &lt;a href=&quot;http://www.cs.queensu.ca/~thurston/ragel/&quot;&gt;Ragel State Machine Compiler&lt;/a&gt;, based on the one for SWIG included in the SCons distribution.

&lt;blockquote&gt;&lt;pre&gt;#            tastes like -*- python -*-

&quot;&quot;&quot;Tool-specific initialisation for ragel.&quot;&quot;&quot;

import SCons.Util
import SCons.Tool
import SCons.Action

def generate(env):

    c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
    c_file.suffix['.rl'] = '.c'

    c_file.add_action('.rl', SCons.Action.Action('$RAGELCOM', '$RAGELCOMSTR'))

    env['RAGEL'] = 'ragel'
    env['RAGELFLAGS'] = SCons.Util.CLVar('')

    env['RLCODEGEN'] = 'rlcodegen'
    env['RLCODEGENFLAGS'] = SCons.Util.CLVar('')

    env['RAGELCOM'] = \
        '$RAGEL $RAGELFLAGS $SOURCE | $RLCODEGEN $RLCODEGENFLAGS -o $TARGET'

def exists(env):
    return env.Detect(['ragel', 'rlcodegen'])
&lt;/pre&gt;&lt;/blockquote&gt;

&lt;/p&gt;</description>
  </item>
  <item>
    <title>How to patch and rebuild a RPM package</title>
    <link>http://frungy.org/~tpot/weblog/2007/05/02#patching-rpms</link>
    <description>
&lt;p&gt;&lt;a href=&quot;http://bradthemad.org/tech/notes/patching_rpms.php&quot;&gt;Here's&lt;/a&gt;
a nice tutorial on how to make a patch to a program distributed as a 
SRPM file.  I would also recommend installing &lt;a href=&quot;http://ccache.samba.org&quot;&gt;ccache&lt;/a&gt; and maybe &lt;a href=&quot;http://distcc.samba.org&quot;&gt;distcc&lt;/a&gt; as finding and fixing bugs in a RPM build usually involves compiling the same
source files over and over again.&lt;/p&gt;</description>
  </item>
  <item>
    <title>The Geekiest Place to Hang Out</title>
    <link>http://frungy.org/~tpot/weblog/2007/03/26#hangout</link>
    <description>
&lt;p&gt;The &lt;a href=&quot;http://sky.fit.qut.edu.au/~choo/lounge.html&quot;&gt;
Provably-Secure
Mutual Authentication and Key Establishment Protocols
Lounge&lt;/a&gt;.&lt;/p&gt;</description>
  </item>
  <item>
    <title>Sheep Jigsaw</title>
    <link>http://frungy.org/~tpot/weblog/2007/02/12#sheep-jigsaw</link>
    <description>
&lt;p&gt;&lt;img src=&quot;http://potterpics.org/albums/feb07/00006_G.sized.jpg&quot;/&gt;&lt;/p&gt;</description>
  </item>
  <item>
    <title>Another Stevey Blog Rant About Emacs</title>
    <link>http://frungy.org/~tpot/weblog/2007/01/05#yegge</link>
    <description>
&lt;p&gt;&lt;a href=&quot;http://steve-yegge.blogspot.com/2006/06/shiny-and-new-emacs-22.html&quot;&gt;Here&lt;/a&gt;.  It's quite long and complicated.  I wish I had time to write that much stuff about Emacs.  Anyway, some choice quotes about whether you should learn Emacs Lisp:

&lt;blockquote&gt;&lt;i&gt;&quot;First, recognize that Emacs Lisp isn't going anywhere. Emacs is not going to magically become programmable in Python or Ruby or JavaScript or Perl overnight ... [Emacs Lisp] will never be obsolete knowledge. You might as well start learning it now, and reap the benefits now.&quot;&lt;/i&gt;&lt;/blockquote&gt;

&lt;/p&gt;

&lt;p&gt;On Lisp syntax:

&lt;blockquote&gt;&lt;i&gt;&quot;If you do it enough, eventually you'll enjoy programming in Emacs-Lisp, no matter how much you hate it initially ... you'll initially dislike Emacs-Lisp's syntax; it's virtually guaranteed. Fortunately, it doesn't really have much in the way of syntax; almost everything follows the exact same s-expression form. So you should get past the syntax pretty quickly, and in a few weeks you'll start liking it just fine.&lt;/i&gt;&lt;/blockquote&gt;

Kind of reminds me of people who dislike using tabs as syntax when writing Python code for the first time.  I'm poking around with Ruby at the moment and having to put &lt;tt&gt;end&lt;/tt&gt; everywhere is actually pretty annoying.&lt;/p&gt;

&lt;p&gt;I've done some bits and pieces of Emacs Lisp programming over the years and it is quite seductive, for lack of a better word.  I think that's the nature of functional programming though once you really get in to it.&lt;/p&gt;</description>
  </item>
  </channel>
</rss>