tag:blogger.com,1999:blog-19124326203303576702024-02-19T01:21:31.749-06:00Matthew LenzMatthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-1912432620330357670.post-25045425791523439912016-01-25T09:05:00.001-06:002016-08-29T13:59:57.076-05:00SOAP/WSDL on Perl, Ruby, PHP or Python (anything but .NET/Java)SOAP was designed to provide cross platform RPC but the reality is that the only usable implementations of the spec are on .NET and Java. Yes there are several available for other programming languages but they are incomplete or broken (they may or may not work). Want to know what ALWAYS works? Read on.<br />
<div>
<br /></div>
<div>
My recommendation is to avoid them completely and download <a href="https://www.soapui.org/" target="_blank">SoapUI</a> (which is written in Java). This desktop software will allow you to create a new project using the WSDL (file or URL) and view and manually create requests against a service. You can see the raw data exchange (HINT: There can be additional required HTTP headers you need to pass. SOAPAction is one that is almost ALWAYS used) and then using whatever language you want create a web client that POSTs the XML (templated so you can change various parameters) and then parse the resulting XML response to get the data you want. Every programming language has a decent XML parser so that shouldn't be a problem (although sometimes you have "massage" the resulting XML).<br />
<div>
<br /></div>
<div>
Here is a simple example of a client in PHP:</div>
</div>
<div>
<br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $soap_url = "https://blahblah.com:1234/Service";</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $soap_act = '"/SomeCall"'; // Use SoapUI raw view of request to find this</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $soap_xml = <<<ENDOFFILE</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> <soapenv .......... </soapenv ...............</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> ENDOFFILE;</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $resp = \Httpful\Request::post($soap_url)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> ->body($soap_xml)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> ->sends('text/xml')</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> ->addHeader('SOAPAction', $soap_act)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> ->timeoutIn(10)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> ->send();</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> // There are ways to make the PHP XML parser handle namespaces but usually</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> // we don't</span><span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> need them so make them simple XML elements instead</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> // (eg. s_Envelope)</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $xml_str = str_replace('<?xml version="1.0" encoding="UTF-8"?>', '',</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $resp->body);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $xml_str = preg_replace("/(<\/?)(\w+):([^>]*>)/", "$1$2_$3", $xml_str);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $xml_str = preg_replace("/ \w+(:\w+)?=\"[^\"]*\"/", "", $xml_str);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $xml = new \SimpleXMLElement($xml_str);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $body = $xml->xpath('//s_Envelope'); // Can use this to narrow it down</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> $array = json_decode(json_encode((array)$body), TRUE);</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> // Now you can access the data using $array['key_name'][1] etc.. etc..</span><br />
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace; font-size: x-small;"> print_r($array);</span><br />
<br />
Good luck and hopefully this will save you some time! :)</div>
</div>
Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-24821924752442269162015-08-03T22:29:00.000-05:002015-08-03T22:31:46.407-05:00How to run a cronjob on the last day of the month<div style="background-color: white; color: #111111; font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; font-size: 14px; line-height: 24px; margin-bottom: 24px; padding: 0px; word-wrap: break-word;">
</div>
You may have to escape the % sign for direct crontab entry depending on your cron software. The example runs on the first minute of the last day of the month and starts trying for last day on the 28th (to deal with Feb).<br /><br />
<div line-height: 24px; margin-bottom: 24px; padding: 0px; word-wrap: break-word;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">0 0 28,29,30,31 * * [ $(date +\%d -d tomorrow) = “01” ] && command_you_want_to_run</span></div>
Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-63964302384804259662014-08-22T10:21:00.000-05:002014-08-22T10:21:06.107-05:00mysqldump warning skipping mysql.event table dataIf you don't want to give your "backup" user Super permissions and you don't use events you'll be stuck with an annoying warning:<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.</span></div>
</div>
<div>
<br /></div>
<div>
Every time you run a scheduled backup of your mysql database. You still want those cronjob emails with any database backup errors but you don't want that one. This might help you:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: Courier New, Courier, monospace;">mysqldump --routines -u$USER -p$PASS -h$HOST -r$DIR/$FILE $DB 2>&1 | grep -v 'Skipping the data of table mysql.event' 1>&2</span></div>
</div>
<div>
<br /></div>
<div>
What it does is redirects all errors from mysqldump to STDIN. It then greps out the event error and redirects any other errors back to STDERR.</div>
<div>
<br /></div>
<div>
The key is that you <b>MUST use the -r option</b> (write to a file directly to a file rather than STDOUT) <b>with mysqldump</b>. If you have other warnings you don't want to see you can use:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">... | grep -vE '(warning 1 substring|warning 2 substring)' 1>&2</span></div>
<div>
<br /></div>
<div>
Another option might be to use <a href="http://habilis.net/cronic/" target="_blank">Cronic</a>. Good luck!</div>
Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-19976176613982590312013-02-27T07:47:00.000-06:002013-02-27T07:47:45.806-06:00Windows device manager / colorspace correction refreshingIf you are experiencing constant refreshing of your device manager or color correction screens in Windows 7 or 8 you will eventually do a search and find lots of information about loose device connections, bad drivers or other types of issues. After several days of uninstalling drivers and disconnecting various devices in my system I stumbled upon the root of the problem. Windows identifies some remote network services (multimedia servers) as "devices." These devices do not show up in the device manager. My issue was that windows automatically discovers these "multimedia streaming services" on your network (other PCs) and when they enter and leave the network (who knows why) they are dropped and added to your devices repeatedly. They might show up under "Plug and Play" devices on Windows 7 but on Windows 8 they show up on a "Devices" screen. If you remove them (right click, "Remove Device") the problem goes away. This might not solve your problem but I wanted to put this here for the search engines. Good luck.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com2tag:blogger.com,1999:blog-1912432620330357670.post-45052087258288519252012-10-10T08:11:00.001-05:002012-10-10T08:11:19.801-05:00Logging STDOUT, STDERR and outputting STDERRYou may find yourself with the need to log both STDOUT and STDERR but also display STDERR. A perfect example is when running cronjobs on Linux. As we all know getting too many notifications will result in the important notifications being lost in the noise. The solution is generally only to show errors. The problem is that those errors might lose context without various debug information. This is where I/O redirection becomes handy. Because we only want to receive emails (cron automatically sends all STD output as an email to the job owner) for errors we can use the following:
<br />
<br />
<command> 2>&1 >>blah.log | tee -a blah.log<br />
<br />
What this does is runs <command> and copies STDERR (file descriptor 2) to STDOUT (file descriptor 1, 2>&1) and then redirects (>>) STDOUT (file descriptor 1) to blah.log. Because of the order STDERR is not being appended to the blah.log. That happens in the pipe to the tee command. The tee command takes input from STDIN, adds it to a file and then echos that output to STDOUT. The net result is that we now have STDERR from <command> being emailed to us should we use that series of commands in a cronjob.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-40015021912733050142012-04-13T11:17:00.003-05:002016-05-26T10:28:21.806-05:00BlueHarbor Auto Refinance RipoffDo not waste your time trying to refinance through BlueHarbor Auto. You'll give them all your information and they will secure you a good rate and then tell you about all the "fees" involved in completing the loan. $199 financing fee. Ok, everyone charges those. $87.50 re-titling fee. HUH? Oh and btw, you have to sign up for our extended service contract on the vehicle. At this point I told them I was no longer interested in their services. I found this company on Bankrate.com. I really do not think that Bankrate knows that this company is trying to rip people off to save a few points on a loan. I'm going to be contacting them. If they don't do anything about it I'd say it's safe to assume that Bankrate has gone down the tubes.<br />
<br />
EDIT:<br />
<br />
I guess one good thing came out of this situation. I discovered <a href="http://www.penfed.org/" target="_blank">Pentagon Federal Credit Union</a>. They had better rates than the above mentioned and their customer service is incredibly helpful and courteous. Also, the entire application for membership ($5) and the loan (free) are handled online. After a couple days my loan (refinance) was approved and I had the pay-off check for the current lender.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com2tag:blogger.com,1999:blog-1912432620330357670.post-35111401397429443592012-04-05T09:56:00.002-05:002016-05-11T07:52:12.664-05:00AR.Drone 2.0I received my AR.Drone 2.0 the other day and had a chance to play around with it a bit. The biggest problem I see with the device is the horrible battery life and they have not released AR.Free Flight 2.0 for Android devices yet. AR.Free Flight 1.9 does work fine with the AR.Drone 2.0 but there is no video support and FF 1.9 doesn't support the 2.0 feature of using the "Absolute Control" mode. If you use the accelerometer with 1.9 you must keep the camera pointing forward to have the drone respond intuitively. For now I'm just using it in 2 stick mode. Here are some pictures of the un-boxing.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaQjSdzWv0wkvKnWHjctvjVPs_9GvAY_yDTA_iCRCxnx36jGDMLt_xOiL67biKnxmBPP-3uerTKmz7SMWh61JWUTEBpWCCxz1GIplc12b4NZWQAbbI1IIeqBHl0cfzWS9LAO0bDMvowNz1/s1600/IMG_20120403_200652.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgaQjSdzWv0wkvKnWHjctvjVPs_9GvAY_yDTA_iCRCxnx36jGDMLt_xOiL67biKnxmBPP-3uerTKmz7SMWh61JWUTEBpWCCxz1GIplc12b4NZWQAbbI1IIeqBHl0cfzWS9LAO0bDMvowNz1/s320/IMG_20120403_200652.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHV8w0WnQW0MNQUJox7WAD-Q0YNiotcUqP_nIcuiEZQqZemuPdk6dO0W8KBKklTOw5U_vA4fJUYpxnFRrRqBbIylOKKUAdgoQ9pZHMj8zU_0SaNAeS29BXpaGo7UyLh5cBbq0nONAp22cR/s1600/IMG_20120403_200448.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHV8w0WnQW0MNQUJox7WAD-Q0YNiotcUqP_nIcuiEZQqZemuPdk6dO0W8KBKklTOw5U_vA4fJUYpxnFRrRqBbIylOKKUAdgoQ9pZHMj8zU_0SaNAeS29BXpaGo7UyLh5cBbq0nONAp22cR/s320/IMG_20120403_200448.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsZtWhvL_U34Uj7qaegc5A0tgdLXach9wToSy35BvuTbJjNAlWAxfuYtrh9C7OfGQk4Xp1BQo4ky99vJaLd3-fipyWOJoFKYTFTlEMYsBNQrjWUWc1Sg-isw_qjGaNsSpM_1aPo1dnkRG4/s1600/IMG_20120403_200238.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjsZtWhvL_U34Uj7qaegc5A0tgdLXach9wToSy35BvuTbJjNAlWAxfuYtrh9C7OfGQk4Xp1BQo4ky99vJaLd3-fipyWOJoFKYTFTlEMYsBNQrjWUWc1Sg-isw_qjGaNsSpM_1aPo1dnkRG4/s320/IMG_20120403_200238.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsBhfNSWhYaoh1_lsVLnRoVMhV_YPULz4w8X9h1yaTw6XokVpKGLgDSl7JTGAiy51-F_wLOkGOOtWB2ezs3RdqE0iAI5oMayndmHyaHDmoxDTyhvC31b4YyXcl7vusdFUtez9hp6FlRhpl/s1600/IMG_20120403_200111.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsBhfNSWhYaoh1_lsVLnRoVMhV_YPULz4w8X9h1yaTw6XokVpKGLgDSl7JTGAiy51-F_wLOkGOOtWB2ezs3RdqE0iAI5oMayndmHyaHDmoxDTyhvC31b4YyXcl7vusdFUtez9hp6FlRhpl/s320/IMG_20120403_200111.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdL9qS_4AUvUropGMRq2h17dXckDhbCCzbyzO2o5WNLlsJCZgx1CreA7Xzc724pFahtVJCljl-ZJ6tvUCVDg7sXf9bWx6tqVtvcCshOOLOfChgJ0AJ9dceqEfKlv8CPk9yCXVeqBvAa9Bv/s1600/IMG_20120403_195934.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdL9qS_4AUvUropGMRq2h17dXckDhbCCzbyzO2o5WNLlsJCZgx1CreA7Xzc724pFahtVJCljl-ZJ6tvUCVDg7sXf9bWx6tqVtvcCshOOLOfChgJ0AJ9dceqEfKlv8CPk9yCXVeqBvAa9Bv/s320/IMG_20120403_195934.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGLVug5LWLwGzzB2koz06ocqBsPlY_FavfptsJnc3VFPHNFsuGNe_PHMt5HjT7cX6WqWsYByATGXVvrbPwvlOdDxwg-dhX6BPS1ua07NLh1KpgIp20wKt8fJ9LmIcj1KieQq2NEFYz9mqa/s1600/IMG_20120403_195835.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGLVug5LWLwGzzB2koz06ocqBsPlY_FavfptsJnc3VFPHNFsuGNe_PHMt5HjT7cX6WqWsYByATGXVvrbPwvlOdDxwg-dhX6BPS1ua07NLh1KpgIp20wKt8fJ9LmIcj1KieQq2NEFYz9mqa/s320/IMG_20120403_195835.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYZWZuBz0S9jA7sA0nh_u6WQabsx3z59zNlI12CGuuAYkHy1B1KoKRjwhQrU4Op13_YJvjOHim1kPJFFWOuUG-WqbcHZe8mgjbsLLW-hF7gh1gynIrxyNxx2lOwvSwK6tGuRFAQcef_74b/s1600/IMG_20120403_200351.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYZWZuBz0S9jA7sA0nh_u6WQabsx3z59zNlI12CGuuAYkHy1B1KoKRjwhQrU4Op13_YJvjOHim1kPJFFWOuUG-WqbcHZe8mgjbsLLW-hF7gh1gynIrxyNxx2lOwvSwK6tGuRFAQcef_74b/s320/IMG_20120403_200351.jpg" width="320" /></a></div>
<br />
Here is a video of my second flight with the device. It isn't very long because I'd already played with it a bit and the battery was nearly dead:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/MBIq0TS-Xlg?feature=player_embedded' frameborder='0'></iframe></div>
<br />
If you have any questions let me know.<br />
<br />
Additional close up photos of the battery:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguh-l4TGA5t8aEE1uGkHcES-VEBH7uIZAyGlDUfTe-RFaJMBNy42B6q2N5LbXlyrtsDh9LsFL0bkXCwO_ZrC8HVgz6YdPBioINfUHJDOAtJdseyacDC5nBb39DB4jmoh8JQbRKCWgj0xM4/s1600/IMG_20120405_180706.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguh-l4TGA5t8aEE1uGkHcES-VEBH7uIZAyGlDUfTe-RFaJMBNy42B6q2N5LbXlyrtsDh9LsFL0bkXCwO_ZrC8HVgz6YdPBioINfUHJDOAtJdseyacDC5nBb39DB4jmoh8JQbRKCWgj0xM4/s320/IMG_20120405_180706.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimt5KgACpJaJiCkBcPfffyIVtv6Uobgm7o1chyphenhyphenvaXc5dq5NoB5-S-6Zemgpee75vyAaPWG9GEc-YRX39fLZIoQRqs7TzvPILTvSG0Lz3_YFB0lE1T41TgWmIzfpiCfwlvRYNmKZao35g-i/s1600/IMG_20120405_180725.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimt5KgACpJaJiCkBcPfffyIVtv6Uobgm7o1chyphenhyphenvaXc5dq5NoB5-S-6Zemgpee75vyAaPWG9GEc-YRX39fLZIoQRqs7TzvPILTvSG0Lz3_YFB0lE1T41TgWmIzfpiCfwlvRYNmKZao35g-i/s320/IMG_20120405_180725.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwI2i9Qz6Th7EBZWVrImh8A5P_zhKI9Z-o8H1EIKQHZUHg8uTyIcAD8cMRd5i5l034BanAd8NBv0aQOJ5LCbhkcVsxBf9kXdq3vouecmaJkjZD0Ix-7485DxdNvhyphenhyphenCi1JiLXnnFI-lbqL/s1600/IMG_20120405_180626.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWwI2i9Qz6Th7EBZWVrImh8A5P_zhKI9Z-o8H1EIKQHZUHg8uTyIcAD8cMRd5i5l034BanAd8NBv0aQOJ5LCbhkcVsxBf9kXdq3vouecmaJkjZD0Ix-7485DxdNvhyphenhyphenCi1JiLXnnFI-lbqL/s320/IMG_20120405_180626.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgho0Q6ZBkZKHn6O-rjfPTfXwZkUb6Fh95wPgOYev4lvTMyaXnJ__GTaYBZ1FahV0SKcz2Mu4DFwAW0AJpMxWwb8nhVh4PDm55-bCxlowDpjwsrFSeMbBfGDbHDOHjCqyV80ks9Roer87Hi/s1600/IMG_20120405_180613.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgho0Q6ZBkZKHn6O-rjfPTfXwZkUb6Fh95wPgOYev4lvTMyaXnJ__GTaYBZ1FahV0SKcz2Mu4DFwAW0AJpMxWwb8nhVh4PDm55-bCxlowDpjwsrFSeMbBfGDbHDOHjCqyV80ks9Roer87Hi/s320/IMG_20120405_180613.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn_tMPEXmgkZ2_zpjin-w9BHnc91_d3ieggZ9vI1YA2gM1RxptliV0atZ7o3JLTVq0FDyhBhoiS6UkTyIIRBDaJqj814LGddzjyiqWeYUXrs-t3h8w6Uuibp6ZLd0lt75FNbReyB6aZqCj/s1600/IMG_20120405_180548.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn_tMPEXmgkZ2_zpjin-w9BHnc91_d3ieggZ9vI1YA2gM1RxptliV0atZ7o3JLTVq0FDyhBhoiS6UkTyIIRBDaJqj814LGddzjyiqWeYUXrs-t3h8w6Uuibp6ZLd0lt75FNbReyB6aZqCj/s320/IMG_20120405_180548.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUY9l24tBPDd-0Fp7hyphenhyphencPSc8Ch2djzqkePZtDwXON7w0Xv53qpIj67k7k3QHW9FWxqRYR2jhBa_3-Lf4G7RWKE4rOFKgbUu2wvUdKS2a3sLia6gJN4kdePRu6Jy22t9Y_AyBGs9wbNr4ln/s1600/IMG_20120403_200630.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUY9l24tBPDd-0Fp7hyphenhyphencPSc8Ch2djzqkePZtDwXON7w0Xv53qpIj67k7k3QHW9FWxqRYR2jhBa_3-Lf4G7RWKE4rOFKgbUu2wvUdKS2a3sLia6gJN4kdePRu6Jy22t9Y_AyBGs9wbNr4ln/s320/IMG_20120403_200630.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDjk0FLgx1mDnO15NYDzMuEpyd49Uo7ohhWdzS_OOW5oQrN8YV7zPAL2ZLNyfvh-c9FntVe5iEBmAl5kdmfjcrcR1aE1_1tFcJGxlRBrw-qABQHeO1UXEzKmGRXocoyLMaQzpQeq91uCea/s1600/IMG_20120405_180515.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDjk0FLgx1mDnO15NYDzMuEpyd49Uo7ohhWdzS_OOW5oQrN8YV7zPAL2ZLNyfvh-c9FntVe5iEBmAl5kdmfjcrcR1aE1_1tFcJGxlRBrw-qABQHeO1UXEzKmGRXocoyLMaQzpQeq91uCea/s320/IMG_20120405_180515.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Added another short video of flying the AR.Drone 2.0 with AR. Free Flight 2.0 on a borrowed iPhone. I used Absolute Control which is awesome.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/UVRuTaNW954?feature=player_embedded' frameborder='0'></iframe></div>
<br />Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com7tag:blogger.com,1999:blog-1912432620330357670.post-13699536368247415012012-01-25T01:27:00.000-06:002013-02-27T07:52:19.185-06:00Six hours spent trying to install Linux Mint 12.I've been using Linux on the desktop for about 18 years now and needless to say I know my way around pretty well. I've been using Ubuntu 10.04 LTS for the last year or so and recently upgraded to two new drives on my work system. Rather than reinstalling 10.04 LTS I decided to give Linux Mint 12 a try. The catch is that I wanted to do software RAID 1 for the boot partition and RAID 0 for the system. Ubuntu allows software RAID configuration using its alternate installation media and Linux Mint (although initially based on Ubuntu) doesn't provide an alternate install. I found a <a href="http://forums.linuxmint.com/viewtopic.php?f=46&t=90878&start=0" target="_blank">guide on the Linux Mint forums</a> which can be followed to manually configure software RAID during installation. Linux Mint's immaturity as an OS reared it's ugly head when I neared the end of the install and the installer wouldn't let me proceed. Long story short I ended up installing Ubuntu 11.10 using the alternate install media and had a software RAID system up and running in about 20 minutes.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com2tag:blogger.com,1999:blog-1912432620330357670.post-44616080727593111442011-08-26T06:22:00.000-05:002013-02-27T07:52:53.086-06:00Mint is now just a marketing gimmick.When <a href="mint.com">Mint.com</a> first launched it was a breath of fresh air. It allowed you to easily track your spending by correctly aggregating all your financial data into a central repository. Lets fast forward to now that Intuit bought the company. The data from ING Direct has become nearly worthless because all Paper bill payments get changed to a description of 'Payer' and a category of 'Printing Services'. All Electronic bill payments get changed to 'Electronic Payment Systems' with a category of 'Business Services'. I have to go in manually and fix these for every transaction that is imported. There is no way to fix this problem via the Mint "rules" interface.<br/><br/>Who cares about your product actually working when it's free to use and you make tons of money off referrals getting people to switch to a new credit card with lower interest rates, right?<br/><br/>Way to blow it Intuit. You took something that was special and turned it into something sub-par.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-79571090533145667272011-08-05T05:43:00.000-05:002012-03-08T07:25:31.504-06:00Running Virtualbox as a Windows ServiceI recently found a great tool which handles running Oracle's Virtual Box VM software as a Windows service. It is called VBoxVmService and only requires a couple simple changes to an .ini file and running a single command as administrator. <a href="http://vboxvmservice.sourceforge.net/" target="_new">Check it out.</a>Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-11089067957283008752011-06-10T07:15:00.000-05:002012-03-08T07:25:31.342-06:00Clear mobile broadband glaring omissionI recently bought an <a href="http://www.asus.com/Eee/Eee_Pad/Eee_Pad_Transformer_TF101/">ASUS Eee Pad Transformer 32GB</a> and was looking to add a mobile hot-spot as a back-up Internet connection at my house and for access during road trips. The plan was to ditch my back-up DSL connection and just go with an inexpensive unlimited 4G/3G mobile broadband plan like Clear provides. <a href="http://clear.com">Clear</a> seems to have the best prices hands down for mobile broadband but they really dropped the ball by only offering a dongle solution for their 4G/3G service. If you want to use a hot-spot device your only option is their 4G service. That is going to leave you high and dry unless you are in a major city. I'll have to wait until Clear sees the light or a <a href="http://www.broadbandexpert.com/mobile-broadband/mobile-hotspot/">competitor</a> fills the void they have left open.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-38223849300312432011-05-20T02:35:00.000-05:002012-03-08T07:25:31.414-06:00Thunderbird 3 Compact/Expunge Current Folder ShortcutUsing Keyconfig for creating shortcuts in Mozilla products has been around for a long time. With Thunderbird 3 I struggled with figuring out how to create a shortcut to compact/expunge the current folder. The examples that show up in a Google search tend to be the solution for compacting all the folders. This tends to be time consuming if you have even a moderate amount of email. The solution was provided here:<br/><br/><a target="_new" href="http://blog.gerundinganimal.com/2009/12/adding-compact-folder-button-to.html">Adding a Compact Folder Button to Thunderbird 3.0</a><br/><br/>If you are familiar with Keyconfig the short answer, without visiting the site, is the following key command:<br/><br/><code>goDoCommand("button_compact")</code><br/><br/>This will compact and expunge the current folder.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-73249694188508655692011-04-08T02:45:00.000-05:002012-03-08T07:25:31.491-06:00Dell Does Not CareSomeone recently pointed out a twitter account that Dell is using to address customer service issues for their customers; it's called <a href="http://twitter.com/dellcares">@DellCares</a>. Oh the irony.<br/><br/>On March 17th 2011 I ordered a new laptop from Dell called the XPS 17 +3D. I've ordered dozens of systems (home and enterprise) from Dell over the years and after completing the order I noticed that the lead time to build and deliver the laptop was nearly a MONTH (4/12/2011)! This felt excessive to me so I checked out the <a href="http://forum.notebookreview.com/dell-xps-studio-xps/">Dell XPS forums at Notebook Review</a>. I found a <a href="http://forum.notebookreview.com/dell-xps-studio-xps/564795-dell-xps-l702x-order-progress-u-s.html">couple</a> of <a href="http://forum.notebookreview.com/dell-xps-studio-xps/560395-dell-xps-17-l702x-order-progress.html">threads</a> that really opened my eyes as to how incompetent Dell has become.<br/><br/>One of the first things I saw that infuriated me was that people who ordered identical spec systems (except for the drive size) in the U.S., days after me, had already received their orders. @DellCares and Dell Customer Service had no answer as to why this could/would occur. Every email or voice mail I received from Dell was always the same answer; "Your order is In Production with an estimated delivery date of April 12th." It didn't matter what question I asked it was always the same robotic sounding script being read to me over and over.<br/><br/>My order delay is minor compared to some who have had their orders delayed over a month. Every call to Dell Customer Service people hear a different excuse about delayed parts. The website requires that you order $150 nVidia 3D glasses which can be had on Amazon for $100. Some, who have been lucky enough to receive the system, have been waiting over a month for their 3D glasses to arrive. One of the newest and most disturbing exuses from Dell Customer Service is that there is a bug in the motherboard that prevents the use of 16GB of memory in the system. Many people, including myself, specifically bought this system with the intention of upgrading to 16GB of memory upon receipt of the system. Dell's own 16GB upgrade option being $100 more than buying/installing the memory ones self. More disturbing is that Dell has removed the 16GB option from the order pages for the XPS 17 3D. Here I sit waiting for a system that may have to be returned anyway because of false advertising.<br/><br/>My advice to you if you ever plan on buying any Dell equipment? <a href="http://forum.notebookreview.com/dell-xps-studio-xps/">Read</a> <a href="http://forum.notebookreview.com/dell-xps-studio-xps/560395-dell-xps-17-l702x-order-progress.html">the horror</a> <a href="http://forum.notebookreview.com/dell-xps-studio-xps/564795-dell-xps-l702x-order-progress-u-s.html">stories</a> people have had ordering with Dell since the first of the year (2011). More and more threads are started every day on the forums and if you read them, like me, you'll get the immediate impression that Dell Does Not Care.<br/><br/><strong>EDIT 1</strong>: I contacted Dell about the fact that the exact same spec systems were now $100 less after coupon promotions. They would not budge on reducing the price even though my system is no were near being completed. The best I could do was get an upgrade to Next Business Day shipping which advanced my EDD to 4/8/2011. This was a ~$40 option since I had upgraded to 3-5 Business Day shipping when first purchasing the system. This original upgrade wasn't removed when adding the NBD. My other option was cancelling and reordering (can you imagine?). <br/><br/><strong>EDIT 2</strong>: I got a response back from @DellCares on 4/4/2011. Apparently my 500GB Hard Drive is on back order. That is apparently a perfectly acceptable reason for delaying a delivery indefinitely. Here is an idea Dell; call the customer and ask if they want to upgrade to a 640GB drive. Hell, offer to throw it in for free. It probably costs you like $5 more for that drive and you know it.<br/><br/><strong>EDIT 3</strong>: I received my 3D glasses today (4/7/2011). Useless.<br/><br/><strong>EDIT 4</strong>: Received a message from Dell today (4/8/2011) claiming that my laptop delivery has been delayed and now has an Estimated Delivery Date of 4/15/2011. So right up until the day it was supposed to be in my hands they had no idea it wasn't going to make it on time? You've got to be kidding me.<br/><br/><strong>EDIT 5</strong>: I got a call from Dell Corporate (4/8/2011) after emailing michael@dell.com and michael_dell@dell.com and sending them a link to my blog post. It's going to take them until Tuesday to figure out why my order isn't on time.<br/><br/><strong>EDIT 6</strong>: Dell followed up again on the order (4/12/2011). They still don't have any 500GB drives and that is why my order is delayed. If you read my original post you'll see that I mentioned there were people who ordered 3-6 days after me with the exact same specs EXCEPT opting for the 640GB drive. So what this tells me is that my laptop has been delayed weeks just because of the drive.<br/><br/><strong>EDIT 7</strong>: I got another call today (4/13/2011) with a follow up about the unavailable drive. Dell has recommended that I cancel and reorder with the 640GB drive. Well they got it half right. Dell is contacting me tomorrow but I'm just going to cancel all together and get a return shipping label for the glasses. The funny thing is that if you order the 640GB drive on the website as of right now it states that it may delay your order. It's the ONLY standard single drive available for order now. Ultimately the reason I'm not going to order is because they have removed the 16GB option. There were people on forums who said that CSRs had been telling them that Dell had discovered a bug that was causing BSODs when the system had 16GB installed. If the system doesn't support 16GB of memory I don't want it.<br/><br/>More and more people on the forums have been cancelling their orders. Time for me to do the same. <strong>I don't see how I could possibly purchase or recommend a Dell product ever again.</strong><br/><br/><strong>EDIT 8</strong>: I received the credit for the 3D glasses today (4/27/2011). Dell customer service still continues to call me (because the right hand doesn't know what the left hand is doing) but I just let it go to voice mail. I have no desire to speak with these incompetents any longer. I'm going to wait until next month and go with an ASUS G74 once they are released. My initial reasoning for not going with an ASUS was because they do not offer on-site support. Issues require mailing the laptop to a service center. This hasn't changed but anything has to be better than dealing with Dell ever again. Also, don't be fooled by the comment from Dell on this blog post. That person did nothing to help resolve this issue other than repeat a bunch of information I'd already been given by all the other CSRs who contacted me. <strong>Dell Does Not Care.</strong>Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com1tag:blogger.com,1999:blog-1912432620330357670.post-69768829372515911432011-04-07T04:55:00.000-05:002012-03-08T07:25:31.483-06:00Checking URL HTTP response codes from the command line.I was recently looking for a good way to check a specific url for response codes using curl. I came across the following <a href="http://beerpla.net/2010/06/10/how-to-display-just-the-http-response-code-in-cli-curl/">blog post</a>. Kudos to the author for posting the solution.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-60896340850996956442011-02-07T04:51:00.000-06:002012-03-08T07:25:31.469-06:00FOLLOW UP AGAIN: Kenmore / Whirlpool dryer won’t stay running or heat?It's been over a year and a half since the last <a href="http://www.nocturnal.org/blog/2009/07/18/follow-up-kenmore-whirlpool-dryer-won%e2%80%99t-stay-running/">issue</a> we've had with this <a href="http://www.nocturnal.org/blog/2009/07/02/kenmore-whirlpool-dryer-wont-stay-running/">hunk of junk dryer</a>. This time it popped a circuit and fried the main board. I ended up having to get the extended warranty (you can get a $200 1 year extended warranty for any sears appliance that is less than 10 years old) to have it be replaced (I didn't know what the exact issue was and I wasn't going to pay to replace part after part until it was fixed). AVOID THESE PRODUCTS.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-88676463245190998462011-02-07T04:13:00.000-06:002012-03-08T07:25:31.532-06:00Converting from mbox to Maildir with Postfix and Dovecot on DebianThis is the procedure I used for converting from mbox to Maildir with Postfix and Dovecot running Debain 5.x. This assumes that you have individual system accounts for each mail user and that the mbox files are currently in /var/spool/mail/USER and /home/USER/mail/FOLDERS.<br/><br/>All the following commands/edits will need to be done as root:<br/><br/>Install mb2md:<br/><br/><code>aptitude install mb2md</code><br/><br/>Stop the mail servers:<br/><br/><code>/etc/init.d/postfix stop<br/>/etc/init.d/dovecot stop</code><br/><br/>Edt the /etc/posfix/main.cf:<br/><br/><code>home_mailbox = Maildir/</code><br/><br/>Edit the /etc/procmailrc (if you are using procmail for local delivery/filtering):<br/><br/><code>ORGMAIL=$HOME/Maildir/<br/>MAILDIR=$ORGMAIL<br/>DEFAULT=$ORGMAIL</code><br/><br/>Edit the /etc/dovecot/dovecot.conf:<br/><br/><code>mail_location = maildir:~/Maildir</code><br/><br/>At this point I'd backup the user accounts just in case there is an issue.<br/><br/>Create a bash script with the following and execute it:<br/><br/><code>for i in $( ls -1 /home ); do<br/> su -l -c 'mb2md -m' $i; ## convert /var/spool/mail/USER<br/> su -l -c 'mb2md -s mail -R' $i;<br/>done</code><br/><br/>At this point you will need to restart the mail servers:<br/><br/><code>/etc/init.d/dovecot start<br/>/etc/init.d/postfix start</code>Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-28612485459971961692010-10-08T08:10:00.000-05:002012-03-08T07:25:31.394-06:00HTML::Template CACHE LOAD, HIT and MISSIf you are sure you have mod_perl running and are using cache_debug to diagnose issues with repeated cache LOAD and cache MISS with HTML::Template then the following information might be useful.<br/><br/>Digging through the HTML::Template source I discovered the following:<br/><br/><code>my @key = ($options->{filepath});<br/>push(@key, @{$options->{path}});<br/>push(@key, $options->{search_path_on_include} || 0);<br/>push(@key, $options->{loop_context_vars} || 0);<br/>push(@key, $options->{global_vars} || 0);</code><br/><br/>The key under which the cached template is stored is a md5_hex of the previous values passed to the HTML::Template->new() method. If you are pre-loading your templates in your startup with one set of any of these parameters but are later loading the same template with another set then you will see another CACHE LOAD.<br/><br/>For example if you pre-cache in your startup with:<br/><br/><code>HTML::Template->new( filename => '/my/path/templates/t.html', cache => 1);</code><br/><br/>and later in a Registry cgi you create a template object with:<br/><br/><code>my $tmpl = HTML::Template->new( filename => '/my/path/templates/t.html', cache => 1, global_vars => 1);</code><br/><br/>you will see a CACHE LOAD rather than a CACHE HIT when /my/path/templates/t.html is loaded. The end result is that you maybe loading and caching multiple copies of the same template unnecessarily and wasting memory.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-23739559929907565702010-01-26T04:10:00.000-06:002012-03-08T07:25:31.385-06:00Correct way to install Firefox 3.6 on Ubuntu 9.10 Karmic KoalaFirst close all your current firefox windows. Then open a Terminal with Applications > Accessories > Terminal. At the $ prompt enter the following:<br/><br/><strong>sudo add-apt-repository ppa:mozillateam/firefox-stable</strong><br/><br/>When prompted for your password enter it and enter the following commands one on each line:<br/><br/><strong>sudo apt-get update</strong><br/><strong> sudo apt-get install firefox-3.6</strong><br/><br/>Enjoy.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-35861617808813105692009-11-13T04:34:00.000-06:002012-03-08T07:25:31.411-06:00Can't log in to youtube with android app?I was only able to get this to work by logging in using my google user/address and password which had been previously associated with my youtube username.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-53237818430714508722009-09-02T06:07:00.000-05:002012-03-08T07:25:31.441-06:00Finding perl packages with APTIf you are attempting to satisfy dependencies for perl software that was NOT available via your favourite repository (this is sometimes unavoidable in enterprise environments) you should AT LEAST attempt to satisfy those dependencies using said repository. The easiest solution is to install 'apt-file' from your repo and for any perl modules you can simply call:<br/><pre>apt-file search "LWP::UserAgent"</pre><br/>This will return the following list on Debian Lenny:<br/><pre>liblwp-useragent-determined-perl: /usr/share/man/man3/LWP::UserAgent::Determined.3pm.gz<br/>libtest-mock-lwp-perl: /usr/share/man/man3/Test::Mock::LWP::UserAgent.3pm.gz<br/>libwww-perl: /usr/share/man/man3/LWP::UserAgent.3pm.gz</pre><br/>Now you know that in order to satisfy a dependency on "LWP::UserAgent" you would need to install the 'libwww-perl' module from the repo.<br/><br/>If the module is not available via the repo you should next consider installing the package into a custom perl lib directory specifically for the software (and/or user account) in question. To do this read the documentation for the <a href="http://search.cpan.org/search?query=local%3A%3Alib&mode=dist">local::lib module in CPAN</a>.<br/><br/>Ultimately your goal should be to not install non-packaged software to /usr/local and by doing so increase the maintainability of your systems.Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-12308343064321554212009-08-12T14:20:00.000-05:002012-03-08T07:25:31.346-06:00perl MIME::Lite sendmail Return-Path fix/overrideI'm not sure this affects the newest version of MIME::Lite; however, if you find that you are having issues with your messages being rejected or marked as spam, due to an internal host being added to the Return-Path, the following fix might work for you.<br/><br/>Rather than using:<br/><pre style="padding-left: 30px;">my $ml = MIME::Lite-new(<br/> From => ...<br/> To => ...<br/> ...<br/>);<br/><br/>$ml->send();</pre><br/>Use the following:<br/><pre style="padding-left: 30px;">$ml->send_by_sendmail(SetSender => 1);</pre>Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com1tag:blogger.com,1999:blog-1912432620330357670.post-56361548736776887082009-08-06T03:52:00.000-05:002012-05-03T11:03:54.186-05:00Find page count in TIFF or PDF with perlThe perl module you'll want to install is called PerlMagick (Image::Magick) and rather than loading the image into memory you can just use the Ping method. The Ping method returns an array with 4 elements of information for each page of a multi-page TIFF/PDF. If we divide the number of elements by 4 we know how many pages there are in the TIFF/PDF.<br />
<pre style="padding-left: 30px;"><span style="color: #ff9900;">use Image::Magick;
my $im = Image::Magick->new();</span><span style="color: #ff9900;">
my @ping_info = $im->Ping('fax.tif');
## If we access an @rray in a scalar context we get the element count
my $count = @ping_info / 4;
print $count;</span></pre>
<br />
There you have it, good luck.<br />
<br />
UPDATE:<br />
<br />
The example above may or may not work properly with PDF's. Even if it does work it appears that ImageMagick makes an external call to the ghostscript (gs) executable on the system to determine the properties of the pdf. Here is an example that will work for PDFs:<br />
<pre style="padding-left: 30px;"><span style="color: #ff9900;">use PDF::API2;
my $pdf = PDF::API2->open('2.pdf');
print $pdf->pages();</span></pre>
<br />
I'm guessing that eventually ImageMagick won't be "broken" but you can use the above in the meantime.<br />
<br />
UPDATE:<br />
<br />
We recently updated to Debian 6.0 and GhostScript seems to have problems with PDFs rendered by various software (it takes 5 minutes for it to get a page count on a 4 page document). My first line of defense for checking page counts in a pdf is the following for PDFs:<br />
<pre style="padding-left: 30px;"><span style="color: #ff9900;">open(FH, "$temp_file");
for my $line (<FH>) {
if ($line =~ m/\/Count\s+(\d+)/) {
$page_count = $1;
}
}
close(FH);</span></pre>
<br />
Don't be tempted to stop searching for the Count after the first match. Some PDFs will list a count for every page (like a page number). You'll want to use whatever the last match is for your actual count. If this code doesn't produce a page count I do the Image::Magick Ping. That appears to cover all scenarios I've come across.
<br />Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com2tag:blogger.com,1999:blog-1912432620330357670.post-34880979947083708682009-07-18T17:09:00.000-05:002012-03-08T07:25:31.408-06:00FOLLOW UP: Kenmore / Whirlpool dryer won’t stay running or heat?You will never guess what happened?! It has been a couple weeks now since I <a href="http://www.nocturnal.org/blog/2009/07/02/kenmore-whirlpool-dryer-wont-stay-running/">fixed the motor relay</a>. Well, the heat relay just went out this evening. Good thing I bought extra. :)Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-63817167629032765552009-07-07T15:06:00.000-05:002012-03-08T07:25:31.474-06:00Updating bios and/or firmware on Dell servers running Debian or any
unsupported OS<strong>These instructions will help you update BIOS, BMC, PERC or any other system firmware on your Dell system running any supported or unsupported OS.<br/></strong><br/>I finally got around to updating our servers to Debian Lenny. We have 1850's and 2850's. After lots of trial and error I figured out how to go about updating the bios and various device firmware without a Dell supported Linux environment installed on the server. You should note that instructions below still require basic Linux experience. Another note is that these instructions are OS agnostic and use a livecd which doesn't care what operating system you actually have installed on the machine itself.<br/><br/>The first step is running the Dell Content Manager to create a custom update repository for your severs. The fun part is actually getting your hands on the thing. You will need to download the <a href="http://support.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=R200232&SystemID=PWE_FOS_XEO_2650&servicetag=J3TD01J&os=WNET&osl=en&deviceid=17782&devlib=0&typecnt=0&vercnt=3&catid=-1&impid=-1&formatcnt=1&libid=36&fileid=279040">Dell Systems Build and Update Utility</a>. I should note that I wasn't able to get the download to work until I tried with a MS Windows desktop. When/If you are prompted for a Service Tag, just enter one for one of your own servers.<br/><br/>Once the ISO is downloaded you'll need to mount/copy or extract the 'contentmanager' directory onto your desktop. Assuming you are moving forward with the Windows desktop route you'll want to run the 'win\wincontent.exe' (there is also a 'lin\lincontent.tar' if you want to try that, I didn't). Now go find the new directory that was created. Edit the content.ini and change the 'ftp://' url to 'http://'. After you save that, run the 'contentmanager.exe'. Select 'Create Custom Server Update Utility' and 'Next.' Click 'Browse' and select a directory to dump this repository and click 'Next.' Wait for the program to download some meta-data and then un-check 'Windows' (leaving 'Linux' checked). Now control-click all the server models you need to upgrade and click 'Next.' Go get a soda and let it download everything. Once you've got your 'CustomRepository' go into the 'repository/sysman' directory and edit the .XML files in that directory with your favorite editor and look for the 'path=' attribute(s) (one for each system type). You'll see something like 'path="sysman\..."' change the slash to a '/' so it'll look like 'path="sysman/...". Save your changes and copy the contents (not the directory itself) of the 'CustomRepository' to the root of a FAT32 formatted usbkey.<br/><br/>Now you need to download the <a href="http://linux.dell.com/files/openmanage-contributions/omsa-55-live/omsa-55-022109.iso">OpenManage Server Administrator</a>. Burn it to a CD and then boot it in one of the servers you want to upgrade. Let it boot up all the way (this can take several minutes while network connectivity times out etc. and you answer a couple questions) and once you login as root you need to insert the usbkey. Mount it (you can check 'dmesg' output for the device and it'll be the first partition on there) with something like 'mkdir /media/disk; mount /dev/sdb1 /media/disk -o ro'. Change directory into '/media/disk' and run the following './suu -u'. Wait for it to analyze your system and update your system to the newest bios and firmwares. You'll probably see some notifications from snmpd and other stuff, they can be ignored. After you've completed all the updates type 'reboot'. Do not power down your system, some of the updates need the system to be rebooted to complete (such as BIOS updates).<br/><br/>You should now have up-to-date hardware bios/firmwares for your server. I should point out that under the Drivers section for your Service Tag on Dell's site you might also see something about 'SCSI Drives' firmware update. If you are using SCSI drives in your system you might want to get these out of the way as well. There is a Windows .exe you can download which will create a floppy or ISO image which you can boot in your server to update the drive firmware.<br/><br/>I hope this helps out, this was the simplest solution I could find given my environment (no DVD drives, no network connectivity, and the livecd not supporting X on the 1850's). Good luck! :)Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com0tag:blogger.com,1999:blog-1912432620330357670.post-10465348009908251582009-07-02T04:00:00.000-05:002012-03-08T07:25:31.336-06:00Kenmore / Whirlpool dryer won’t stay running or heat?We've got a Kenmore "Elite" dryer (actually made by Whirlpool) that stopped running when you release (let up) on the start button. After doing some research I found out that there is a $5 relay (every other place you try to buy it is going to be $35-50 each) that USUALLY fixes this problem.<br/><br/><em>Disclaimer: I take no responsibility for you spending $5 plus shipping on a part that doesn't fix the problem.</em><br/><br/>There are 2 of these relays in the control panel actually. One is the motor relay and the other is the heat relay. The motor relay was my problem. Supposedly if your dryer isn't heating up then it is the heat relay. The part number for both relays is <a target="_new" href="http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?langId=-1&storeId=10001&catalogId=10001&productId=611928">POTTER & BRUMFIELD/TYCO T9AP1D52-48-03</a> and the Kenmore part number is 3405281. If you search around on the internet you'll come across a massive thread on <a target="_new" href="http://www.epinions.com/msg/sec_~forums/show_~threads/cat_id_~17/id_~2440/forum_id_~409/pp_~1#posts">Epinions</a> dedicated to problems like this one. Sears will happily send someone out and charge you $200 to fix this problem unless you have an extended warranty which they will sell you for $200 for a single year. Honestly, I can't believe there hasn't been a class action lawsuit against Sears for these relays.<br/><br/>Just fix this yourself!<br/><br/><em>Disclaimer: I take no responsibility if you break your dryer even more.</em><br/><br/>On the sides of the front of the control panel you'll see these plastic moldings. Pull back on the top and remove them (they snap into place) exposing 2 screws on the bottom. Remove the screws and lift up on the front lower edge of the control panel CAREFULLY/SLOWLY and let it hang back on the soft plastic hinges. Make sure you don't snag on that resistor coming off the motherboard. You'll see the two identical black relays matching the spares you purchased (I bought 3 of them total for future use). The one on the right is for the Motor and on the left is for the Heat. Replace which ever one is the problem (be sure to hook the wires back up to the correct contacts). Put it back together and fire it up. Now, go take the $190 you didn't spend on fixing your dryer and save it for buying a non-Kenmore (do some research and avoid any manuf. that produces products for Sears completely out of spite).Matthew Lenzhttp://www.blogger.com/profile/07949632191023594293noreply@blogger.com1