<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Fox Kibble]]></title>
  <link href="http://www.fox-dreams.com/art/atom.xml" rel="self"/>
  <link href="http://www.fox-dreams.com/art/"/>
  <updated>2012-02-05T18:36:55-05:00</updated>
  <id>http://www.fox-dreams.com/art/</id>
  <author>
    <name><![CDATA[Arthur Shipkowski]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Obligatory Octopress move post]]></title>
    <link href="http://www.fox-dreams.com/art/2012/02/obligatory-octopress-move-post/"/>
    <updated>2012-02-05T18:20:00-05:00</updated>
    <id>http://www.fox-dreams.com/art/2012/02/obligatory-octopress-move-post</id>
    <content type="html"><![CDATA[<p>So, having run Octopress for a few days, I suppose it&#8217;s time I comment on it.</p>

<p>My interest was initially piqued by the static site speed and resistance to heavy traffic. The former, in particular, caught my eye after I noticed how long it took me, on a fat pipe, to load any pages. Even with WP-Supercache I found that pages tended to expire before anyone saw them.</p>

<p>My webhost, along with logging for bandwidth or similar restrictions, logged CPU usage. Though they are pro-Wordpress, I noticed a few times a day I&#8217;d peg things at 100% CPU. Not for very long, but it would happen. Playing with themes and plugins reduced the frequency but did not eliminate it.</p>

<p>All of this, though, falls aside to something else. I&#8217;ve noticed needing to upgrade plugins and Wordpress regularly for a site that I do not do a lot of active blogging on. One day I came upon this, relative to Octopress and its ilk:</p>

<blockquote><p>It&#8217;s as if every developer woke up on the same day and asked &#8220;why am I responding to security alerts for a blog I barely ever update&#8221;?</p><footer><strong>@mechanical_fish</strong> <cite><a href='https://twitter.com/#!/mechanical_fish/status/160561058631782401'>twitter.com/#!/mechanical_fish/&hellip;</a></cite></footer></blockquote>


<p>I realized that with the occasional disconnect from the net that I like to indulge in, it&#8217;s entirely possible that my site could be hacked while I&#8217;m having a calm weekend. I do recall a Wordpress update coming in right around the holidays once, as well. Now, I&#8217;m more secure since there is no PHP.</p>

<p>Sadly, though, I think I&#8217;ll have to poke at the contact form. Using cgiemail seems to mean I&#8217;ll get weirdly-formatted spam that is hoping my installation isn&#8217;t secure.</p>

<p>Are comments going to appear? I&#8217;m not sure. The old Wordpress site, with comments enabled, only got a single real comment on a main page praising the site design (thanks, I downloaded the theme myself). Depending on what I get into, I&#8217;ll see&#8230;</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Gentoo to Ubuntu: A surprise]]></title>
    <link href="http://www.fox-dreams.com/art/2011/03/gentoo-to-ubuntu-a-surpris/"/>
    <updated>2011-03-13T15:55:12-04:00</updated>
    <id>http://www.fox-dreams.com/art/2011/03/gentoo-to-ubuntu-a-surpris</id>
    <content type="html"><![CDATA[<p>My work laptop is a Dell D820.  When I got it, I installed x86_64 Gentoo on
it. I kept it up to date every week, switched to newer profiles as I came upon
them, and was fairly happy.</p>

<p>After some annoying issues with a cross-build system for work, and finding it
worked under a Ubuntu VM, I switched to 64-bit Ubuntu 10.10. I prefer to have
my builds as fast as possible, and this was grating on me.</p>

<p>I figured any general slowdown was worth it. Not only would the lack of VM
delay speed up me, but I wouldn&#8217;t be constantly needing to recompile anymore.
I get paid to write code, not to administer a system after all.</p>

<p>So I took the plunge and I&#8217;m stunned at how fast it is. It boots significantly
faster (and I had taken pains to enable only a minimum of boot-time scripts
and have parallel startup on), everything moves more quickly, and longstanding
mild annoyances are gone.</p>

<p>All this time I figured switching would be slower. Why didn&#8217;t I do this
sooner?</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[LOST numbers: Lotto bane?]]></title>
    <link href="http://www.fox-dreams.com/art/2011/01/lost-numbers-lotto-bane/"/>
    <updated>2011-01-05T12:39:12-05:00</updated>
    <id>http://www.fox-dreams.com/art/2011/01/lost-numbers-lotto-bane</id>
    <content type="html"><![CDATA[<p>As has been seen, the LOST numbers came up partially in last night&#8217;s Mega
Millions drawing. <a href="https://twitter.com/#!/DamonLindelof/status/22525941871812608">Damon Lindelof</a> says that 9,078 people won.</p>

<p>Someone will point out, I&#8217;m sure, that if the $380 million jackpot was divided
among that many people &#8211; if the LOST numbers had come up &#8211; that it wouldn&#8217;t
even get to a hundred thousand apiece.</p>

<p>However, what if they&#8217;d had the first five numbers, and then the mega ball
<strong>wasn&#8217;t</strong> 42? The payout for that is a flat $250k.</p>

<p>It would total $2.3B payout. I&#8217;d hate to be in charge of Mega Millions when
that happened. Powerball would have it easier, at only $1.8B.</p>

<p>Something to think about, public lotteries!</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Cross-compiling Python with _ctypes support]]></title>
    <link href="http://www.fox-dreams.com/art/2010/04/xcompiling-python-with-ctypes/"/>
    <updated>2010-04-07T18:29:23-04:00</updated>
    <id>http://www.fox-dreams.com/art/2010/04/xcompiling-python-with-ctypes</id>
    <content type="html"><![CDATA[<p>I found myself in need of a cross-compiled Python 2.6 to run some hardware
test code on an MPC8315ERDB evaluation board. I found Paul Gibson&#8217;s <a href="http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html">guide and
patches</a> for cross-compiling Python useful, but they didn&#8217;t support the
<em>ctypes module, which was needed for the hardware interface code, based around
a C shared library. In fact, further searching turned up that one should not
expect </em>ctypes to be available for cross-compilation.</p>

<p>I dug into the code, though, and discovered the issue is that _ctypes has its
own configure call in setup.py. Pass in the right parameters, and all is well.
In my case, my patch (atop of the pre-existing one) looks like this:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
</pre></td><td class='code'><pre><code class='diff'><span class='line'><span class="gd">--- Python/setup.py 2010-04-07 15:00:28.183555632 -0400</span>
</span><span class='line'><span class="gi">+++ Python-xcompile/setup.py    2010-04-07 15:33:35.443567686 -0400</span>
</span><span class='line'><span class="gu">@@ -17,7 +17,7 @@</span>
</span><span class='line'>from distutils.command.install_lib import install_lib
</span><span class='line'>
</span><span class='line'># This global variable is used to hold the list of modules to be disabled.
</span><span class='line'><span class="gd">-disabled_module_list = [&#39;_ctypes&#39;]</span>
</span><span class='line'><span class="gi">+disabled_module_list = []</span>
</span><span class='line'>
</span><span class='line'>def add_dir_to_list(dirlist, dir):
</span><span class='line'>&quot;&quot;&quot;Add the directory &#39;dir&#39; to the list &#39;dirlist&#39; (at the front) if
</span><span class='line'><span class="gu">@@ -1705,7 +1705,7 @@</span>
</span><span class='line'>ffi_configfile):
</span><span class='line'>from distutils.dir_util import mkpath
</span><span class='line'>mkpath(ffi_builddir)
</span><span class='line'><span class="gd">-                config_args = []</span>
</span><span class='line'><span class="gi">+                config_args =  sysconfig.get_config_var(&quot;CONFIG_ARGS&quot;).split(&quot; &quot;)</span>
</span><span class='line'>
</span><span class='line'># Pass empty CFLAGS because we&#39;ll just append the resulting
</span><span class='line'># CFLAGS to Python&#39;s; -g or -O2 is to be avoided.
</span></code></pre></td></tr></table></div></figure>


<p>For the curious, below are the key steps for cross-compilation of Python
outside LTIB (since it was for test, there was no need to incorporate it) for
the MPC8315ERDB &#8211; it may work for MPC8313-based setups as well. You probably
want to look at the original post for slimming the tree down once the build is
done, and if you have modules for which support isn&#8217;t found, change the
add_dir_to_list lines to point at your build system&#8217;s library and include
directories rather than /usr/local.</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
</pre></td><td class='code'><pre><code class='bash'><span class='line'>tar xzf Python-2.6.4.tgz
</span><span class='line'><span class="nb">cd </span>Python-2.6.4
</span><span class='line'>./configure
</span><span class='line'>make python Parser/pgen
</span><span class='line'>mv python hostpython
</span><span class='line'>mv Parser/pgen Parser/hostpgen
</span><span class='line'>make distclean
</span><span class='line'>patch -p1 &lt; ~/Python-2.6.4-xcompile.patch
</span><span class='line'><span class="c">#</span>
</span><span class='line'><span class="c"># Insert my patch here</span>
</span><span class='line'>vim setup.py
</span><span class='line'><span class="c">#</span>
</span><span class='line'><span class="c"># Put LTIB tools in $PATH</span>
</span><span class='line'><span class="nv">PATH</span><span class="o">=</span><span class="nv">$PATH</span>:/opt/freescale/usr/local/gcc-4.1.78-eglibc-2.5.78-1/powerpc-e300c3-linux-gnu/bin/
</span><span class='line'><span class="nv">CROSS</span><span class="o">=</span>powerpc-e300c3-linux-gnu- <span class="nv">CC</span><span class="o">=</span><span class="k">${</span><span class="nv">CROSS</span><span class="k">}</span>gcc <span class="nv">CXX</span><span class="o">=</span><span class="k">${</span><span class="nv">CROSS</span><span class="k">}</span>g++ <span class="nv">AR</span><span class="o">=</span><span class="k">${</span><span class="nv">CROSS</span><span class="k">}</span>ar <span class="nv">RANLIB</span><span class="o">=</span><span class="k">${</span><span class="nv">CROSS</span><span class="k">}</span>ranlib ./configure --host<span class="o">=</span>powerpc-e300c3-linux-gnu --build<span class="o">=</span>x86_64-pc-linux-gnu --prefix<span class="o">=</span>/python
</span><span class='line'>make <span class="nv">HOSTPYTHON</span><span class="o">=</span>./hostpython <span class="nv">HOSTPGEN</span><span class="o">=</span>./Parser/hostpgen <span class="nv">BLDSHARED</span><span class="o">=</span><span class="s2">&quot;powerpc-e300c3-linux-gnu-gcc -shared&quot;</span> <span class="nv">CROSS_COMPILE</span><span class="o">=</span><span class="k">${</span><span class="nv">CROSS</span><span class="k">}</span> <span class="nv">CROSS_COMPILE_TARGET</span><span class="o">=</span>yes
</span><span class='line'>make install <span class="nv">HOSTPYTHON</span><span class="o">=</span>./hostpython <span class="nv">BLDSHARED</span><span class="o">=</span><span class="s2">&quot;powerpc-e300c3-linux-gnu-gcc -shared&quot;</span> <span class="nv">CROSS_COMPILE</span><span class="o">=</span><span class="k">${</span><span class="nv">CROSS</span><span class="k">}</span> <span class="nv">CROSS_COMPILE_TARGET</span><span class="o">=</span>yes <span class="nv">prefix</span><span class="o">=</span>~/Downloads/Python-2.6.4/_install
</span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Conceptions of the Embedded Software World]]></title>
    <link href="http://www.fox-dreams.com/art/2009/11/conceptions-of-the-embedded-software-world/"/>
    <updated>2009-11-22T12:26:06-05:00</updated>
    <id>http://www.fox-dreams.com/art/2009/11/conceptions-of-the-embedded-software-world</id>
    <content type="html"><![CDATA[<p>It often surprises me, the conceptions those outside the embedded software
world have of it.</p>

<p>At the one end is the old, hardcoded view; a good example, if a bit old, would
be <a href="http://www.joelonsoftware.com/articles/FiveWorlds.html">Joel Spolsky&#8217;s view</a> of the Embedded Software World.</p>

<p>At the other end, prompted by the increasing presence of Java and other
applications for cell phones, there is the idea that it&#8217;s all Java and that
it&#8217;s every bit as easy as desktop development.</p>

<p>Neither of these views is entirely true, but they aren&#8217;t entirely false,
either.  Joel is correct about limited programming capability in many cases,
but as I bet even he is realizing there are flash updates these days even for
consumer electronics like Blu-ray players. Others are correct about the
increasing availability of tools that make it just like home in some embedded
systems.</p>

<p>Where do I find myself in all this? Well, only recently did I find myself
working on the first project for my employer where C++ can be used in a fairly
embedded environment; previous projects had broken libraries, a lack of space
for the generated code, or both. Of course, there&#8217;s still bootloader work in
C, sometimes with a dab of assembler, too.</p>

<p>The biggest thing I&#8217;ve noticed about embedded software is that often it&#8217;s
solving known-to-be-solved problems without the benefits of a full-up system.
Perhaps you don&#8217;t have a shell capable of scripting &#8211; or the ability to just
run Perl or Python, meaning you have to write C code that grovels over I/O
that would be trivial in either. Sometimes it&#8217;s bringing up a board from
scratch, and trying to get a bootloader to work &#8211; or writing your own
(though, these days, it&#8217;s preferable to grab one of the pre-written ones, as
you&#8217;ll get much more functionality once you get it running).</p>

<p>So what do I think of it? It can be frustrating when you&#8217;re writing many lines
of code for what you know would be trivial in another language, but it&#8217;s also
fun to squeeze every last drop out of a hardware solution.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Booting issues after BIOS update on MSI Wind U123]]></title>
    <link href="http://www.fox-dreams.com/art/2009/10/booting-issues-after-bios-update-on-msi-wind-u123/"/>
    <updated>2009-10-19T18:59:21-04:00</updated>
    <id>http://www.fox-dreams.com/art/2009/10/booting-issues-after-bios-update-on-msi-wind-u123</id>
    <content type="html"><![CDATA[<p>I recently updated my MSI Wind U123&#8217;s BIOS for various reasons, and I ran into
an problem whose solution I&#8217;m offering up in case of issues from out there.
Per the instructions from MSI, I flashed the BIOS, powered down, and removed
the battery. MSI&#8217;s site didn&#8217;t specify how long to remove the battery, so I
removed it for a 10-count (a slow 10 count).</p>

<p>I put the battery back in, and Windows XP refused to finish booting, instead
sitting in the XP startup animation forever. Safe mode booting stopped at
Mup.sys. I attempted to boot via CD to use the recovery console, but even that
hung up. Frustrated, I made a USB stick with Ubuntu Netbook Remix. That also
refused to go far beyond the bootloader.</p>

<p>The solution turned out to be to remove the battery for a good few minutes,
then put it back in. Once that was done, all was well again.</p>
]]></content>
  </entry>
  
</feed>

