Author: sjan

iPhone

iPhone updated

I am a bit late in posting this, but things have been a bit hectic around here. However, I have finally update my iPhone, now that TouchTerm is available from the iTunes store. I tried using the tool from modmyiphone but had terrible results with it. Thankfully I had a backup of my firmware (1.1.4) before trying it and immediately went back to using that. Now that I am on the 2.0 bandwagon, however, I have wasted no time in amassing a bunch of tools that I use daily.

Some of my favorites:

  • TouchTerm, for ssh access to my servers. This was the big show-stopper prior to now. Worth it to me to pay for. (And cheap, too!)
  • Bookmarks for quick acess to my del.icio.us bookmarks. Massive time saver, and the layout is useful if a bit stark and utlitarian.
  • Palringo for chat. There have been some concerns voiced on the comments in the app store about security, and such. I’m not so worried about it. I have a password I use for chat and different ones for more important things like email and such. I don’t use chat (outside of the jabber at work, which is not in my Palringo account) for anything important.
  • TouchCalc for its hex and binary modes. There is an octal mode as well, but I haven’t had need of it (yet).
  • Stanza for reading books on my iPhone. I read a lot, and it is nice to have half-a-dozen books at hand. And with the desktop app I can convert just about anything I can get online into a readable book for the iPhone. Very nice.
  • Twinkle for keeping up with twitter.
  • Tankbuch for keeping track of mileage and gas usage. My Forrester gets an average of 23.2 MPG in the city, and 30.4 on the highway!
  • Zenbe Lists for my shopping lists. It means that my wife can update the list from her PC while I am on my way to the store and I can sync when I get there and see everything I need to pick up. It also means that I can sync after checking everything off and I don’t have to relay the entire list of what I was able or unable to find when I get home.
  • Lots of games. I like the free ones, partly because I am cheap, and partly because I don’t generally play a single game long enough to warrant paying for it. The exception is Sextuple Word Challenge – a word game very much like TextTwist. (I have a bit of an addiction to word games, and hey, it’s only a buck.)
Database

Drizzle – Lightweight DB Based on MySQL

Brain Acker, director of architecture for MySQL has opened the door to Drizzle, a light-weight, high-concurrency database server based on MySQL, targeted at web applications.

The architectural ideas as described in the FAQ:

A micro-kernel that we then extend to add what we need (all additions come through interfaces that can be compiled/loaded in as needed). The target for the project is web infrastructure backend and cloud components.

The FAQ goes on explain the differences between Drizzle and MySQL which include:

No modes, views, triggers, prepared statements, stored procedures, query cache, data conversion inserts, ACL. Fewer data types.  Less engines, less code. Assume the primary engine is transactional.

Michael Widenius, founder and original MySQL developer, explains more about Drizzle in this blog post, including the most interesting piece (to me) – that Drizzle will always contain the most up-to-date InnoDB code, meaning you don’t need to wait around for MySQL 6 or download the plugins from Oracle each year to get the latest and greatest.

While Drizzle is still in development you can check out the code and try it out. Or maybe even get involved and help out. More information on how to do both is available on the wiki.

iPhone

Why I won’t upgrade my iPhone firmware (yet)

Ok, the iPhone 2.0 firmware (actually 1.2.0) is out, and the app store is up and only works with 2.0 firmware and iTunes 7.7 but I won’t do it. Not yet anyway. I am waiting for a jailbreak solution for 2.0 or some additions to the app store before I upgrade. I have been using Zibri’s ZiPhone up to now and actually have quite a few apps that I use on a daily basis.

So, am I just too cheap to pay for apps? No, that’s not it at all. In fact, if the apps I needed were on the store I would upgrade and buy them (and possibly have some support options) and be done with it. While there are some apps that are in the store that I currently use (Shopping List, Twinkle, Book Reader) there are others that aren’t (Terminal, anyone?).

So, until I can jailbreak 2.0 or until the app store catches up with what I actually use, no dice.

PHP

Using the COM class for PHP backgrounding in Windows

I was having a difficult time finding a reliable way to run a background PHP process in Windows, when that was called from an active PHP page. In the *nix world it is relatively simple: by using shell_exec() (or the bactick operator) you can redirect the output to another stream or file and the process will run in the background with no blocking. In Windows, however, this doesn’t seem to work well (or at all, depending on what you are calling via shell_exec()). I did find the answer, though, from piecing together info from the PHP documentation for shell_exec() and the COM class.

That, with a little trial and error and I was able to get a PHP page to fire off a command-line PHP process to run an import of several years data into a new reporting schema. Since this import relies on some serious data manipulation it has a tendency to time out for large data sets. So, I set up the command line script to run six months worth of data and before it exits it starts a new background process for the next six months of data. In this way I was able to complete a many-hour process without worrying about timeouts. I did notice that running in the background (actually in an “invisible” command shell) that the process ran slower than when running in the foreground. This was acceptable, however, since the page returns immediately while the processing begins and the application is still usable while the process is running.

Here is how I call it from the page:

if(isset($_SERVER['PWD'])) { // *nix
    $basepath = dirname(__FILE__).'/';
    $php = 'php';
} else {
    $basepath = dirname(__FILE__).'\\';
    // edit to match your installed target environment
    $php = "C:\\php516\\php.exe";
}
ignore_user_abort(true);
set_time_limit(0);
$arg1 = 'foo';
$arg2 = 'bar';
$runCommand = "$php -q {$basepath}my_background_running.php $arg1 $arg2";
if(isset($_SERVER['PWD'])) { // *nix
    // *nix: Use the backtick operator or shell_exec()
    $nullResult = `$runCommand > /dev/null &`;
} else { // Windows: use the php COM class
    // WScript.Shell gives you the command line
    $WshShell = new COM("WScript.Shell");
    $oExec = $WshShell->Run($runCommand, 7, false);
}

I do the same from the background script to call itself recursively right before it exits.

I didn’t find the Microsoft documentation for the Windows Script Host Shell until today during lunch. I found the location in the Practical PHP Programming Online Book where he says to use the Google search “wshell object” msdn which will result in the first link pointing at the MSDN documentation. (I have a feeling it moves around quite a bit, since every link I have run across up to now that points directly at the documentation results in a nice 404 error page at Microsoft.)

Home

Hosted at home again

While it was nice to have hosting during the move, I really do prefer having my server available at hand. And once again it is – after canceling the hosting and updating my DNS information this site and talkingfox.com are again hosted from my home office.

For future reference: SSH and command line access beats the crap out of cPanel any day.

Hardware

Linksys Wireless N and AirPort don’t mix?

Just on a hunch I made a minor change to the WAP – I changed it from the default (B,G,N) to only do B & G – and surprise – I have full speed connection. So, trip to the Mac store – not needed. Big sigh of relief goes here

Uncategorized

ALCAN and hardware don’t mix

Well, it seems that I am doing what I said I never would – blogging from my iPhone. It seems that somewhere along the way the wireless card in the MacBook Pro got shaken too vigorously and now, while I can connect I am averaging a throughput of somewhat less than normal. It seems to connect at no more than 360 bytes (no, not kilobytes) and spends much of its time idling at 0. So it is off to the Mac store I go…

More as I have news.

Alaska

Hitting the road …

I am taking a few minutes before my work day officially starts to write this. We are hitting the road tomorrow, for our move to Olympia. There are certainly things I will miss about Alaska, like the ravens, the aurora, the endless summer days, the sheer vast beauty of the place… There are a few things I won’t miss though, like the smell during break-up, the short winter days, the bitter cold (I don’t need to do another interior winter to know that -50F is no fun), snow (no really, I’ve had my share, Washington state could outlaw it for all I care at this point.)

Anyhow, the move (as I said) happens tomorrow and we will be on the road for several days. The last couple times I drove the ALCAN I did it in 3 days or less. This time we are taking our time, seeing a few things along the way and generally trying to be sane about it. As I find wireless on the way I will update twitter so those who care can see where we are.

Uncategorized

Hosting solved

During the move this site and talkingfox.com will be hosted by HostGator. While the initial setup was a bit tricky (changing paths, relying on php errors to tell me what the paths actually were, etc) I managed to get it up and running.

Since my wife didn’t keep copies of her mail locally her mail “disappeared” when the DNS switched over. I will probably alter her hosts file long enough to pull all the mail off the server and cache it locally so that she can respond to a few she had lined up.

After that it is a matter of switching our mail readers to point to the right (new) server for the interim and then changing everything back once we are relocated and settled.

Uncategorized

Moving (and possibly down for a while)

Ok, everyone already knows we are moving back to the lower 48. This means, of course, that this site and talkingfox.com will both be down during the transition. Unless, that is, I can find a reasonable price on one month of hosting. Just to throw the blogs and email up and point the DNS there during the move. If not, expect this site to be down from the 22nd of this month until sometime around the first week of June.

More later.