<?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>matmrosko.com &#187; mat</title>
	<atom:link href="http://matmrosko.com/author/mat/feed/" rel="self" type="application/rss+xml" />
	<link>http://matmrosko.com</link>
	<description>geeky thoughts</description>
	<lastBuildDate>Wed, 03 Aug 2011 07:33:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>GNU Screen on Chumby</title>
		<link>http://matmrosko.com/2011/03/22/gnu-screen-on-chumby/</link>
		<comments>http://matmrosko.com/2011/03/22/gnu-screen-on-chumby/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 07:24:22 +0000</pubDate>
		<dc:creator>mat</dc:creator>
		
		<guid isPermaLink="false">http://matmrosko.com/?p=168</guid>
		<description><![CDATA[I am researching starting a development project running some native code on a Chumby, so I figured I&#8217;d dive in with some cross-compiling to see how much trouble it would be to get something up and running on (one of) my Chumby One(s). Turns out, it wasn&#8217;t too bad. I use GNU screen extensively at [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://matmrosko.com/files/2011/03/heckert_gnu.small_.png" alt="" title="heckert_gnu.small" width="145" height="140" class="alignleft size-full wp-image-172" />I am researching starting a development project running some native code on a Chumby, so I figured I&#8217;d dive in with some cross-compiling to see how much trouble it would be to get something up and running on (one of) my Chumby One(s).  Turns out, it wasn&#8217;t too bad.</p>
<p>I use GNU screen extensively at work and at play, so I figured for this project it will be helpful.  Getting it running will be the very first step in my quest to run my <a href="http://christmasonquiethills.com/" title="Christmas On Quiet Hills">synchronized Christmas lights</a> from a Chumby.</p>
<p>The first step was getting the toolchain up and running on my desktop machine, which was really simple using the <a href="http://wiki.chumby.com/index.php/GNU_Toolchain" title="GNU Toolchain">toolchain instructions</a> on the Chumby wiki.</p>
<p>Then, I ran through some issues due to screen&#8217;s configure script erroring out because it cannot run binaries for test programs.  Turns out generating the configure using autoconf with the option &#8220;&#8211;warnings=cross&#8221; will spit out anything it thinks will give you trouble with cross compilation.  Regenerating the configure using autoconf told me that AC_TRY_RUN wasn&#8217;t setup with a default for cross compile.  The documentation for autoconf is somewhat easy to read and I simply had to add a default cross compile case in a few places in the configure.in for screen.  I was lucky and didn&#8217;t have to add any other tests to get something working, with the exception of a choice of sockets or fifos.  I chose fifos, although Chumby&#8217;s rootfs should also support using sockets.</p>
<p>Once I had that going, I ran into a problem where tgetent wasn&#8217;t being found.  That is a function used to get the terminal entry for things like the screen size, color rendering, etc. and is available from a few packages.  First I tried using ncurses, which resulted in a binary that compiled, but wouldn&#8217;t run.  A few straces and I wasn&#8217;t getting anywhere so I cheated.  I also found <a href="http://forum.chumby.com/viewtopic.php?id=6219" title='Anyone know how to install CLI Linux "Screen" command?'>a thread</a> on the Chumby forums with a binary somebody grabbed from a Debian armel build, which ran on my Chumby, but needed 2 shared libraries.  I ran strings on the binary and saw some interesting things which led me to try termcap as the next source of tgetent() instead of ncurses when building screen.</p>
<p>As soon as I had this, screen compiled (statically linked) and ran on my Chumby.  I haven&#8217;t done rigorous testing on the binary, but split works, and a few quick things I threw at it.  Pretty neat!  I was rebuilding enough after each little change that I wrote a script for the build, and have a patch for screen&#8217;s configure.in that generates the configure.</p>
<p><a href='http://matmrosko.com/files/2011/03/update_configure_in.patch'>update_configure_in.patch</a>: Patch to update screen&#8217;s configure.in to allow cross-compilation.</p>
<pre class="prettyprint">
--- screen-4.0.3/configure.in.original  2011-03-21 22:28:36.613330001 -0700
+++ screen-4.0.3/configure.in   2011-03-21 22:56:13.837330001 -0700
@@ -54,14 +54,14 @@
 export CC
 exec $0 $configure_args
 fi
-])
+],true)

 AC_TRY_RUN(main(){exit(0);},,
 exec 5>&#038;2
 eval $ac_link
 AC_NOTE(CC=$CC; CFLAGS=$CFLAGS; LIBS=$LIBS;)
 AC_NOTE($ac_compile)
-AC_MSG_ERROR(Can't run the compiler - sorry))
+AC_MSG_ERROR(Can't run the compiler - sorry),true)

 AC_TRY_RUN([
 main()
@@ -69,7 +69,7 @@
   int __something_strange_();
   __something_strange_(0);
 }
-],AC_MSG_ERROR(Your compiler does not set the exit status - sorry))
+],AC_MSG_ERROR(Your compiler does not set the exit status - sorry),,true)

 AC_PROG_AWK

@@ -358,7 +358,7 @@
   exit(0);
 }
 ], AC_NOTE(- your fifos are usable) fifo=1,
-AC_NOTE(- your fifos are not usable))
+AC_NOTE(- your fifos are not usable),fifo=1)
 rm -f /tmp/conftest*

 if test -n "$fifo"; then
@@ -408,7 +408,7 @@
   exit(0);
 }
 ], AC_NOTE(- your implementation is ok),
-AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1)
+AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1,true)
 rm -f /tmp/conftest*
 fi

@@ -470,7 +470,7 @@
   exit(0);
 }
 ], AC_NOTE(- your sockets are usable) sock=1,
-AC_NOTE(- your sockets are not usable))
+AC_NOTE(- your sockets are not usable),true)
 rm -f /tmp/conftest*

 if test -n "$sock"; then
@@ -502,7 +502,7 @@
 }
 ],AC_NOTE(- you are normal),
 AC_NOTE(- unix domain sockets are not kept in the filesystem)
-AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1)
+AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1,true)
 rm -f /tmp/conftest*
 fi

@@ -635,7 +635,7 @@
   exit(0);
 }
 ],AC_NOTE(- select is ok),
-AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN))
+AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN),true)

 dnl
 dnl    ****  termcap or terminfo  ****
@@ -668,7 +668,7 @@
 {
  exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1);
 }], AC_NOTE(- you use the termcap database),
-AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO))
+AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO),true)
 AC_CHECKING(ospeed)
 AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED))

@@ -804,7 +804,7 @@
       AC_NOTE(- can't determine - assume ptys are world accessable)
     fi
   ]
-)
+,true)
 rm -f conftest_grp
 fi

@@ -947,7 +947,7 @@
     exit(1);
   exit(0);
 }
-  ],avensym=$av;break)
+  ],avensym=$av;break,,true)
   if test "$av" = _Loadavg; then
     nlist64='#define nlist nlist64'
   fi
@@ -1080,7 +1080,7 @@
 #endif
   exit(0);
 }
-],,AC_DEFINE(SYSVSIGS))
+],,AC_DEFINE(SYSVSIGS),true)

 fi

@@ -1160,7 +1160,7 @@
   if (strncmp(buf, "cdedef", 6))
     exit(1);
   exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEBCOPY))
+}], AC_DEFINE(USEBCOPY),,true)

 AC_TRY_RUN([
 #define bcopy(s,d,l) memmove(d,s,l)
@@ -1175,7 +1175,7 @@
   if (strncmp(buf, "cdedef", 6))
     exit(1);
   exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEMEMMOVE))
+}], AC_DEFINE(USEMEMMOVE),,true)

 AC_TRY_RUN([
@@ -1191,7 +1191,7 @@
   if (strncmp(buf, "cdedef", 6))
     exit(1);
   exit(0); /* libc version works properly.  */
-}], AC_DEFINE(USEMEMCPY))
+}], AC_DEFINE(USEMEMCPY),,true)

 AC_MSG_CHECKING(long file names)
 (echo 1 > /tmp/conftest9012345) 2>/dev/null
@@ -1266,7 +1266,7 @@
 dnl Ptx bug workaround -- insert -lc after -ltermcap
 test -n "$seqptx" &#038;&#038; LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq"

-AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.))
+AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.),true)

 ETCSCREENRC="\"/usr/local/etc/screenrc\""
 if test -n "$prefix"; then
</pre>
<p><a href='http://matmrosko.com/files/2011/03/build.sh'>build.sh</a>: Simple (hackish) shell script to cross-compile screen for chumby platforms using the chumby provided toolchain.</p>
<pre class="prettyprint">
#!/bin/bash

die()
{
    echo $1
    exit
}

wget http://mirrors.kernel.org/gnu/termcap/termcap-1.3.1.tar.gz
tar xzpvf termcap-1.3.1.tar.gz || die "Failed ot untar termcap"
pushd termcap-1.3.1 || die "No termcap"
autoconf
./configure --host=arm-linux --prefix=$(pwd)/install || die "Failed termcap configure"
make &#038;&#038; make install || die "Failed to make termcap"
popd

export LDFLAGS="-L$(pwd)/termcap-1.3.1/install/lib/"
export LIBS="-ltermcap"

export CFLAGS="-DDEBUG"

wget http://mirrors.kernel.org/gnu/screen/screen-4.0.3.tar.gz
tar xzpvf screen-4.0.3.tar.gz || die "Failed to untar screen"
pushd screen-4.0.3
rm -f configure
patch -p1 < ../update_configure_in.patch
autoconf --warnings=cross
./configure --host=arm-linux --prefix=$(pwd)/install || die "Failed screen configure"
make &#038;&#038; make install || die "Failed to make screen"
popd
unset LDFLAGS
unset LIBS
unset CFLAGS
</pre>
]]></content:encoded>
			<wfw:commentRss>http://matmrosko.com/2011/03/22/gnu-screen-on-chumby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SheevaPlug Migration</title>
		<link>http://matmrosko.com/2010/02/10/sheevaplug-migration/</link>
		<comments>http://matmrosko.com/2010/02/10/sheevaplug-migration/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 07:47:30 +0000</pubDate>
		<dc:creator>mat</dc:creator>
		
		<guid isPermaLink="false">http://matmrosko.com/?p=119</guid>
		<description><![CDATA[Recently my wife and I had our second child. Instead of putting the kids in day care and pay somebody else to raise our children we decided that my wife would stay home. This meant a drastic change to our income. As part of our cost cutting measures, I decided to leave my VPS hosting [...]]]></description>
			<content:encoded><![CDATA[<p>Recently my wife and I had our second child.  Instead of putting the kids in day care and pay somebody else to raise our children we decided that my wife would stay home.  This meant a drastic change to our income.  As part of our cost cutting measures, I decided to leave my VPS hosting provider which is heavily overkill for the small traffic our websites generate.  I never once had a problem with Linode and highly recommend them to anybody looking for quality service at a good price.  Their staff is so educated with linux they make my skills seem non-existent.<img src="http://matmrosko.com/files/2010/02/sheevaplug.jpg" alt="SheevaPlug" title="SheevaPlug" width="300" height="300" class="alignright size-full wp-image-122" /></p>
<p>Over the last couple of years I have moved away from running machines at home 24/7.  This used to be the norm for me so I would have constant access to my data, however it became a nuisance for a few reasons.  First, it meant always having a machine on generating heat and sucking power.  Second, the longer the machine was up, the more &#8220;hours&#8221; on things like hard drives and CPUs.  This makes hard drives die much faster.  The downfall with rebooting often is PSUs are more likely to fail.  All in all, I was happy with my solution for a couple of years.  SSH to my <a href="http://en.wikipedia.org/wiki/Linksys_WRT54G_series" title="Linksys WRT54G" target="_blank">router</a> (which is running <a href="http://www.openwrt.org/" title="OpenWrt" target="_blank">OpenWrt</a>) and use wake-on-lan packets to turn on machines if I wanted at my data.  Then I could also remotely shut down my machines to save power when I was done getting what I needed.</p>
<p>I didn&#8217;t exactly like the time I had to wait for things, and my wife couldn&#8217;t then access data without doing &#8220;magic&#8221; which she didn&#8217;t like.  This made it hard for me (an anal-retentive data hoarder) to have a way to &#8220;share&#8221; the family pictures, and other important things since the machines were only on when I wanted them on.  I began looking for a solution and came across the SheevaPlug.  It is an embedded system that ships with an ubuntu installation by default and it&#8217;s only $100.  I had to get one!  It runs a 1.2GHz Kirkwood ARM processor and has 512Mb RAM and 512 Nand flash.</p>
<p>The little thing draws just about 5 watts according to my kill-a-watt with a 500 Gb Seagate drive as the root filesystem.  I have migrated all my services from Linode to my SheevaPlug to run everything from home using my business Internet connection.  The SheevaPlug has plenty of horsepower to run all of my services which include <a href="http://www.apache.org/" title="apache">apache</a> (with <a href="http://php.net/" title="PHP">php5</a>), <a href="http://www.samba.org/" title="samba">samba</a>, <a href="http://nfs.sourceforge.net/" title="NFS">nfs</a>, email (<a href="http://www.postfix.org/" title="postfix" target="_blank">postfix</a>, <a href="http://postgrey.schweikert.ch/" title="postgrey" target="_blank">postgrey</a>, <a href="http://www.courier-mta.org/authlib/" title="courier-authlib" target="_blank">courier-authlib</a>, <a href="http://www.courier-mta.org/imap/" title="courier-imap" target="_blank">courier-imap</a>, <a href="http://www.courier-mta.org/imap/" title="courier-pop" target="_blank">courier-pop</a>, <a href="http://spamassassin.apache.org/" title="spamassassin" target="_blank">spamassassin</a>, <a href="http://www.clamav.net/" title="clamav" target="_blank">clamav</a>, <a href="http://www.amavis.org/" title="amavis" target="_blank">amavis</a>, <a href="http://roundcube.net/" title="roundcube" target="_blank">roundcube</a>).  Quite impressive if you ask me.  It&#8217;s been really stable even though it&#8217;s labeled as a &#8220;development kit&#8221; and my uptime and load average can be seen in the footer of this website.</p>
]]></content:encoded>
			<wfw:commentRss>http://matmrosko.com/2010/02/10/sheevaplug-migration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AddThis WordPress Plugin with WPMU</title>
		<link>http://matmrosko.com/2009/09/30/addthis-wordpress-plugin-with-wpmu/</link>
		<comments>http://matmrosko.com/2009/09/30/addthis-wordpress-plugin-with-wpmu/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 23:04:08 +0000</pubDate>
		<dc:creator>mat</dc:creator>
		
		<guid isPermaLink="false">http://matmrosko.com/?p=105</guid>
		<description><![CDATA[UPDATE 2/9/2010: AddThis recently released a version 1.6.1 which fixes the issues. It contains *basically* this patch with if ( wordpress version &#62; 2.7 ) checks to maintain backward compatibility. I wasn&#8217;t worried about that because people shouldn&#8217;t run old, unsecure versions of wordpress, however I can see why AddThis wouldn&#8217;t care and would want [...]]]></description>
			<content:encoded><![CDATA[<strong><span style="color:#f00">UPDATE 2/9/2010:</span></strong> AddThis recently released a version 1.6.1 which fixes the issues.  It contains *basically* this patch with if ( wordpress version &gt; 2.7 ) checks to maintain backward compatibility.  I wasn&#8217;t worried about that because people shouldn&#8217;t run old, unsecure versions of wordpress, however I can see why AddThis wouldn&#8217;t care and would want their plugin to work across the board.

<p>Recently, I wanted to add the <a href="http://addthis.com/" target="_blank" title="AddThis">AddThis</a> <a href="http://wordpress.org/extend/plugins/addthis/" target="_blank" title="AddThis WordPress Plugin">WordPress Plugin</a> and I couldn&#8217;t get it to work with WPMU.  I found a thread on the <a href="http://www.addthis.com/forum/viewtopic.php?f=4&amp;t=9647" target="_blank" title="AddThis Forums">addthis forums</a> that discussed the exact problem, with a suggestion like the openid problem that had been updated.</p>

<p>The post/bug report on openid suggested to update the plugin to use the new register_setting/settings_fields methods which are now available with WordPress 2.7 and above.  The documentation for that is here: <a href="http://codex.wordpress.org/Creating_Options_Pages" target="_blank" title="Creating Options Pages">http://codex.wordpress.org/Creating_Options_Pages</a>.</p>

<p>I made the same changes, and everything seems to work.  Here is a patch:</p>
<h3><a href="http://matmrosko.com/files/2009/09/addthis_wpmu_fix.patch" title="addthis_wpmu_fix.patch">addthis_wpmu_fix.patch</a></h3>
<pre class="prettyprint">
diff --git a/addthis_social_widget.php b/addthis_social_widget.php
index 39c4a5c..3ed2c5c 100644
--- a/addthis_social_widget.php
+++ b/addthis_social_widget.php
@@ -51,6 +51,26 @@ $addthis_styles = array(
                         , 'custom' => array('img'=>'http://example.com/button.gif', 'w'=>16, 'h'=>16) */
                     );

+if ( is_admin() ) {
+    add_action( 'admin_init', 'register_addthis_settings' );
+}
+
+function register_addthis_settings() {
+    register_setting('addthis', 'addthis_username');
+    register_setting('addthis', 'addthis_style');
+    register_setting('addthis', 'addthis_sidebar_only');
+    register_setting('addthis', 'addthis_isdropdown');
+    register_setting('addthis', 'addthis_showonpages');
+    register_setting('addthis', 'addthis_showoncats');
+    register_setting('addthis', 'addthis_showonhome');
+    register_setting('addthis', 'addthis_showonarchives');
+    register_setting('addthis', 'addthis_language');
+    register_setting('addthis', 'addthis_brand');
+    register_setting('addthis', 'addthis_options');
+    register_setting('addthis', 'addthis_header_background');
+    register_setting('addthis', 'addthis_header_color');
+}
+

 /**
 * Adds WP filter so we can append the AddThis button to post content.
@@ -216,7 +236,7 @@ function addthis_plugin_options_php4() {
     <h2>AddThis</h2>

     <form method="post" action="options.php">
-    
+    

     <h3>Required</h3>
     <table class="form-table">
@@ -305,9 +325,6 @@ function addthis_plugin_options_php4() {
         </tr>
     </table>

-    
-    
-
     <p class="submit">
     <input type="submit" name="Submit" value="" />
     </p>
</pre>]]></content:encoded>
			<wfw:commentRss>http://matmrosko.com/2009/09/30/addthis-wordpress-plugin-with-wpmu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mirror Checking using a &#8220;live&#8221; md5sum</title>
		<link>http://matmrosko.com/2008/01/18/live-md5/</link>
		<comments>http://matmrosko.com/2008/01/18/live-md5/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 17:02:39 +0000</pubDate>
		<dc:creator>mat</dc:creator>
		
		<guid isPermaLink="false">http://www.matmrosko.com/2008/01/18/live-md5/</guid>
		<description><![CDATA[If you&#8217;ve &#8220;mirrored&#8221; some files and want to do an md5sum check recursively without an intermediate file (md5sum &#62; file; md5sum -c file) you can do it in one easy step using this from the relative path where you are mirroring: ssh ${HOST} find ${DIR} -type f -exec md5sum {} \\\; &#124; sed sF${DIR}FF &#124; [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve &#8220;mirrored&#8221; some files and want to do an md5sum check recursively without an intermediate file (md5sum &gt; file; md5sum -c file) you can do it in one easy step using this from the relative path where you are mirroring:</p>
<p><code><br />
ssh ${HOST} find ${DIR} -type f -exec md5sum {} \\\; | sed sF${DIR}FF | md5sum -c -<br />
</code></p>
<p>This will ssh to the machine, run the md5sum, pipe it to sed to remove the absolute path prefix to make the md5sum &#8216;file&#8217; (stdin to the final md5sum) use relative paths.</p>
]]></content:encoded>
			<wfw:commentRss>http://matmrosko.com/2008/01/18/live-md5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Metallica &#8211; One-liner</title>
		<link>http://matmrosko.com/2008/01/16/metallica-one/</link>
		<comments>http://matmrosko.com/2008/01/16/metallica-one/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 19:32:57 +0000</pubDate>
		<dc:creator>mat</dc:creator>
		
		<guid isPermaLink="false">http://www.matmrosko.com/2008/01/16/metallica-one/</guid>
		<description><![CDATA[I use Metallica one-word song titles as hostnames on my PCs, so to easily look through my MP3s to find 1-word song titles, I used this gem: ls * &#124; sed -n 's/^.. - \([^ ]*\).mp3$/\1/p' &#124; sort -u]]></description>
			<content:encoded><![CDATA[<p>I use Metallica one-word song titles as hostnames on my PCs, so to easily look through my MP3s to find 1-word song titles, I used this gem:</p>
<p><code>ls * | sed -n 's/^.. - \([^ ]*\).mp3$/\1/p' | sort -u</code></p>
]]></content:encoded>
			<wfw:commentRss>http://matmrosko.com/2008/01/16/metallica-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

