<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1320025328660813471</id><updated>2011-11-27T16:50:52.859-08:00</updated><category term='megacli'/><category term='debian'/><category term='dell'/><category term='perc5i'/><category term='msp430'/><category term='php'/><title type='text'>Nerd</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-1598277378914426241</id><published>2010-10-01T08:54:00.000-07:00</published><updated>2010-10-01T08:55:21.635-07:00</updated><title type='text'>Tips for filing a support ticket with properietary software that you use at work</title><content type='html'>1. Be friendly but make the case that you're incapable of doing some part of your job properly. People that yell the loudest (but are friendly) and make a strong case will typically have their issues fixed first. You want to create a sense of guilt at the vendor, not hate, so someone will be more likely to work overtime or bust their ass to fix your problem.&lt;br /&gt;2. You describe clearly what the problem is (more than just "it doesn't work")&lt;br /&gt;3. Describe clear steps to reproduce the problem from start to finish. Include your starting point, relevant data entered and items clicked. This is very important, because it takes forever to fix a bug that can't be easily duplicated. Further, you might get stuck with nothing happening because they think you're doing something wrong.&lt;br /&gt;4. Describe the results you're seeing ("Error Message _____", calculation is 10 cents off, field that's allowed to be blank is required, etc)&lt;br /&gt;5. Describe the results you should be seeing. This is important because the software developer should have a QA team and be able to take the steps from #2 and make sure they've actually fixed the problem instead of simply breaking something in a different way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-1598277378914426241?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/1598277378914426241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=1598277378914426241' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1598277378914426241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1598277378914426241'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2010/10/tips-for-filing-support-ticket-with.html' title='Tips for filing a support ticket with properietary software that you use at work'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-6352808646132379363</id><published>2010-08-05T22:18:00.000-07:00</published><updated>2010-08-05T22:21:43.375-07:00</updated><title type='text'>Capturing Variable Type Data By Running PHP</title><content type='html'>PHP is hard to automatically convert to other languages because there is little type information hardcoded into it.  Here's some sample code that uses the debug interface to extract type information out for variables.  For now, it just dumps the type data to stdout.  Presumably you would need to save this to some sort of sqlite database and run all of your automated tests to ensure full code coverage.  Then you could translate your parsed PHP to another language with the additional information known.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;&lt;br /&gt;  // Use xdebug to determine type information about all of the executed parts of your script                                                                                      &lt;br /&gt;  // to run, 1: execute this                                                                                                                                                      &lt;br /&gt;  // 2: export XDEBUG_CONFIG="idekey=session_name remote_autostart=1 remote_host=127.0.0.1 remote_enable=1"                                                                       &lt;br /&gt;  // 3: run your cli php script                                                                                                                                                   &lt;br /&gt;&lt;br /&gt;// Set time limit to indefinite execution                                                                                                                                         &lt;br /&gt;set_time_limit (0);&lt;br /&gt;&lt;br /&gt;// Set the ip and port we will listen on                                                                                                                                          &lt;br /&gt;$address = '127.0.0.1';&lt;br /&gt;$port = 9000;&lt;br /&gt;&lt;br /&gt;// Create a TCP Stream socket                                                                                                                                                     &lt;br /&gt;$sock = socket_create(AF_INET, SOCK_STREAM, 0);&lt;br /&gt;// Bind the socket to an address/port                                                                                                                                             &lt;br /&gt;socket_bind($sock, $address, $port) or die('Could not bind to address');&lt;br /&gt;// Start listening for connections                                                                                                                                                &lt;br /&gt;socket_listen($sock);&lt;br /&gt;&lt;br /&gt;/* Accept incoming requests and handle them as child processes */&lt;br /&gt;$client = socket_accept($sock);&lt;br /&gt;&lt;br /&gt;// Read the input from the client &amp;#8211; 1024 bytes                                                                                                                              &lt;br /&gt;$input = socket_read($client, 1024);                                                                                                                                              &lt;br /&gt;echo($input);&lt;br /&gt;echo("\n");&lt;br /&gt;// Strip all white spaces from input                                                                                                                                              &lt;br /&gt;$output = preg_replace("/[ \t\n\r]/","",$input).chr(0);&lt;br /&gt;$doc = new DOMDocument();&lt;br /&gt;function read_debugger()&lt;br /&gt;{&lt;br /&gt;    global $client;&lt;br /&gt;    $string = '';&lt;br /&gt;    $char = socket_read($client, 1);&lt;br /&gt;    while(! socket_error() &amp;amp;&amp;amp; $char &lt;&gt; "\0") {&lt;br /&gt;        $string .= $char;&lt;br /&gt;        $char = socket_read($client, 1);&lt;br /&gt;    }&lt;br /&gt;    return $string;&lt;br /&gt;}&lt;br /&gt;while(! socket_last_error($client)) {&lt;br /&gt;    $i++;&lt;br /&gt;    socket_write($client, "step_into -i ".$i."\0");&lt;br /&gt;    $file_line_info = socket_read($client, 1024);&lt;br /&gt;    preg_match('/filename="(.*?)"/', $file_line_info, $matches);&lt;br /&gt;    $line_no = $matches[1];&lt;br /&gt;    preg_match('/lineno="(.*?)"/', $file_line_info, $matches);&lt;br /&gt;    $filename = $matches[1];&lt;br /&gt;    echo("$filename : $line_no ");&lt;br /&gt;    $i++;&lt;br /&gt;    socket_write($client, "context_get -i ".$i."\0");&lt;br /&gt;    $dummy = read_debugger();&lt;br /&gt;    $context_info = read_debugger();&lt;br /&gt;&lt;br /&gt;    if (!($doc-&gt;loadXML($context_info))) {&lt;br /&gt;        die("FAIL ON ".$context_info);&lt;br /&gt;    }&lt;br /&gt;    $propertyNodes = $doc-&gt;getElementsByTagName('property');&lt;br /&gt;    for($j = 0; $j &lt; $propertyNodes-&gt;length; $j++) {&lt;br /&gt;        $property = $propertyNodes-&gt;item($j);&lt;br /&gt;        echo($property-&gt;getAttribute('fullname').':'.$property-&gt;getAttribute('type').' ');&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    echo("\n");&lt;br /&gt; }&lt;br /&gt;// Close the client (child) socket                                                                                                                                                &lt;br /&gt;socket_close($client);&lt;br /&gt;&lt;br /&gt;// Close the master sockets                                                                                                                                                       &lt;br /&gt;socket_close($sock);&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-6352808646132379363?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/6352808646132379363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=6352808646132379363' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/6352808646132379363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/6352808646132379363'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2010/08/capturing-variable-type-data-by-running.html' title='Capturing Variable Type Data By Running PHP'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-7528252414531797256</id><published>2010-04-28T15:41:00.001-07:00</published><updated>2010-04-28T15:41:35.821-07:00</updated><title type='text'>Bumper Stickers</title><content type='html'>A friend is selling some here: http://getoffyourfuckingphone.com/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-7528252414531797256?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/7528252414531797256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=7528252414531797256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/7528252414531797256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/7528252414531797256'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2010/04/bumper-stickers.html' title='Bumper Stickers'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-5749536784758202514</id><published>2009-11-01T15:46:00.000-08:00</published><updated>2009-11-01T16:57:43.252-08:00</updated><title type='text'>removing the texture of old pictures with FFTs</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://e-normous.com/pics/fft_before.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 176px; height: 190px;" src="http://e-normous.com/pics/fft_before.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://e-normous.com/pics/fft_after.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: left; cursor: pointer; width: 190px; height: 188px;" src="http://e-normous.com/pics/fft_after.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Imagej (&lt;a href="http://rsbweb.nih.gov/ij/"&gt;http://rsbweb.nih.gov/ij/&lt;/a&gt;) has an awesome feature that allows you to perform an FFT on an image, edit it, and then do an inverse FFT.  This is very useful for eliminating patterns from an image, such as the texture of old photographs.&lt;br /&gt;&lt;br /&gt;Full size images for further comparison:&lt;br /&gt;http://www.flickr.com/photos/ftzdomino/4065410668/sizes/o/&lt;br /&gt;http://www.flickr.com/photos/ftzdomino/4064662889/sizes/o/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-5749536784758202514?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/5749536784758202514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=5749536784758202514' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/5749536784758202514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/5749536784758202514'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/11/removing-texture-of-old-pictures-with.html' title='removing the texture of old pictures with FFTs'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-9092152634635142745</id><published>2009-10-12T20:50:00.000-07:00</published><updated>2009-10-12T21:10:11.989-07:00</updated><title type='text'>Booting to a raid volume using jfs</title><content type='html'>While upgrading an older debian server, I had to make some modifications to get the kernel booting.   This shouldn't normally be necessary, but for some reason the hardware was not getting auto detected.  I'm almost 100% sure I messed up some other step in order to require this.  The system's root drive is raid1 and uses jfs.  The following changes were done:&lt;br /&gt;&lt;br /&gt;Added: /etc/initramfs-tools/modules:&lt;br /&gt;jfs&lt;br /&gt;raid1&lt;br /&gt;md&lt;br /&gt;&lt;br /&gt;Created:&lt;br /&gt;/etc/initramfs-tools/scripts/local-top/probes&lt;br /&gt;#!/bin/sh&lt;br /&gt;modprobe raid1&lt;br /&gt;modprobe md&lt;br /&gt;modprobe jfs&lt;br /&gt;&lt;br /&gt;mknod /dev/md2 b 9 2&lt;br /&gt;mknod /dev/md0 b 9 0&lt;br /&gt;mknod /dev/md1 b 9 1&lt;br /&gt;mdadm --assemble --scan&lt;br /&gt;&lt;br /&gt;The above script must be chmod +x'd.  I copied to it /etc/initramfs-tools/scripts/local-top/probe/local-premount/ just to make sure it ran.&lt;br /&gt;&lt;br /&gt;Modified /usr/sbin/mkinitramfs in the #modutils section:&lt;br /&gt;copy_exec /sbin/mdadm /sbin&lt;br /&gt;copy_exec /sbin/fsck.jfs /sbin&lt;br /&gt;mkdir -p "${DESTDIR}/etc/mdadm"&lt;br /&gt;cp -a /etc/mdadm/mdadm.conf "${DESTDIR}/etc/mdadm/"&lt;br /&gt;&lt;br /&gt;The above changes were done by booting into the rescue mode of a debian installer and mounting.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-9092152634635142745?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/9092152634635142745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=9092152634635142745' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/9092152634635142745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/9092152634635142745'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/10/booting-to-raid-volume-using-jfs.html' title='Booting to a raid volume using jfs'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-4843927317933876464</id><published>2009-08-25T16:50:00.000-07:00</published><updated>2009-08-25T16:58:21.520-07:00</updated><title type='text'>Installing Windows Server 2008 in VirtualBox</title><content type='html'>Today I installed a beta Windows Server 2008 onto a virtual machine on my Mac using VirtualBox.  After some trial and error, the following settings seem to have allowed it to work:&lt;br /&gt;&lt;br /&gt;System:&lt;br /&gt;OS Type: Windows 7 (64 bit)&lt;br /&gt;Base Memory: 500 MB&lt;br /&gt;Processors: 1&lt;br /&gt;VT-x/AMD-V: Enabled&lt;br /&gt;Nested Paging: Enabled&lt;br /&gt;&lt;br /&gt;Display:&lt;br /&gt;Video Memory: 12MB&lt;br /&gt;3D Acceleration: Enabled&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-4843927317933876464?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/4843927317933876464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=4843927317933876464' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/4843927317933876464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/4843927317933876464'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/08/installing-windows-server-2008-in.html' title='Installing Windows Server 2008 in VirtualBox'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-1601225423967869169</id><published>2009-08-20T07:30:00.000-07:00</published><updated>2009-08-20T07:33:55.761-07:00</updated><title type='text'>Blocking spam from Yahoo! Personals</title><content type='html'>I get approximately 10 messages a day from Yahoo! Personals, which pass through spamassassin because they're DKIM signed.  As far as I can tell, there's no way to opt out on Yahoo's end, so I had to resort to blocking every message with their telltale subject.  Here's the rule:&lt;br /&gt;&lt;br /&gt;header SUBJECT_YAHOO_PERSONALS  Subject =~ /Dating 101: Reviving Your Relationship/i&lt;br /&gt;score SUBJECT_YAHOO_PERSONALS   20.0&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-1601225423967869169?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/1601225423967869169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=1601225423967869169' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1601225423967869169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1601225423967869169'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/08/blocking-spam-from-yahoo-personals.html' title='Blocking spam from Yahoo! Personals'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-6722428492289416669</id><published>2009-06-25T14:20:00.000-07:00</published><updated>2009-06-25T14:51:25.835-07:00</updated><title type='text'>Debian Installation on Servers With Broadcom 5708/5709 NICs using the bnx2 driver</title><content type='html'>Installing Debian on a system with Broadcom network interfaces can be quite annoying because the firmware is no longer included.  If you load the firmware onto a usb disk as suggested, you run into other problems when using scsi drives resulting in a system which requires hacking menu.lst after install to boot.  This approach doesn't work if you're using iLO/DRAC/iDRAC to install as they only allow one remote media connection at a time.&lt;br /&gt;&lt;br /&gt;An easy workaround is to modify your install iso to contain the drivers.  Here's how:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download a newish Debian install iso.&lt;/li&gt;&lt;li&gt; Mount the install iso:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;mkdir cdrom&lt;/li&gt;&lt;li&gt;mount -o loop debian-testing-amd64-CD-1.iso cdrom&lt;/li&gt;&lt;/ol&gt;&lt;li&gt; Copy the files:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;mkdir isocopy&lt;/li&gt;&lt;li&gt;cp -av cdrom isocopy&lt;/li&gt;&lt;/ol&gt;&lt;li&gt; Download the appropriate firmware package for your installation, such as http://packages.debian.org/squeeze/all/firmware-bnx2/download&lt;/li&gt;&lt;li&gt; Extract the drivers and copy into your new iso:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;dpkg-deb -x firmware-bnx2_0.16_all.deb firmware&lt;/li&gt;&lt;li&gt;cp firmware/lib/firmware/* isocopy/cdrom&lt;/li&gt;&lt;/ol&gt;&lt;li&gt; Build a new iso:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;cd isocopy/cdrom&lt;/li&gt;&lt;li&gt;mkisofs -o ../modified-debian.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -R -V disks .&lt;/li&gt;&lt;/ol&gt;&lt;li&gt; Done, let's look at our new iso:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;cd ..&lt;/li&gt;&lt;li&gt;ls modified-debian.iso&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;&lt;br /&gt;You can now burn this iso to a CD or use it as virtual media.&lt;br /&gt;&lt;br /&gt;There's one final step, which is getting the OS to see the firmware drivers.&lt;br /&gt;&lt;br /&gt;Once booted to the new ISO, you need to immediately switch to another console and copy the files over before the installer looks for them:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;mkdir lib/firmware&lt;/li&gt;&lt;li&gt;cp /cdrom/*.fw lib/firmware&lt;/li&gt;&lt;/ol&gt;After that's done, the Debian installer should be able to autoload the bnx2 driver without any problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-6722428492289416669?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/6722428492289416669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=6722428492289416669' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/6722428492289416669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/6722428492289416669'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/06/debianbroadcom-driver-fix.html' title='Debian Installation on Servers With Broadcom 5708/5709 NICs using the bnx2 driver'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-1006995040396911495</id><published>2009-06-15T08:34:00.001-07:00</published><updated>2009-06-15T08:36:30.026-07:00</updated><title type='text'>php utf-8 chr() and ord() equivalents</title><content type='html'>As far as I can tell, PHP provides no built in methods of working with multi byte characters.&lt;br /&gt;&lt;br /&gt;Here is a simple function for turning an integer value into a character:&lt;br /&gt;&lt;br /&gt;function unichr($intval) {&lt;br /&gt;    return mb_convert_encoding(pack('n', $intval), 'UTF-8', 'UTF-16BE');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;A uniord() function can be found in the comments of the PHP manual:&lt;br /&gt;http://us.php.net/manual/en/function.ord.php&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-1006995040396911495?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/1006995040396911495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=1006995040396911495' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1006995040396911495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1006995040396911495'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/06/php-utf-8-chr-and-ord-equivalents.html' title='php utf-8 chr() and ord() equivalents'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-4120107976800017465</id><published>2009-05-25T15:15:00.000-07:00</published><updated>2009-07-30T11:09:29.464-07:00</updated><title type='text'>"This PDF document contains an Adobe XML form. Such files cannot be optimized."</title><content type='html'>To fix this problem:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Save the document in LiveCycle with PDF compatibility&lt;/li&gt;&lt;li&gt;Use the drop_xfa command with pdftk&lt;/li&gt;&lt;/ol&gt;This removes all of the LiveCycle data and makes the file compatible with Acrobat and other tools.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-4120107976800017465?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/4120107976800017465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=4120107976800017465' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/4120107976800017465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/4120107976800017465'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/05/this-pdf-document-contains-adobe-xml.html' title='&quot;This PDF document contains an Adobe XML form. Such files cannot be optimized.&quot;'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-1304717276834871908</id><published>2009-03-31T13:35:00.000-07:00</published><updated>2009-03-31T14:34:02.643-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='perc5i'/><category scheme='http://www.blogger.com/atom/ns#' term='megacli'/><category scheme='http://www.blogger.com/atom/ns#' term='dell'/><category scheme='http://www.blogger.com/atom/ns#' term='debian'/><title type='text'>Some useful MegaCli commands/quick debian howto</title><content type='html'>MegaCli and MegaCli64 are the LSI utility used for Dell Perc 5 and other adapters isn't well documented.  Here's some commands:&lt;br /&gt;&lt;br /&gt;MegaCli  -AdpEventLog -GetEvents -f logfile  -aALL &lt;br /&gt;What it does: Dump all events from the adapters event log to a file named logfile&lt;br /&gt;&lt;br /&gt;MegaCli -PDList -aAll | less&lt;br /&gt;What it does: Dump information about all Phsyical Disks (hence the PD), paged with less&lt;br /&gt;&lt;br /&gt;MegaCli -LDInfo -LAll -aAll | less&lt;br /&gt;What it does: Dump information about all Logical Disks on all adapters, paged with less&lt;br /&gt;&lt;br /&gt;MegaCli -LdPdInfo -aAll | less&lt;br /&gt;What it does: Dump information of all logical and physical disks on all known adapters&lt;br /&gt;&lt;br /&gt;Currently these can be obtained from LSI at http://www.lsi.com/DistributionSystem/AssetDocument/support/downloads/megaraid/miscellaneous/linux/1.01.39_Linux_Cli.zip&lt;br /&gt;&lt;br /&gt;You don't need to actually install the packages, both the MegaCli and MegaCli64 (64 bit build) are statically linked within.  In order to access them in a non RPM environment, you can extract the files with the following command:&lt;br /&gt;rpm2cpio MegaCli-1.01.39-0.i386.rpm   | cpio -idmv &lt;br /&gt;This will extra the MegaCli and MegaCli64 executables.&lt;br /&gt;Alternately, you can try to convert the rpm to a .deb via alien.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-1304717276834871908?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/1304717276834871908/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=1304717276834871908' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1304717276834871908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1304717276834871908'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/03/some-useful-megacli-commands.html' title='Some useful MegaCli commands/quick debian howto'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-3989616435983672934</id><published>2009-03-29T08:45:00.000-07:00</published><updated>2009-03-31T13:43:37.864-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msp430'/><title type='text'>Video of morse code blinking</title><content type='html'>I modified a bike blinker to blink in morse code.  Video of it in action is  &lt;br /&gt;&lt;a href="http://www.e-normous.com/P1090196.MOV"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Source is &lt;a href="http://ftzdomino.blogspot.com/2008/12/test.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-3989616435983672934?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/3989616435983672934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=3989616435983672934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/3989616435983672934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/3989616435983672934'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/03/video-of-morse-code-blinking.html' title='Video of morse code blinking'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-1308189365458765818</id><published>2009-03-10T09:21:00.000-07:00</published><updated>2009-03-31T13:43:48.456-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>One cause of "Fatal error: Exception thrown without a stack frame in Unknown on line 0"</title><content type='html'>"Fatal error: Exception thrown without a stack frame in Unknown on line 0"  can be quite hard to debug. &lt;br /&gt;&lt;br /&gt;php -r '&lt;br /&gt;register_shutdown_function("a");&lt;br /&gt;function a() {&lt;br /&gt;$b = new DateTime("02/40/2009"); &lt;br /&gt;} '&lt;br /&gt;&lt;br /&gt;Results in:&lt;br /&gt;Fatal error: Exception thrown without a stack frame in Unknown on line 0&lt;br /&gt;&lt;br /&gt;The problem is that PHP does not allow exceptions to be thrown in a shutdown function or anything called by a shutdown function.  Initializing a DateTime object with an invalid date throws an exception, leading issues similar to above.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-1308189365458765818?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/1308189365458765818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=1308189365458765818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1308189365458765818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1308189365458765818'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/03/one-cause-of-fatal-error-exception.html' title='One cause of &quot;Fatal error: Exception thrown without a stack frame in Unknown on line 0&quot;'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-5768408833662006221</id><published>2009-02-27T14:59:00.000-08:00</published><updated>2009-02-27T15:04:27.491-08:00</updated><title type='text'>Fun with PHP implicit scoping on static calls</title><content type='html'>&lt;span style="font-family: courier new;"&gt;class a {&lt;br /&gt;    public $a = "yay!";&lt;br /&gt;&lt;br /&gt;    func call_b()&lt;br /&gt;    {&lt;br /&gt;        b::b();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;class b {&lt;br /&gt;    function b()&lt;br /&gt;    {&lt;br /&gt;        echo $this-&gt;a;&lt;br /&gt;    }&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;$a= new a();&lt;br /&gt;$a-&gt;call_b();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Prints:&lt;br /&gt;yay!&lt;br /&gt;&lt;br /&gt;This is because if you statically call a method that is not declared as static in PHP, it inherits the class scope of the caller.  Note that if you had declared function b as a static method, you'd get a different behavior.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-5768408833662006221?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/5768408833662006221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=5768408833662006221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/5768408833662006221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/5768408833662006221'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/02/fun-with-php-implicit-scoping-on-static.html' title='Fun with PHP implicit scoping on static calls'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-621203651264847022</id><published>2009-02-25T20:47:00.000-08:00</published><updated>2009-02-25T20:50:48.414-08:00</updated><title type='text'>Apple Wireless Keyboard + Ubuntu Intrepid</title><content type='html'>I had some trouble pairing at first, but found this to work:&lt;div&gt;&lt;ol&gt;&lt;li&gt;Turn keyboard off&lt;/li&gt;&lt;li&gt;Open up the new bluetooth device wizard&lt;/li&gt;&lt;li&gt;Turn the on&lt;/li&gt;&lt;li&gt;Select the keyboard&lt;/li&gt;&lt;li&gt;Click Next&lt;/li&gt;&lt;li&gt;While the wizard is waiting, enter 0000 and Enter on the keyboard&lt;/li&gt;&lt;li&gt;Enter 0000 and Enter a second time.&lt;/li&gt;&lt;/ol&gt;The main issue seems to be that the OS doesn't prompt you at the correct time to enter the pairing password.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-621203651264847022?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/621203651264847022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=621203651264847022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/621203651264847022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/621203651264847022'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/02/apple-wireless-keyboard-ubuntu-intrepid.html' title='Apple Wireless Keyboard + Ubuntu Intrepid'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-6466544115716213578</id><published>2009-02-10T10:18:00.000-08:00</published><updated>2009-02-10T10:20:37.132-08:00</updated><title type='text'>Fun with implict type conversions in PHP</title><content type='html'>PHP requires extreme care while programming.  For example:&lt;br /&gt;'1,234' * 1 == 1&lt;br /&gt;0 == false&lt;br /&gt;false == ''&lt;br /&gt;0 == '0'&lt;br /&gt;false != '0'&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-6466544115716213578?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/6466544115716213578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=6466544115716213578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/6466544115716213578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/6466544115716213578'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2009/02/fun-with-implict-type-conversions-in.html' title='Fun with implict type conversions in PHP'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-1761084359353741812</id><published>2008-12-26T12:13:00.001-08:00</published><updated>2008-12-26T12:57:56.585-08:00</updated><title type='text'>Passive monitoring of ping times on incoming TCP connections</title><content type='html'>For those of hosting web applications, it is frequently convenient to have ping time information available for all incoming connections.  Most networks these days block icmp ping requests, making it impossible to actively ping users.  One workaround is to passively monitor events in the TCP connection which have approximately the same round trip time as a ping request.    Specifically, the time between a packet from a client with SYN and ACK flags set and the next packet received with an ACK flag set are monitored and reported. &lt;br /&gt;&lt;br /&gt;Below is a PHP script which uses tcpdump to monitor incoming connections on ports 80 and 443.  Due to the fact that packet sniffing is used, root access is required for execution.&lt;br /&gt;&lt;br /&gt;#!/usr/bin/php&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;   * This is a script which tracks the tcp handshake to attempt to passively monitor our client's ping times.&lt;br /&gt;   *&lt;br /&gt;   */&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;$ip_latency = array();&lt;br /&gt;&lt;br /&gt;$handle = popen('sudo tcpdump -n -tt "tcp[tcpflags] &amp;amp; (tcp-syn|tcp-ack) != 0 &amp;amp;&amp;amp; (port 80 or port 443)" 2&gt;/dev/null', 'r');&lt;br /&gt;&lt;br /&gt;while(! feof($handle)) {&lt;br /&gt;  $output = fgets($handle);&lt;br /&gt;&lt;br /&gt;  if (preg_match('/^([0-9.]+).* &gt; ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\.([0-9]+): S .* ack /', $output, $matches)) {&lt;br /&gt;      // it's a SYN+ACK&lt;br /&gt;      // record the timestamp and wait for the response&lt;br /&gt;      list($dummy, $timestamp, $remote_ip, $remote_port) = $matches;&lt;br /&gt;  &lt;br /&gt;      $ip_latency[$remote_ip.':'.$remote_port] = array('start' =&gt; $timestamp);&lt;br /&gt;&lt;br /&gt;      //      echo("SYNACK  $timestamp, $remote_ip, $remote_port\n");&lt;br /&gt;  } elseif (preg_match('/^([0-9.]+) IP ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)\.([0-9]+) &gt; .*: \. ack 1 /', $output, $matches)) {&lt;br /&gt;      // it's an ACK 1&lt;br /&gt;      list($dummy, $timestamp, $remote_ip, $remote_port) = $matches;&lt;br /&gt;  &lt;br /&gt;      if (isset($ip_latency[$remote_ip.':'.$remote_port]) &amp;amp;&amp;amp; ! isset($ip_latency[$remote_ip.':'.$remote_port]['end'])) {&lt;br /&gt;          $ip_latency[$remote_ip.':'.$remote_port]['end'] = $timestamp;&lt;br /&gt;&lt;br /&gt;          $latency = $timestamp - $ip_latency[$remote_ip.':'.$remote_port]['start'];&lt;br /&gt;          //          echo("ACK  $timestamp, $remote_ip, $remote_port\n");&lt;br /&gt;          printf("%s - %s : %2.8f\n", $timestamp, $remote_ip, $latency);&lt;br /&gt;          unset($ip_latency[$remote_ip.':'.$remote_port]);&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;      if (rand(0, 100) == 0) {&lt;br /&gt;          // clean up, clear out all entries older than 100s&lt;br /&gt;         &lt;br /&gt;          foreach($ip_latency as $key =&gt; $timing) {&lt;br /&gt;              if ($timestamp - $timing['start'] &gt; 100) {&lt;br /&gt;                  //                  echo("PURGE $key\n");&lt;br /&gt;                  unset($ip_latency[$key]);&lt;br /&gt;              }&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;  }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-1761084359353741812?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/1761084359353741812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=1761084359353741812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1761084359353741812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/1761084359353741812'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2008/12/passive-monitoring-of-ping-times-on.html' title='Passive monitoring of ping times on incoming TCP connections'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1320025328660813471.post-8376295177245821438</id><published>2008-12-07T11:27:00.000-08:00</published><updated>2008-12-07T11:52:17.245-08:00</updated><title type='text'>Morse code on the EZ-430/MSP430</title><content type='html'>&lt;div&gt;//******************************************************************************&lt;/div&gt;&lt;div&gt;// Morse code blinker program&lt;/div&gt;&lt;div&gt;// derived from a basic blinker app&lt;/div&gt;&lt;div&gt;//******************************************************************************&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#include "msp430.h"&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;const char* morse_table[] = { &lt;/div&gt;&lt;div&gt;  ".-" , // A&lt;/div&gt;&lt;div&gt;  "-...", // B&lt;/div&gt;&lt;div&gt;  "-.-.", // C&lt;/div&gt;&lt;div&gt;  "-..", // D&lt;/div&gt;&lt;div&gt;  ".", // E&lt;/div&gt;&lt;div&gt;  "..-.", // F&lt;/div&gt;&lt;div&gt;  "--." , // G&lt;/div&gt;&lt;div&gt;  "....", // H&lt;/div&gt;&lt;div&gt;  ".."  , // I&lt;/div&gt;&lt;div&gt;  ".---", // J&lt;/div&gt;&lt;div&gt;  ".-.-", // K&lt;/div&gt;&lt;div&gt;  ".-..", // L&lt;/div&gt;&lt;div&gt;  "--", // M&lt;/div&gt;&lt;div&gt;  "-.", // N&lt;/div&gt;&lt;div&gt;  "---", // O&lt;/div&gt;&lt;div&gt;  ".--.", // P&lt;/div&gt;&lt;div&gt;  "--.-", // Q&lt;/div&gt;&lt;div&gt;  ".-.", // R&lt;/div&gt;&lt;div&gt;  "...", // S&lt;/div&gt;&lt;div&gt;  "-", // T&lt;/div&gt;&lt;div&gt;  "..-", // U&lt;/div&gt;&lt;div&gt;  "...-", // V&lt;/div&gt;&lt;div&gt;  ".--", // W&lt;/div&gt;&lt;div&gt;  "-..-", // X&lt;/div&gt;&lt;div&gt;  "-.--", // Y&lt;/div&gt;&lt;div&gt;  "--.." // Z&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt;};&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt; * Low power mode sleep&lt;/div&gt;&lt;div&gt; *&lt;/div&gt;&lt;div&gt; */ &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;void sleep(int howlong)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;  int i;&lt;/div&gt;&lt;div&gt;    for(i=2*howlong;i&gt;0;i--) { LPM0; }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt; * Turn on pin 1&lt;/div&gt;&lt;div&gt; *&lt;/div&gt;&lt;div&gt; */&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;inline void led_on()&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;      P1OUT |= 0x01;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt; * Turn off pin 1&lt;/div&gt;&lt;div&gt; *&lt;/div&gt;&lt;div&gt; */&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;inline void led_off()&lt;br /&gt;&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;      P1OUT &amp;amp;= ~0x01;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;/**&lt;/div&gt;&lt;div&gt; * Blink a string in morse code&lt;/div&gt;&lt;div&gt; *&lt;/div&gt;&lt;div&gt; * Takes a string and blinks it&lt;/div&gt;&lt;div&gt; */&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;void blink_morse(const char *s)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;  int i,j, letter_index;&lt;/div&gt;&lt;div&gt;  const char *dots;&lt;/div&gt;&lt;div&gt;  for(i=0;s[i] != (char) 0; i++){&lt;/div&gt;&lt;div&gt;    letter_index = -1;&lt;/div&gt;&lt;div&gt;    if (s[i] &gt;= 'A' &amp;amp;&amp;amp; s[i] &lt;= 'Z')&lt;/div&gt;&lt;div&gt;      letter_index = (int) s[i] - (int) 'A';&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    if (s[i] &gt;= 'a' &amp;amp;&amp;amp; s[i] &lt;= 'z')&lt;/div&gt;&lt;div&gt;      letter_index = (int) s[i] - (int) 'a';&lt;/div&gt;&lt;div&gt;    &lt;/div&gt;&lt;div&gt;    if (letter_index != -1) {&lt;/div&gt;&lt;div&gt;      dots = morse_table[letter_index];&lt;/div&gt;&lt;div&gt;     for(j=0;dots[j] != (char) 0; j++) {&lt;/div&gt;&lt;div&gt;       switch(dots[j]) {&lt;/div&gt;&lt;div&gt;        case '.':&lt;/div&gt;&lt;div&gt;        led_on();&lt;/div&gt;&lt;div&gt;        sleep(1);&lt;/div&gt;&lt;div&gt;        led_off();&lt;/div&gt;&lt;div&gt;        break;&lt;/div&gt;&lt;div&gt;        &lt;/div&gt;&lt;div&gt;       case '-':&lt;/div&gt;&lt;div&gt;         led_on();&lt;/div&gt;&lt;div&gt;         sleep(3);&lt;/div&gt;&lt;div&gt;         led_off();&lt;/div&gt;&lt;div&gt;         break;&lt;/div&gt;&lt;div&gt;       }&lt;/div&gt;&lt;div&gt;      sleep(1);&lt;/div&gt;&lt;div&gt;     }&lt;/div&gt;&lt;div&gt;    } else {&lt;/div&gt;&lt;div&gt;      // not a regular character&lt;/div&gt;&lt;div&gt;      sleep(4); // medium gap when combined with short gap below&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;    led_off();&lt;/div&gt;&lt;div&gt;    sleep(3); // short gap&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;int main(void)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt;  WDTCTL = WDTPW + WDTHOLD;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt; // Set pin 1 for output&lt;/div&gt;&lt;div&gt;  P1DIR |= 0x01;&lt;/div&gt;&lt;div&gt;  &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;  CCTL0 = CCIE;&lt;/div&gt;&lt;div&gt;  // set CCR0 delay to 60,000 &lt;/div&gt;&lt;div&gt;  CCR0 = 60000;&lt;/div&gt;&lt;div&gt;  TACTL = TASSEL_2 + MC_1;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;  _BIS_SR(LPM0_bits + GIE);&lt;/div&gt;&lt;div&gt;  // start with the LED off&lt;/div&gt;&lt;div&gt;  led_off(); &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;  for(;;)&lt;/div&gt;&lt;div&gt;  {&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; blink_morse("This message is blinking in morse code");&lt;/div&gt;&lt;div&gt; blink_morse("You can fit a paragraph or two into even the smallest MSP430");&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;    sleep(10);&lt;/div&gt;&lt;div&gt;  }&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;#pragma vector=TIMERA0_VECTOR&lt;/div&gt;&lt;div&gt;__interrupt void Timer_A (void)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt; LPM0_EXIT; &lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1320025328660813471-8376295177245821438?l=ftzdomino.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://ftzdomino.blogspot.com/feeds/8376295177245821438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1320025328660813471&amp;postID=8376295177245821438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/8376295177245821438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1320025328660813471/posts/default/8376295177245821438'/><link rel='alternate' type='text/html' href='http://ftzdomino.blogspot.com/2008/12/test.html' title='Morse code on the EZ-430/MSP430'/><author><name>J Snell</name><uri>http://www.blogger.com/profile/02448203483283550325</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
