Windows 8 Blues

It’s been a while since I’ve posted about Windows 8. My intention was to upgrade both my desktop and laptop to Win 8. My laptop (a ThinkPad Edge) is now upgraded, but, after several failed attempts, my desktop is still running Windows 7. One thing I can say about the Windows 8 upgrade process: if it fails, it does a great job of restoring back to Win 7. I’ve had, I think, three failed attempts to upgrade my desktop. Each time, the Win 8 installer figured out that things weren’t working out, and got me back to Win 7.

Meanwhile, my laptop has been working fine under Win 8 for several weeks. I used Start8 to get the Start Menu back, and I haven’t used the Metro interface at all, really. I have Start8 set up to take me straight to the desktop when I log in, so I really don’t even look at it.

I did have an issue on the laptop with Windows Updates this week though. Somewhere in the process of installing the most recent batch of updates, something went wrong, and left my machine unable to completely boot up. Win 8 detected a problem, and tried to automatically fix it, but that didn’t work. I used System Restore to go back to a restore point, and that got me up and running again, though there was some residual weirdness after that. I *think* I’m back to a stable state now, with all critical updates installed, but I’m not 100% sure of that.

So, for anyone looking for an opinion on Windows 8:
(1) It’s workable, if you do something the get the start menu back, and ignore the Metro interface.
(2) Upgrades from Win 7 are kind of an iffy proposition, but probably won’t destroy your machine if they fail.
(3) Once installed, it’s no less likely to go south than Win 7 was. (The BSOD looks different now, but it’s still a BSOD.)

Oh, and if you’re looking for some useful advice on  Win 8, check out these posts from Scott Hanselman and Paul Allen.

Amazon Web Services

My boss has gotten enthusiastic about AWS recently. We’ve messed around with a bit with in on a couple of projects, and also just for testing. We used a Linux EC2 instance for the Gisgraphy project I blogged about a while back. And we would up using a dedicated Windows EC2 instance for the gas finder site that we put up after Hurricane Sandy.

In addition to that, I’ve done some experimenting with RDS (for SQL Server) and Elastic Beanstalk. I was initially enthusiastic about both, but, once I got to working with them, I saw enough limitations that I decided to back off. RDS is a nice way to have a low-maintenance SQL Server in the cloud, but the main limitation I found was the inability to easily get a local backup of a large database loaded onto it, and vice versa. While there are ways to get data in and out of RDS, of course, there’s no support for standard SQL backups and restores, to (and from) .bak files. The recommended approach is to script the db out to T-SQL, using the standard export capability, but given the size and complexity of some of our databases, that’s just not workable.

And, as for Elastic Beanstalk, it’s a nice way to get a single ASP.NET application up and running on EC2, with a pre-configured load balancer, but we really don’t have any single site that would benefit from that, and easily fit into that model.

For now, we’ve tentatively decided to move some of our stuff up to AWS, using a few EC2 instances, but really that won’t be much different than what we’re doing now (external hosting on a managed server at PEER1). The main difference will be that we’re planning on breaking some stuff up so that we’ll have a few smaller instances, so we can scale them as needed, and we’ll have the option of spinning up a second copy of the instance running our web service, if needed. I’m not really sure how all this will work out, but I’ll blog more as we go forward, if I learn anything that seems like it would be worth sharing.

Meanwhile, I’ve been watching this screencast series on AWS. Unfortunately, I’ve found that it’s mostly covering ground that I’ve already figured out on my own. But, if you’re new to AWS, and want a guided tour, included a (somewhat leisurely) look at some cloud basics, this might be for you.

My MacBook’s birthday

I was looking at some old notes this morning, and I realized that I bought my current MacBook on December 2, 2007. So, tomorrow will be the MacBook’s fifth birthday!

I had been planning to replace it at the end of this year, but, as I’ve been thinking about it, I may put that off for a while more. It’s still working fine, and I don’t really have anything I need to do that I can’t do on this one.

I’m running OS X 10.7.5 right now, and I know that this machine isn’t supposed to be upgradeable to 10.8 (Mountain Lion). That’s really the only reason I’d feel the need to get a new machine.

Selenium

OK, one more post for tonight. (This is another one I suspected that I may have previously written up, but apparently not.)

I’ve known about Selenium for awhile now, mostly because one of our clients has a “testing guy” and he uses it. I’ve always wanted to be able to do some automated testing of web site projects, but it always seemed like the tools for doing so were too limited or complex. I’ll admit I put off downloading & learning Selenium, largely because I thought it would be a hassle and eat up a lot of time before I could really do anything useful with it. When I finally gave it a chance, though, I was surprised how easy it was to use.

I initially started with WebDriver, which is basically a couple of DLLs that let you “drive” Firefox (or another browser), sending keystrokes and click events, and looking for certain responses. You can get started with WebDriver quickly by grabbing it via NuGet. My first project with WebDriver was a simple console program that launches Firefox, then goes to several of the store locator web sites that use our Bullseye API, does a search at each one, and checks to see if it gets results. Nothing big, but just a useful program that I can run any time I roll out code changes to the API. Previously, I’d been checking this stuff by hand after each rollout.

Today, I took another step, and downloaded Selenium IDE. This is a Firefox plugin that lets you record a series of actions as you do them, then save them to a script. There are plugins allowing you save the script in several languages, including C#. So, I can record some steps, export some C# code, then fix it up to do some reasonable testing. My main purpose today was to record the steps involved in a fairly complex workflow on one of our client sites. It’s a multi-step process (around 20 steps, I think). Just in and of itself, the script is useful to have, as I often need to step through it to establish a new test account, so now I can just “play” it instead of clicking through the whole process myself. But, I would also like to use it to automate some testing of this process. Now that I have a base script, I can go in and replace the values I entered today with variables, so I can abstract things out in such a way that I can run the code repeatedly, testing multiple scenarios. And since I can do this all in C#, I can also then check the database, and see if the values I entered were interpreted and stored in the database correctly.

This may all seem pretty routine to some people, but I have to admit that I’ve never really had a chance to do this kind of testing before. It’s kind of cool!

I think my next project is going to have to be trying WebDriver with browsers other than Firefox.  I’d like to be able to test the same workflow in IE, Firefox, and Chrome, at least. (And if I get really ambitious, maybe I’ll see about iOS browser automation…)

xdebug

I thought I’d written up an entry on Xdebug for PHP a while ago,  but apparently not. (Or, if I did, it’s not coming up when I search for “xdebug” for some reason.) Anyway, Xdebug is a debugging tool for PHP. It’s definitely worth enabling, if you’re doing anything with PHP that’s in any way non-trivial.

It’s a bit hard to figure out the best way to get started with it under Windows. It turns out to be pretty easy, though, given a few pointers. First,  go to the wizard page, and paste in the contents of a phpinfo() call, run on the machine you’re installing to. This will then tell you exactly which file to download, where to put it, and what to add to your php.ini. Much easier than trying to figure that stuff out yourself!

A few other pointers:
– Depending on how you download & copy the DLL over, you may need to unblock it. (Blocked files really annoy me, by the way. I don’t know whose idea that “feature” was, but it was not a *good* idea. See here for some ways to unblock multiple files easily.)
– Xdebug can add color to your var_dump() calls. Add “set html_errors = On” to your php.ini to enable this. I’ve found it to be very helpful when looking at a complex object. (Of course, there’s always krumo for that too.)
– To get debugging working under Komodo IDE, take a look at this document. One thing that was confusing to me was that debugging locally is still considered “remote debugging”.

Also, on a related note, I’m not sure I ever mentioned that, after looking at a few options, I settled on Komodo as my PHP IDE of choice. It’s reasonably fast and easy to use, and the debugger works pretty well. There are a few things about it that I’m not too fond of, but overall, it’s really good.

Drupal Rules

I haven’t blogged in a bit, and I have a few random items I want to write up. I’m doing a lot of work with Drupal, and I’m still learning some little tricks here and there.

When I’m writing custom code, I often use Drupal’s cache. That’s pretty easy to do, with cache_set and cache_get. I recently found myself in a situation, though, where I wanted to clear a certain item from cache any time a user created or edited a node of a certain type.

It turns out to be really easy to do that with the Rules module. Just set up a rule that is triggered on insert or update of a certain node type, and make the action a simple line of PHP code:

cache_clear_all(‘your_cache_key’, ‘cache’);

Easy!

another failed Windows 8 upgrade attempt

I took another shot at upgrading my desktop PC to Windows 8 today. I first uninstalled some software that I thought might be causing problems, then ran the upgrade using the “just personal files” option. I figured this would wipe out the Windows and Program Files folders, and leave me with a clean Windows 8 install. The plan would then be to re-install all the software I would need, under Windows 8. Good plan, but once again, the install failed and rolled me back to Windows 7.

I’m really not sure what’s going wrong. I have a few ideas, based on stuff I’ve found in the Windows 8 install forums, but I’m not sure what’s likely to work and what’s not. Since the install/restore process takes about two hours, I think I’m going to have to wait a bit before trying the upgrade again.

Windows 8 upgrade failed

So my ill-considered attempt to upgrade my desktop machine to Windows 8 failed. The computer seemed to blue-screen after the install finished (showing the silly new Win 8 error screen), then rebooted to a screen telling me that the upgrade failed, and that it was restoring my previous Windows version. Surprisingly enough, that worked well, and I’m right back where I started.

I had originally only intended to run the upgrade advisor, and not actually do the upgrade. But, when I ran setup.exe from the DVD, it went straight into the upgrade, without giving me any indication of software incompatibilities or anything like that. I was going to cancel the install, but I decided to give it a shot anyway. I guess that wasn’t really a good idea.

So, with the computer back to Windows 7, I started poking around on the DVD to figure out how to run the upgrade advisor. I didn’t actually find it on the DVD, but I managed to download it from Microsoft and run it from there. There are actually a number of things on the computer that won’t work in Win 8, and that need to be either removed or upgraded. I’m not sure which of those might have been serious enough to have screwed up the install though, or if the problem might be with something else entirely.

Well, I’m going to try to take care or removing and upgrading stuff, then maybe take another shot at the upgrade next weekend.

Sandy follow-up and more

I got cable service back yesterday, so I’m pretty much back to normal, at least as far as utilities are concerned. My goals for today were modest — I just wanted to get my laundry done, pay some bills, run a couple of errands, and then relax and watch some TV.

At work, over the last couple of days, we’ve been working on a web site to allow people to search for open gas stations in the area. Getting gas has been a huge problem here in NJ since the storm. The web site is live at http://findgas.org/ now. Unfortunately, it’s been popular enough that we had to make some adjustments, lest the site take down our main web server. Not really what I wanted to be doing today, but not a big deal either. In hindsight, we should probably have put the thing up on AWS, on a self-contained EC2 instance. Live and learn, right?

Meanwhile, I decided to take a shot at upgrading my main desktop computer (here at home) to Windows 8. I was originally going to go through and uninstall some old software first, but in the end, I decided to just start the upgrade and hope for the best. I didn’t even do a backup first, which is something I may regret later. Either way, it’s running right now. Previous experience from my laptop upgrade would lead me to believe that it’ll take an hour or two to finish.

Sandy

Just a quick post to say that my section of Main St in Somerville got power back at around 9pm last night. I’d lost power on Monday night, at around 9pm, so that was three days with no power. I know a lot of places got hit much worse that Somerset County. It was weird living without electricity for three days though.

My iPhone and iPad kept me connected. Both Verizon (iPhone) and AT&T (iPad) 3G stayed up most of the time. (AT&T disappeared for several hours at one point, but I never had a problem with the Verizon service.)

My cable service isn’t back up yet, so no high-speed internet at home just yet. Hopefully soon!