<?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"
	>

<channel>
	<title>Ipsa scientia potestas est</title>
	<atom:link href="http://el8.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://el8.org</link>
	<description>Knowledge itself is power.  The life and family of Evan Brewer, a.k.a. dmess0r</description>
	<pubDate>Sun, 26 Oct 2008 08:05:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>More global warming bits</title>
		<link>http://el8.org/2008/10/26/more-global-warming-bits/</link>
		<comments>http://el8.org/2008/10/26/more-global-warming-bits/#comments</comments>
		<pubDate>Sun, 26 Oct 2008 08:05:30 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[academia]]></category>

		<category><![CDATA[geek]]></category>

		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://el8.org/?p=342</guid>
		<description><![CDATA[After watching a wonderful documentary on Antarctica on MOJO TV, I decided to do some more up-to-date research on what the scientific community has to say about global warming.  In my opinion, the only real source we can/should reference is the National Environment Satellite, Data, and Information Service (NESDIS) and the National Climatic Data Center [...]]]></description>
			<content:encoded><![CDATA[<p>After watching a wonderful documentary on Antarctica on MOJO TV, I decided to do some more up-to-date research on what the scientific community has to say about global warming.  In my opinion, the only real source we can/should reference is the <a title="National Environment Satelitte, Data, and Information Service" href="http://www.nesdis.noaa.gov/">National Environment Satellite, Data, and Information Service (NESDIS) </a>and the National Climatic Data Center (NCDC).  Both centers contain relevant data; paleoclimatic as well as current.  Much of the data I refer to below is based upon the 2007 Fourth Assessment Report by the Intergovernmental Panel on Climate Change (IPCC).</p>
<p>Ultimately there is no scientific debate on whether or not the mean average of global climate temperature is rising.</p>
<p>Given this information one immediately jumps to the conclusion that this increase is drastic, widespread and spells out the end of the world or some such nonsense.  Luckily the end of the world isn&#8217;t scheduled for Dec. 21 2012, and not only are temperature increases non-uniform, there are places on the globe which have been getting cooler since we have began to measure more accurately.</p>
<p>Whereas many parts of the world are experiencing an overall increase in temperature, some parts of the southeastern U.S and parts of the North Atlantic have <a title="Decrease in temperatures" href="http://www.ncdc.noaa.gov/oa/climate/globalwarming.html#q3" target="_blank"><strong><em>decreased</em></strong></a> in temperature over the last 100 years.</p>
<p>What is also interesting is that while the Arctic ice is decreasing, the Antarctic ice sheet is actually <a title="Antarctic ice sheet increasing" href="http://www.ncdc.noaa.gov/oa/climate/globalwarming.html#q3" target="_blank"><em><strong>growing</strong></em></a> slightly.  A quote from the NCDC:</p>
<blockquote><p>Sea ice in the Antarctic has shown very little trend over the same period, or even a <strong><em>slight increase</em></strong> since 1979.</p></blockquote>
<p>Another misconception that countless individuals have is this notion that melting glaciers are somehow responsible for the global mean sea level rising.  The rise we&#8217;ve seen over the last several thousand years is due in large part to thermal expansion.  Even today, modern science still does not fully understand how glacier dynamics play into the hydrologic system.  A quote from the NCDC:</p>
<blockquote><p>&#8230; our current understanding of ice sheet dynamics renders uncertainties too large to be able to assess the likelihood of large-scale melting of these ice sheets.</p></blockquote>
<p>The moral of this story is that while global warming is happening there are simply too many unknowns to make sweeping statements about glacier melt, rising sea levels and the overall impact on the various species which inhabit our planet.</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/10/26/more-global-warming-bits/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Dell PowerEdge vs HP Proliant - Firmware Updates</title>
		<link>http://el8.org/2008/10/12/dell-poweredge-vs-hp-proliant-firmware-updates/</link>
		<comments>http://el8.org/2008/10/12/dell-poweredge-vs-hp-proliant-firmware-updates/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 18:26:10 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://el8.org/?p=340</guid>
		<description><![CDATA[When it comes to server maintenance, there is nothing quite as useful as bootable media which contains a bundle of firmware updates.  I realize centrally-managed server-maintenance environments are sexy, but there are always times when you need to power down a box and install firmware updates.
So whats the story with Dell vs. HP?  Each company [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to server maintenance, there is nothing quite as useful as bootable media which contains a bundle of firmware updates.  I realize centrally-managed server-maintenance environments are sexy, but there are always times when you need to power down a box and install firmware updates.</p>
<p>So whats the story with Dell vs. HP?  Each company has created their own respective bootable, CD/DVD based firmware update utilities.  HP with <a title="HP Firmware Maintenance CD" href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&amp;cc=us&amp;prodTypeId=15351&amp;prodSeriesId=397634&amp;swItem=MTX-2daedac9c17648c7905b64f8c3&amp;prodNameId=3288132&amp;swEnvOID=1005&amp;swLang=8&amp;taskId=135&amp;mode=5" target="_blank">Firmware Maintenance CD</a> and Dell with <a title="Dell Systems Buid and Update Utility" href="http://support.dell.com/support/downloads/download.aspx?c=us&amp;l=en&amp;s=gen&amp;releaseid=R200232&amp;SystemID=PWE_PNT_PIII_1650&amp;servicetag=&amp;os=WNET&amp;osl=en&amp;deviceid=17782&amp;devlib=0&amp;typecnt=0&amp;vercnt=3&amp;catid=-1&amp;impid=-1&amp;formatcnt=1&amp;libid=36&amp;fileid=279040" target="_blank">Dell Systems Build and Update Utility</a>, Proliant and PowerEdge class systems respectively.</p>
<p>When did these manufacturers first come out with this bootable media?</p>
<p>HP, <a title="HP Firmware Maintenance CD, Version 7.0.1" href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&amp;cc=us&amp;prodTypeId=15351&amp;prodSeriesId=397634&amp;prodNameId=3288132&amp;swEnvOID=1005&amp;swLang=8&amp;taskId=135&amp;swItem=MTX-UNITY-I22494&amp;mode=3" target="_blank">December 2003</a>.</p>
<p>Dell, <a title="Dell Systems Buid and Update Utility" href="http://support.dell.com/support/edocs/software/smsbu/" target="_blank">November 2007</a>.</p>
<p>Why did Dell take so long?  They didn&#8217;t.</p>
<p>Here&#8217;s my take.  HP has been in the mainframe and unix world for a <em>very</em> long time.  They have been making carrier-grade hardware for as long as I can remember.  Dell is &#8220;relatively&#8221; the new kid on the block with the server-scene.  While they do have some catching up to do, they&#8217;re making good progress with the new PE 1950 III&#8217;s.  It is nice to see servers finally using 2.5&#8243; drives that run 10KRPM.  Packing 6 drives into a 1U server without compromising speed or function is pretty impressive.</p>
<p>Ultimately the moral of this story is, as of about a year ago Dell is finally making bootable media that assists admins in updating firmware whereas HP has been doing it since 2003.  Let&#8217;s hope Dell keeps up the pace as I really like the stability of their hardware.  RHEL5 and CentOS5 run like a dream on PowerEdge hardware.</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/10/12/dell-poweredge-vs-hp-proliant-firmware-updates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>my.cnf for InnoDB</title>
		<link>http://el8.org/2008/10/10/mycnf-for-innodb/</link>
		<comments>http://el8.org/2008/10/10/mycnf-for-innodb/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 18:59:31 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://el8.org/?p=338</guid>
		<description><![CDATA[A few friends have been asking me what my my.cnf looks like for a master database, using InnoDB.  I&#8217;ve decided to just post it, removing only the bits that would compromise security.  Ultimately this config is the most versatile one I&#8217;ve come up with to date.  Just so everyone understands, the scale I was working [...]]]></description>
			<content:encoded><![CDATA[<p>A few friends have been asking me what my my.cnf looks like for a master database, using InnoDB.  I&#8217;ve decided to just post it, removing only the bits that would compromise security.  Ultimately this config is the most versatile one I&#8217;ve come up with to date.  Just so everyone understands, the scale I was working with was about a ~250G.  Server is a Dell 2950, 16G RAM, 15kRPM 146GB SAS drives in a hardware RAID 10, CentOS x86_64, with patched kernel for optimal Dell support, with /var/lib/mysql on its own partition, using XFS as the filesystem.  It blazes, blazes like you wouldn&#8217;t believe.  Even with application servers pounding the crap out of this system, we hardly ever see load above <em><strong>1.5</strong></em>. yes, <strong><em>1.5.</em></strong></p>
<p>Heres the config with comments:</p>
<blockquote><p>[client]<br />
port            = 3306<br />
socket          = /var/lib/mysql/mysql.sock</p>
<p>[mysqld]<br />
port            = 3306<br />
datadir         = /var/lib/mysql/<br />
socket          = /var/lib/mysql/mysql.sock<br />
skip-locking<br />
skip-name-resolve<br />
key_buffer = 256M<br />
max_allowed_packet = 2M<br />
table_cache = 512<br />
sort_buffer_size = 64M<br />
read_buffer_size = 64M<br />
read_rnd_buffer_size = 32M<br />
myisam_sort_buffer_size = 32M<br />
thread_cache_size = 32<br />
query_cache_size = 512M<br />
# Dual procs, dual core, 4*2=8<br />
thread_concurrency = 8<br />
max_connections =  1000</p>
<p># dont make mistakes with engine<br />
default-storage-engine = InnoDB</p>
<p>log-slow-queries = /var/log/mysql-slow.log<br />
long_query_time = 5</p>
<p># Replication Master Server (default)<br />
# binary logging is required for replication<br />
log-bin=mysql-bin<br />
relay-log=relay-bin</p>
<p>log_slave_updates = OFF</p>
<p># we&#8217;re the master<br />
server-id = 1</p>
<p># heres one you should use: innodb_file_per_table<br />
# ultimately this makes innodb create a file on disk for each table you create.<br />
# this is incredibly useful if you have to re-claim disk space. if you don&#8217;t use this<br />
# and you drop a table, the ibdata1 doesn&#8217;t shrink.  you lose the diskspace.<br />
innodb_file_per_table<br />
innodb_data_home_dir = /var/lib/mysql/<br />
innodb_data_file_path = ibdata1:10M:autoextend<br />
# now i could put the logs on a different partition/disk, but it hasn&#8217;t been a bottleneck so far<br />
innodb_log_group_home_dir = /var/lib/mysql/<br />
innodb_log_arch_dir = /var/lib/mysql/<br />
innodb_log_files_in_group = 2<br />
# You can set .._buffer_pool_size up to 50 - 80 %<br />
# we have more than 8G on the box.<br />
innodb_buffer_pool_size = 4096M<br />
innodb_additional_mem_pool_size = 512M<br />
# Set .._log_file_size to 25 % of buffer pool size<br />
innodb_log_file_size = 1024M<br />
innodb_log_buffer_size = 128M<br />
innodb_flush_log_at_trx_commit = 1<br />
innodb_lock_wait_timeout = 50</p>
<p>[mysqldump]<br />
quick<br />
max_allowed_packet = 16M</p>
<p>[mysql]<br />
no-auto-rehash</p>
<p>[isamchk]<br />
key_buffer = 128M<br />
sort_buffer_size = 128M<br />
read_buffer = 2M<br />
write_buffer = 2M</p>
<p>[myisamchk]<br />
key_buffer = 128M<br />
sort_buffer_size = 128M<br />
read_buffer = 2M<br />
write_buffer = 2M</p>
<p>[mysqlhotcopy]<br />
interactive-timeout</p></blockquote>
<p>Now this setup isn&#8217;t for everyone, and I left out the replication bits.  You will undoubtedly have to tweak all the memory utilization settings for your own config, but this one works for me.  Really the moral of this story is, use the following if you can help it:</p>
<ul>
<li>CentOS 64bit</li>
<li>RAID (preferably 10 for speed/performance)</li>
<li>Partition strictly for MySQL using XFS as the filesystem</li>
<li>InnoDB with table per/file</li>
</ul>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/10/10/mycnf-for-innodb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More baseball bats a&#8217;flyin&#8217;</title>
		<link>http://el8.org/2008/10/09/more-baseball-bats-aflyin/</link>
		<comments>http://el8.org/2008/10/09/more-baseball-bats-aflyin/#comments</comments>
		<pubDate>Fri, 10 Oct 2008 05:44:12 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[image of the day]]></category>

		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://el8.org/?p=335</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://el8.org/wp-content/uploads/2008/10/baseball.jpg"><img class="alignnone size-full wp-image-336" title="More baseball bats a'flyin'" src="http://el8.org/wp-content/uploads/2008/10/baseball.jpg" alt="" width="500" height="301" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/10/09/more-baseball-bats-aflyin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Doughnut burgers</title>
		<link>http://el8.org/2008/10/04/doughnut-burgers/</link>
		<comments>http://el8.org/2008/10/04/doughnut-burgers/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 21:49:46 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[life]]></category>

		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://el8.org/?p=332</guid>
		<description><![CDATA[Just when you thought the bacon cheeseburger couldn&#8217;t get anymore &#8230; delicious?

]]></description>
			<content:encoded><![CDATA[<p>Just when you thought the bacon cheeseburger couldn&#8217;t get anymore &#8230; delicious?</p>
<p><a href="http://el8.org/wp-content/uploads/2008/10/2904136361_1d010588ba.jpg"><img class="alignnone size-full wp-image-333" title="2904136361_1d010588ba" src="http://el8.org/wp-content/uploads/2008/10/2904136361_1d010588ba.jpg" alt="" width="500" height="375" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/10/04/doughnut-burgers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Tools to assist comparison of binary data</title>
		<link>http://el8.org/2008/09/23/tools-to-assist-comparison-of-binary-data/</link>
		<comments>http://el8.org/2008/09/23/tools-to-assist-comparison-of-binary-data/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 08:23:20 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[academia]]></category>

		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://el8.org/?p=331</guid>
		<description><![CDATA[As a part of my work with the MSR206 I needed to write some small scripts and command lines to help deal with binary data.  Using vi(1) or emacs(1) just seemed too cumbersome for the lightweight data which I was analyzing, so I wrote some simple command lines to assist.
hexlate
The first one I call &#8220;hexlate&#8221;.  [...]]]></description>
			<content:encoded><![CDATA[<p>As a part of my work with the MSR206 I needed to write some small scripts and command lines to help deal with binary data.  Using vi(1) or emacs(1) just seemed too cumbersome for the lightweight data which I was analyzing, so I wrote some simple command lines to assist.</p>
<p><strong>hexlate</strong></p>
<p>The first one I call &#8220;hexlate&#8221;.  hexlate is just hexdump with special formatting arguments.</p>
<blockquote><p><code>#!/bin/sh<br />
hexdump -v -e '"\\""x" 1/1 "%02x"'</code></p></blockquote>
<p>Essentially here we run hexdump(1), pass it &#8220;-v&#8221; which causes hexdump to display all input data and not replace duplicate data with asterisks.  Next is the formatting rule.  Here I tell it that I want to display all characters in hexadecimal code in two character format.</p>
<p>Here is a test file:</p>
<blockquote><p><code>asgar:tmp evan$ cat old<br />
ABCDE<br />
asgar:tmp evan$</code></p></blockquote>
<p>Notice the carriage at the end.</p>
<p>Here is the same test file run through hexlate:</p>
<blockquote><p><code>asgar:tmp evan$ cat old | ./hexlate<br />
\x41\x42\x43\x44\x45\x0aasgar:tmp evan$</code></p></blockquote>
<p>Notice the \x0a at the end? Thats the carriage return.</p>
<blockquote><p><code>asgar:tmp evan$ echo -ne '\n' | ./hexlate<br />
\x0aasgar:tmp evan$</code></p></blockquote>
<p>hexlate is a really useful tool to quickly eyeball binary data, and then use it with perl.  In this format, we can use the print function in perl to produce the binary output via stdout.</p>
<p>perl -e print &#8220;\x41\x42\x43\x44\x45\x0a&#8221;</p>
<blockquote><p><code>asgar:tmp evan$ perl -e 'print "\x41\x42\x43\x44\x45\x0a"'<br />
ABCDE<br />
asgar:tmp evan$</code></p></blockquote>
<p>If you had a large block of hexlate output, you could easily incorporate it into a script.</p>
<p><strong>prep</strong>, <strong>compare</strong></p>
<p>The next two tools are primarily used together, &#8220;prep&#8221; and &#8220;compare&#8221;.</p>
<p>The first one, prep, is (once again) another hexdump command line:</p>
<blockquote><p><code>#!/bin/sh<br />
hexdump -v -e '1/1 "%02x\n"' $1</code></p></blockquote>
<p>This time the format looks like this:</p>
<blockquote><p><code>asgar:tmp evan$ cat old | ./prep<br />
41<br />
42<br />
43<br />
44<br />
45<br />
0a<br />
asgar:tmp evan$</code></p></blockquote>
<p>Why would this be useful at all?  I&#8217;ll tell you why, lets say you have two binary strings that you want to compare, literally.  If you simply did a hexdump against them, or even a hexlate the output can be a bit difficult to easily spot changes.  Let&#8217;s take a look at &#8220;compare&#8221; and see where I am going with this.</p>
<p>Here is what &#8220;compare&#8221; looks like:</p>
<blockquote><p><code>export PATH=./:${PATH}<br />
diff -yW10 &lt;(prep $1) &lt;(prep $2)</code></p></blockquote>
<p>Here&#8217;s how to use it and the output:</p>
<blockquote><p><code>asgar:tmp evan$ ./compare ./old ./new<br />
41      41<br />
42      42<br />
43      43<br />
44  |   20<br />
45      45<br />
0a      0a</code></p></blockquote>
<p>Whoa wtf?  Yeah, rad huh?  Okay so here is whats happening.  Lets start with the &lt;(prep $1) and &lt;(prep $2) action.  In bash we can take the output of a command and turn it into a file, /dev/fd/&lt;number&gt;.  When we do this, we get output as files.  So we &#8220;prep&#8221; file &#8220;old&#8221; and we &#8220;prep&#8221; file &#8220;new&#8221;.  While diff(1) can only will compare files, we&#8217;ve just turned the stdout into files so there is no problem.  Next, the diff is passed the arguments &#8220;-y&#8221;, this forces the diff to be done as a &#8220;side-by-side&#8221; in two columns.  That is how we get the files to line up.  The other argument is &#8220;-W10&#8243;, this just sets the width to 10 possible print columns.</p>
<p>Ultimately we produce output side-by-side, and it is super easy to spot the difference.</p>
<p>File &#8220;old&#8221; is &#8220;ABCDE\n&#8221; and file &#8220;new&#8221; is &#8220;ABC E\n&#8221;.  The letter &#8220;D&#8221; was replaced with a literal space &#8221; &#8220;.  We can see the change clear as day.</p>
<p>I hope you find these tools as useful as I have.  Granted they&#8217;re pretty simple command lines, but damn are they useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/09/23/tools-to-assist-comparison-of-binary-data/feed/</wfw:commentRss>
		</item>
		<item>
		<title>More magstripe work, primitive tools.</title>
		<link>http://el8.org/2008/09/22/more-magstripe-work-primitive-tools/</link>
		<comments>http://el8.org/2008/09/22/more-magstripe-work-primitive-tools/#comments</comments>
		<pubDate>Tue, 23 Sep 2008 06:49:28 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[academia]]></category>

		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://el8.org/?p=329</guid>
		<description><![CDATA[I finally made time to work a bit more on the magstripe project with my MSR206.  Instead of going hog-wild and finishing/polishing dmsr206.pl reference tool like in a previous post, I decided to just make a few scripts with rudimentary functionality.  With this dmsr-2.1.tar.bz2 you can erase, read, and write ISO standard data, which is [...]]]></description>
			<content:encoded><![CDATA[<p>I finally made time to work a bit more on the magstripe project with my MSR206.  Instead of going hog-wild and finishing/polishing <a title="dmsr206.pl - MSR206 reference library in perl" href="http://el8.org/2007/09/27/more-magstripe-work-new-tool-dmsr206pl/" target="_blank">dmsr206.pl reference tool like in a previous post</a>, I decided to just make a few scripts with rudimentary functionality.  With this <a href="http://el8.org/wp-content/uploads/2008/09/dmsr-21tar.bz2">dmsr-2.1.tar.bz2</a> you can erase, read, and write ISO standard data, which is what most people want to do anyway.  I have to say that there is quite a bit of code duplication between the scripts.  There absolutely needs to be a bit of cleanup, but this will definitely get you started.</p>
<p>Disclaimer: If you end up destroying a magstripe on a card you really care about, don&#8217;t come running to me.  erase.pl is to be used with caution.  I will not be held responsible for any fuck-ups you might make with these tools.</p>
<p>One last note before we get started.  I will not answer any questions regarding Device::SerialPort, debugging or any questions regarding serial ports.  If you can&#8217;t figure out how to get the MSR206 to talk to your serial port, I sure as hell am not going to hand-hold you through a duplication process.</p>
<p>Now that you&#8217;ve been adequatedly taunted and warned, lets have some fun.</p>
<p>Here is the README from the archive:</p>
<blockquote><p><code>#<br />
# dmsr-2.1 README<br />
## It is important to know that only ISO card format is supported<br />
# at this time.  We use the 'read' functionality as opposed to the<br />
# 'read raw' functionality.<br />
#<br />
# Evan Brewer &lt;dmess0r@gmail.com&gt; - 2008/09/22<br />
1. Install Device::SerialPort (CPAN works)<br />
perl -MCPAN -e 'install Device::SerialPort'</code></p>
<p><code><br />
2. Copy card data<br />
./read.pl --device=&lt;device&gt; &gt; card.read<br />
[Wait for orange]<br />
[Swipe]</code></p>
<p><code><br />
3. Convert and write out data to MSR206<br />
cat card.read | ./dumpdata.pl | ./strip.pl | ./write.pl --device=&lt;device&gt;<br />
[Wait for orange]<br />
[Swipe]</code></p>
<p><code><br />
4. Compare<br />
./read.pl --device=&lt;device&gt; &gt; blank<br />
[Wait for orange]<br />
[Swipe]<br />
diff costco.read blank</code></p></blockquote>
<p>There is a typo on the third step in the README.  I ended up testing a costco card, and while I was writing my notes I left it in.  Oops.  Should read something like:</p>
<blockquote><p><code>diff card.read blank</code></p></blockquote>
<p>Whatever, you get the point.</p>
<p>Quite terse, here is the process:</p>
<ol>
<li>Install Device::SerialPort perl module.  Mandatory.</li>
<li>Hook up your MSR206.</li>
<li>Read the card data out to a file via stdout: ./read &#8211;device=/dev/ttyUSB0 &gt; card.read</li>
<li>Wait for middle orange light</li>
<li>Swipe</li>
<li>If green light after swipe, then your read is good, check file card.read for data</li>
<li>Erase a blank to which you&#8217;ll copy the new data.</li>
<li>./erase.pl &#8211;device=/dev/ttyUSB0</li>
<li>Wait for orange light</li>
<li>Swipe</li>
<li>Run dumpdata.pl against to pull out all three track data: cat card.read | ./dumpdata.pl &gt; card.data</li>
<li>Take the output of card.data, and run it through strip.pl to remove the sentinels: cat card.data | ./strip.pl &gt; card.strip</li>
<li>Finally, push the dumped, stripped card data into write.pl on the blank card: cat card.strip | ./write.pl &#8211;device=/dev/ttyUSB0</li>
<li>Wait for orange light</li>
<li>Swipe</li>
<li>If green light after swipe, then your write is good (probably).</li>
<li>Now, to make sure, you&#8217;ll want to perform a re-read on the blank and then compare the output against the original read to make sure your dupe is good.</li>
<li>./read &#8211;device=/dev/ttyUSB0 &gt; card.re-read</li>
<li>Wait for orange light</li>
<li>Swipe</li>
<li>diff card.read card.re-read</li>
<li>Presto, you&#8217;ve just duplicated an ISO magstripe.</li>
</ol>
<p>Cool kids will just string the entire write process together.</p>
<blockquote><p><code>cat card.read | ./dumpdata.pl | ./strip.pl | ./write.pl --device=/dev/ttyUSB0</code></p></blockquote>
<p>Your mileage may vary, but the tools work for me.</p>
<p>Also, if your MSR206 ends up with a green/red combo illuminated, it means that whatever action was performed didn&#8217;t go so hot.  Usually happens on a read of a card that contains data which is not in the expected ISO format.  The fast way to reset your MSR206 is to use ./reset &#8211;device=/dev/ttyUSB0.  This will take a second or three and it will reset your device back to a state where you can perform reads/writes again.</p>
<p>One of these days I&#8217;ll clean up dmsr206.pl to the point where it is an actual reference script that contains all of the functionality that is available in the reference manual.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/09/22/more-magstripe-work-primitive-tools/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Traffic Message Channel (TMC) FM (USA) demystified</title>
		<link>http://el8.org/2008/09/12/traffic-message-channel-tmc-fm-usa-demystified/</link>
		<comments>http://el8.org/2008/09/12/traffic-message-channel-tmc-fm-usa-demystified/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 17:37:40 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[academia]]></category>

		<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://el8.org/?p=318</guid>
		<description><![CDATA[Brief Background on R(B)DS

Traffic Message Channel, or TMC, is a method, or technology by which traffic data is delivered to receivers which then convert this data to pertinent, geographic-based traffic-information.  While there are a handful transmission methods on which TMC is delivered such as XM and MSN Direct, the only one I will cover today [...]]]></description>
			<content:encoded><![CDATA[<h2><strong>Brief Background on R(B)DS<br />
</strong></h2>
<p>Traffic Message Channel, or TMC, is a method, or technology by which traffic data is delivered to receivers which then convert this data to pertinent, geographic-based traffic-information.  While there are a handful transmission methods on which TMC is delivered such as XM and MSN Direct, the only one I will cover today is the FM based method: Radio Broadcast Data System.</p>
<p>Radio Broadcast Data System (RBDS) is the official name in the USA for Radio Data System, the communications protocol from the European Broadcasting Union.  One of the only differences, minor as it is, is the numbering system assigned to the 31 formats. More detail on RDS may be found in <a title="European Standard 50067" href="ftp://ftp.rds.org.uk/pub/acrobat/episode/topic9.pdf" target="_blank">European Standard 50067</a>.</p>
<p>The third harmonic of the pilot tone of stereo FM (19 kHz), 57 kHz, was chosen as the subcarrier to carry data at 1187.5 bps, or a clock frequency of 1.11875 kHz.  There also is a maximum deviation of +/- 0.125 bps.   The third harmonic was chosen to avoid any interference with stereo or its second harmonic, the stereo difference frequency of 38 kHz.</p>
<p>The amplitude of the wave is decoded as binary, the resulting data is essentially square.  A very simple 1/0 implementation.</p>
<p>The &#8220;Block&#8221; is the smallest unit of data in an RBDS transmission with 26 bits.  The first portion of the Block structure is the &#8220;Data&#8221;, comprising of 16 bits.  The second, the &#8220;Checkword&#8221;, comprising of 10 bits.</p>
<p><code>[ Data (16bits) ][ Checkword (10 bits) ]</code></p>
<p>The Checkword is a checksum against the Data included in the Block to assist in error protection.</p>
<p>A &#8220;Group&#8221; comprising of 4 Blocks is 104 bits wide.</p>
<p><code>[ Block 1 ][ Block 2 ][ Block 3 ][ Block 4 ]</code></p>
<p><a href="http://el8.org/wp-content/uploads/2008/09/rds-groups.png"><img class="alignnone size-full wp-image-323" title="RDS Groups" src="http://el8.org/wp-content/uploads/2008/09/rds-groups.png" alt="RDS Groups" width="500" height="184" /></a></p>
<p><strong>Block 1 contains:</strong></p>
<p><code>[ PI Code ][ Checkword ]</code></p>
<p>The PI Code is the Program Identifical code which uniquely identifies the transmitting radio station.</p>
<p><strong>Block 2 contains:</strong></p>
<p><code>[ Group code ][ B0 ][ TP ][ PTY ][ 5 bits ][ Checkword ]</code></p>
<p><strong>Block 3 contains:</strong></p>
<p><code>[ Data ][ Checkword ]</code></p>
<p><strong>Block 4 contains:</strong></p>
<p><code>[ Data ][ Checkword ]</code></p>
<p>The group code identifies the type of message as RDS, such as 8A (RDS-TMC).  B0 is the code for the version, a &#8216;0&#8242; for RDS version &#8216;A&#8217;, or &#8216;1&#8242; for RDS version &#8216;B&#8217;.  TP stands for Traffic Program and identifies whether or not the station is able to send traffic announcements (TA).  We don&#8217;t care about TA.  PTY is used for describing the Program Type.</p>
<p>For a comprehensive view of the RDS data structure, refer to <a href="http://el8.org/wp-content/uploads/2008/09/rds-basics.pdf">RDS Basics</a> by 2wcom.</p>
<h2><strong>TMC</strong></h2>
<p>Traffic Message Channel is one of many information fields contained in RBDS and is described in detail in <a href="http://el8.org/wp-content/uploads/2008/09/14819-1.pdf">14819-1</a>.  It is digitally encoded, contains traffic data and is processed with the Alert-C protocol.  The data broadcast supports only very lightweight encryption for commercial services and is described in <a href="http://el8.org/wp-content/uploads/2008/09/14819_6.pdf">14819_6</a>.</p>
<p>RDS-TMC (TMC) data is transmitted in group 8A.  Pulled from ISO 14819-1, here is the structure of 8A:</p>
<p><a href="http://el8.org/wp-content/uploads/2008/09/group-8a.png"><img class="alignnone size-full wp-image-326" title="RDS-TMC / Alert-C Protocol" src="http://el8.org/wp-content/uploads/2008/09/group-8a.png" alt="" width="499" height="133" /></a></p>
<p><strong>Block 1 contains:</strong></p>
<p><code>[ PI Code ][ Checkword ]</code></p>
<p>The PI Code is the Program Identifical code which uniquely identifies the transmitting radio station.</p>
<p><strong>Block 2 contains:</strong></p>
<p><code>[ Group code ][ B0 ][ TP ][ PTY ][ T ][ F ][ DP ][ Checkword ]</code></p>
<p>Group code through PTY is the same as listed above in the RDS specification.  T, F, and D are used together to indicate whether this is part of a Multi Group message. TFD = 001 indicates that this is the first group in a sequence, or TFD = 000 indicates that this group is NOT the first.  DP stands for &#8216;duration&#8217; and &#8216;persistence&#8217;, essentially indicates the timeframe related to the traffic event so that the decoder knows whether or not this event is &#8216;fresh&#8217;.</p>
<p><strong>Block 3 contains:</strong></p>
<p><code>[ D ][ PN ][ Extent ][ Event ][ Checkword ]</code></p>
<p>D indicates whether or not diversion advice is necessary. PN stands for &#8216;positive&#8217; and &#8216;negative&#8217;, which indicates in which direction of the queue events and is opposite to the road direction.  Extent indicates the &#8216;extension&#8217; of the even and is measured by Location Table entries.  Event, the second longest code is cross-referenced against a lookup-table in the Event Code table.</p>
<p><strong>Block 4 contains:</strong></p>
<p><code>[ Location ][ Checkword ]</code></p>
<p>Location, the longest code is cross-referenced against the Location Table database.</p>
<p><strong>Event Codes</strong></p>
<p>If you&#8217;re interested in the Event codes, you should check out <a href="http://el8.org/wp-content/uploads/2008/09/14819-2.pdf">14819-2</a>.  There are some pretty interesting codes you&#8217;ll notice.  There are some pretty basic ones, such as, Line 37 &#8220;traffic congestion, average speed of 10 km/h&#8221;, or Line 154 &#8220;closed ahead. Stationary traffic for 4 km&#8221;.  There also are codes which are geographically specific such as Line 1128 &#8220;bull fight&#8221;, or Line 1129 &#8220;cricket match&#8221;.</p>
<p><strong>Hacking</strong></p>
<p>Andrea Barisani and Daniele Bianco of <a title="Inversepath.com" href="http://www.inversepath.com/open_source.html" target="_blank">inversepath.com</a> back in 2007 wrote up <a title="Phrack Article on RDS-TMC" href="http://dev.inversepath.com/rds/phrack_0x0c_0x40_0x05.txt" target="_blank">an article</a> for Phrack on just this subject.  Also at the Telemobility Conference back in 2007, they presented <a title="Telemobility 2007 RDS-TMC hacking" href="http://el8.org/wp-admin/www.telemobilityforum.com/it/images/stories/daniele%20bianco.pdf" target="_blank">this talk</a>.</p>
<p><strong>Practical usage for the US</strong></p>
<p>So what does all of this mean for the average Joe in the US.  It is important to know that at the time of this writing, RDS-TMC is not embraced like you&#8217;d think it SHOULD be.  It is a fantastic system and it is gaining momentum but it is not available everywhere you go.  The official site for the US is <a title="Total Traffic Network (TMC)" href="http://www.realtimetraffic.net/" target="_blank">realtimetraffic.net</a> and this site contains the most current information regarding information for the US.  This <a href="http://el8.org/wp-content/uploads/2008/09/stationlist.pdf">Station Listing of RDS-TMC channels in the US</a> will give you an idea of the coverage in the US thus far.</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/09/12/traffic-message-channel-tmc-fm-usa-demystified/feed/</wfw:commentRss>
		</item>
		<item>
		<title>pyTivo on Western Digital MyBook World Edition</title>
		<link>http://el8.org/2008/09/10/pytivo-on-western-digital/</link>
		<comments>http://el8.org/2008/09/10/pytivo-on-western-digital/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 19:30:02 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[BitTorrent]]></category>

		<category><![CDATA[geek]]></category>

		<category><![CDATA[tv]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://el8.org/?p=316</guid>
		<description><![CDATA[I had this idea the other day that I could hack my Western Digital MyBook World Edition (mybook), install pyTivo, and setup an all-inclusive storage and HMO/GoBack platform for my Series3.  BitTorrent from my workstation to a CIFS share on the mybook, and then stream from the mybook to the series3.

So here we go, torrent [...]]]></description>
			<content:encoded><![CDATA[<p>I had this idea the other day that I could hack my Western Digital MyBook World Edition (mybook), install pyTivo, and setup an all-inclusive storage and HMO/GoBack platform for my Series3.  BitTorrent from my workstation to a CIFS share on the mybook, and then stream from the mybook to the series3.</p>
<p><a href="http://el8.org/wp-content/uploads/2008/09/awesome.jpg"><img class="size-medium wp-image-317" title="awesome" src="http://el8.org/wp-content/uploads/2008/09/awesome.jpg" alt="pyTivo on mybook, stream to series3 TiVo" width="245" height="240" /></a></p>
<p>So here we go, torrent from the workstation, save on mybook, and stream onto series3?  Seems like a good idea.</p>
<p>First I had to hack the mybook and get SSH installed to make any of this work.  I used the SSH enabler hack found here:<br />
<code><a title="Enable SSH on MyBook World" href="http://www.mybook-linux.co.nr/" target="_blank"></a></code></p>
<p style="padding-left: 30px;"><code><a title="Enable SSH on MyBook World" href="http://www.mybook-linux.co.nr/" target="_blank">http://www.mybook-linux.co.nr/</a></code></p>
<p>Next I needed to get Python and ffmpeg installed as they are dependencies of pyTivo.  I quickly checked the architecture and memory available.</p>
<p style="padding-left: 30px;"><code>Linux MyBookWorld 2.6.17.14 #1 PREEMPT Mon Mar 26 12:36:33 BST 2007 armv5tejl GNU/Linux</code></p>
<p>Now this processor is decent, but not blazingly fast so I decided to grab binaries rather than compile from source.  Believe it or not the mybook came preinstalled with gcc and binutils.  Mind-bending no?</p>
<p>So I setup <a title="Optware" href="http://http//mybookworld.wikidot.com/optware" target="_blank">Optware</a> and installed python25 and ffmpeg via ipkg.</p>
<p style="padding-left: 30px;"><code>[root@MyBookWorld ~]# python -V<br />
Python 2.5.2</code></p>
<p>So far so good.</p>
<p style="padding-left: 30px;"><code>[root@MyBookWorld ~]# ffmpeg -version<br />
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.<br />
configuration: &#8211;enable-cross-compile &#8211;cross-prefix=/home/slug/optware/gumstix1151/toolchain/gumstix-buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc- &#8211;arch=arm &#8211;disable-encoder=snow &#8211;disable-decoder=snow &#8211;enable-shared &#8211;disable-static &#8211;enable-gpl &#8211;enable-postproc &#8211;prefix=/opt<br />
libavutil version: 49.6.0<br />
libavcodec version: 51.54.0<br />
libavformat version: 52.13.0<br />
libavdevice version: 52.0.0<br />
built on Apr 15 2008 23:06:38, gcc: 3.4.5<br />
FFmpeg UNKNOWN<br />
libavutil   3212800<br />
libavcodec  3356160<br />
libavformat 3411200<br />
libavdevice 3407872<br />
</code></p>
<p>Next I tested ffmpeg to make sure it was able to transcode properly.</p>
<p style="padding-left: 30px;"><code>[root@MyBookWorld tmp]# ffmpeg -i test.mp4 test.mp2<br />
FFmpeg version UNKNOWN, Copyright (c) 2000-2008 Fabrice Bellard, et al.<br />
configuration: &#8211;enable-cross-compile &#8211;cross-prefix=/home/slug/optware/gumstix1151/toolchain/gumstix-buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc- &#8211;arch=arm &#8211;disable-encoder=snow &#8211;disable-decoder=snow &#8211;enable-shared &#8211;disable-static &#8211;enable-gpl &#8211;enable-postproc &#8211;prefix=/opt<br />
libavutil version: 49.6.0<br />
libavcodec version: 51.54.0<br />
libavformat version: 52.13.0<br />
libavdevice version: 52.0.0<br />
built on Apr 15 2008 23:06:38, gcc: 3.4.5<br />
<strong><span style="color: #ff0000;">Illegal instruction</span></strong></code></p>
<p>Shit.  <em><strong>Illegal instruction</strong></em>.  This means that the binary is probably attempting to use a register which undoubtedly doesn&#8217;t exist, OR it is making a call to a processor extension which isn&#8217;t present.  I know that ffmpeg(1) makes significant usage of processor extensions such as MMX MMX2 SSE and SSE2, and this binary package was clearly built without the necessary &#8211;disable flags.  Unless you explicitly compile ffmpeg without those extensions, they will be used.</p>
<p style="padding-left: 30px;"><code>Processor       : ARM926EJ-Sid(wb) rev 5 (v5l)<br />
BogoMIPS        : 99.73<br />
Features        : swp half thumb fastmult edsp java<br />
CPU implementer : 0x41<br />
CPU architecture: 5TEJ<br />
CPU variant     : 0x0<br />
CPU part        : 0x926<br />
CPU revision    : 5<br />
Cache type      : write-back<br />
Cache clean     : cp15 c7 ops<br />
Cache lockdown  : format C<br />
Cache format    : Harvard<br />
I size          : 32768<br />
I assoc         : 4<br />
I line length   : 32<br />
I sets          : 256<br />
D size          : 32768<br />
D assoc         : 4<br />
D line length   : 32<br />
D sets          : 256</code></p>
<p style="padding-left: 30px;"><code><br />
Hardware        : Oxsemi NAS<br />
Revision        : 0000<br />
Serial          : 0000000000000000<br />
</code></p>
<p>Groan, okay so I rebuilt ffmpeg without any of the CPU extensions because clearly this processor doesn&#8217;t have a single extension of which ffmpeg makes use.  I should be good to go right?</p>
<p>Wrong.</p>
<p><strong>Moral of the story:</strong></p>
<p>The ARM926EJ-Sid(wb) rev 5 (v5l) is so slow that conversion of 15 seconds of Audio and Video using ffmpeg took more than 5 minutes to complete.  Some people have said that the disk access is the bottleneck, but this simply isn&#8217;t the case.  vmstat(1) during conversion revealed that disk I/O was well underutilized.  The load average was well over 4 during conversion.  If you had the bright idea to use pyTivo on your Western Digital MyBook World Edition, think again.</p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/09/10/pytivo-on-western-digital/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Parking in France</title>
		<link>http://el8.org/2008/09/08/parking-in-france/</link>
		<comments>http://el8.org/2008/09/08/parking-in-france/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 21:46:29 +0000</pubDate>
		<dc:creator>dmess0r</dc:creator>
		
		<category><![CDATA[life]]></category>

		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://el8.org/?p=315</guid>
		<description><![CDATA[Who knows what this guy was thinking when he was parking his car.  Late for a meeting?  Bad hair day?  Either way he tries to fit a Renault Megane into a spot that is a hair bigger than a Mini.  The most awesome part about it is that after he realizes that theres no way [...]]]></description>
			<content:encoded><![CDATA[<p>Who knows what this guy was thinking when he was parking his car.  Late for a meeting?  Bad hair day?  Either way he tries to fit a Renault Megane into a spot that is a hair bigger than a Mini.  The most awesome part about it is that after he realizes that theres no way hes going to fit in the spot after bashing into the adjacent cars, he just gets out and walks away from the vehicle.  Brilliant.</p>
<p><object width="464" height="392"><param name="movie" value="http://embed.break.com/NTIzNzAx"></param><embed src="http://embed.break.com/NTIzNzAx" type="application/x-shockwave-flash" width="464" height="392"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://el8.org/2008/09/08/parking-in-france/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
