Friday, September 12, 2008

Mobile test message

I'm typing this from my mobile phone. While I hate the keyboard it
might be useful for quick entries while I'm out roaming the world.
Let'a face it, the world is moving more towards wireless everything
and while I don't see this generation of phones as being the
replacement for our desktop computers it's getting pretty dang close.
Now if I only had a spell chicker. ;-)

--
Linux Home Automation Neil Cherry linuxha@gmail.com
http://www.linuxha.com/
http://linuxha.blogspot.com/
Author: Linux Smart Homes For Dummies

Hmm, that was interesting. It looks like it's a bit of a mess. Still it could be useful. I think I will probably have better luck with forwarding this message to my home machine and using some kind of Perl script to reformat the post and forward it on the the blog service (à la send2blogger).

Labels: , ,

Sunday, September 07, 2008

In the spirit of sharing.

A while ago I found I had an awful problem with exclamation points (or in Unix parlance bang or shebang) being inserted into my Blog entries at random locations. It would only happen on long Blog entries. It was maddening as I'd then have to go in and remove them by hand. It's been a problem for a number of years but I didn't know what to do to fix the problem. I tried searching for various iterations of Blogger and exclamation points but no such luck. One day, while researching another topic, I came across a message about Sendmail on a Mac (BSD) inserting exclamation points after around 2048 characters (2k bytes, hmm sounds familiar). It didn't say much more but I decided to revisit the problem and see if I couldn't fix it. First I discovered that Sendmail is actually adding a '!\n' (or exclamation point and a new line). Then I found out that it only exhibited this behavior if it hadn't received a '\r\n' (Carriage Return and New Line) within less than 2048 characters. My solution was when emailing my Blog entry to Blogger to use a Perl program I wrote that adds a '\r\n\' where the last white space would have been in a 2040 byte buffer. Yes, I made sure that every 2040 bytes there was a '\r\n'. There are other useful feature to the program that make it easy to use to write a Blog entry and mail it in. I've been using this fix for the last few months and it's worked really well. I've sent several entries that are well over 2048 bytes and I've seen no more '!'s in my Blogs. Hope this helps someone else. If you're interested in my Perl code it can be found send2blogger.pl.

Labels: ,

I'm so tired!

These last few weeks off from school were supposed to be relaxing but for some odd reason they haven't been. I'm still exhausted. I have a lot of work to do there. Uhm, ah never mind.

With tropical storm Hanna rolling through the area I'm stuck indoors with time on my hands. So I wrote programs. The first was a simple php redirect.php so people who get http error 404s on my web pages get a custom page and, within 10 seconds or so, get redirected back to my main page. If I didn't do this they were redirected to what looks like a cyber-squater's web page. I really don't like that! I also keep a list of redirect URLs so I can figure out which pages are missing or otherwise giving me trouble. Oddly enough it worked really well. I kept getting older URLs that I've changed in the last few months. It took me a while but I discovered that my sitemap file needed to be updated.

Also I updated my linkcheck program. I've been using this software since 2000 and it's still useful. Not many people use it but I know at least a few do as the older version had my email address in it and I still get emails from sites that haven't updated the software (argh!). The newer versions takes care of that and I've added a lot of new features and fixes. Odd I never really gave much thought to how useful my programs might be.