Movie – Body of Lies

I recently watched Body of Lies. At a high level, it’s a movie about an increasingly jaded CIA agent in the Middle East (Leonardo DiCaprio) and his jerk of a handler back in the US (Russell Crowe).

The prodction quality overall was great — there was some excellent use of real Middle Eastern locations and people. The acting was good, especially DiCaprio. And the plot overall was fairly interesting, as contorted spy stories go.

So all in all sounds good — but I didn’t like the movie. And not in the “this is a hard movie to watch, but worth watching anyway” way, but in the “meh, whatever” way. Why? Because the story never made me care what happened to the lead characters. Sure, it was vaguely interesting to see what would happen next, but I didn’t have any investment in the protagonist making it through.

So, yeah, meh. I give it a 6/10. It’s worth watching if you’re interested in spy stuff and how they operate in the Middle East, otherwise you’re not really missing much.

Find lost Android device

This looks pretty cool. You lose your Android device, go to the Android Market and remotely install this tool (for free!), and it sends the primary Gmail account associated with the phone a report of the device’s location (assuming it has battery, wifi or data access, etc).

http://blog.mylookout.com/2011/02/planb/

This is probably old news, but I’m still finding old Android stuff that’s new to me!

Movies – Battle for Terra

I’ve decided to try and post more movie reviews, since it appears the only one I’ve actually posted here was in Jan 2009. And I do watch a few movies, and heaven knows I have opinions. :)

So, first up is Battle for Terra (IMDB), which is from back in 2007 but I finally got around to watching it this past week. I’m giving it a 8/10. Also, the website appears surprisingly good, I didn’t check it out before watching the movie.

The story here is that we’re on a distant alien world, populated by various flying/floating alien life forms including a race of sentient aliens with an advanced society and culture, but fairly simple technology, who live in harmony with nature. We’re primarily following one female (I suppose?) alien youth who’s a bit of a rebel. Trouble arrives in the form of a dying ship full of the last humans fleeing the destruction of all human civilization due to interplanetary civil war.

The majority of the humans are military types, and they are in favour of taking the planet by force and terraforming it, which will change the atmosphere and kill all the indigenous life. One soldier’s fighter/scout ship is damaged during an initial sample collection run through the alien city, and he’s saved by the alien protagonist, who creates a bubble of oxygenated air for the soldier with the assistance of the soldier’s robot companion.

I don’t want to go through entire plot or give away the ending, but overall I found it surprisingly well crafted. Optimistic and with a strong ethical backbone, but at the same time reasonably realistic, and willing to forego many of the common plot elements from the standard crop of animated and/or alien and/or sci-fi militaristic movies in the past decade. I liked that the writers were willing to take a slightly different path, and I think the movie was better for it. I could’ve done with a bit more alien-ness in the aliens (they are apparently male/female, and have extremely similar thought processes to the humans), but I expect that was done so it was easier for a wider audience to relate, and to ease some more complicated plot corners.

This is an entirely computer animated movie, and not realistically stylized or using motion capture that I could tell, so there’s only voice acting. No complaints there, and none of the voices were obviously recognizable enough to be distracting.

The styling and detail of the animation is not hugely detailed, going for a rounded and simplified look instead of full-on realism, but is smooth and very consistent, and quite visually appealing. It enhances the feeling that you’re on an alien world and seeing it from an alien perspective, though giving the humans more detailed and sharper look than the alien life might’ve helped with this.

So, all in all, quite a good movie, and worth the time to watch it. Which is not something I find myself saying about many movies these days.

JMX java.lang naming between Windows and Linux (and a bit of OpenNMS)

I’ve been banging my head against something here at work, so thought I’d post the solution up on the Interwebs to hopefully prevent cranial trauma for others.

First, if you don’t know what JMX is, you can read about it on the lovely Wikipedias here: JMX. Basically, it’s a technology that lets you monitor the internals of a running Java process, which is very useful for troubleshooting.

I setup JMX monitoring on the Java app and in OpenNMS, which was pretty straight forward, then sat back and waited to see what data was collected. And that’s when the headaches started, because different data was collected from the Java processes running on Linux than on Windows. Specifically, OpenNMS was not collecting any data from the Linux boxes about different types of memory usage in the Java process, which is one of the key things I wanted to get.

After a bunch of poking around, I found the lovely command line jmxsh utility, which allowed me to do some quick lists of JMX mbeans exposed on each machine. And it showed me this…

Linux – Sun java 1.6.0_24 running as Tomcat 7 using normal startup script

1. java.lang:type=Memory
2. java.lang:type=MemoryPool,name=PS Eden Space
3. java.lang:type=MemoryPool,name=PS Survivor Space
4. java.lang:type=MemoryPool,name=Code Cache
5. java.lang:type=GarbageCollector,name=PS MarkSweep
6. java.lang:type=Runtime
7. java.lang:type=ClassLoading
8. java.lang:type=Threading
9. java.lang:type=Compilation
10. java.lang:type=MemoryPool,name=PS Perm Gen
11. java.lang:type=GarbageCollector,name=PS Scavenge
12. java.lang:type=OperatingSystem
13. java.lang:type=MemoryPool,name=PS Old Gen
14. java.lang:type=MemoryManager,name=CodeCacheManager

Windows – Sun java 1.6.0_25 running as Tomcat 7 service using jvm.dll

1. java.lang:type=Memory
2. java.lang:type=GarbageCollector,name=Copy
3. java.lang:type=MemoryPool,name=Code Cache
4. java.lang:type=Runtime
5. java.lang:type=ClassLoading
6. java.lang:type=MemoryPool,name=Perm Gen [shared-rw]
7. java.lang:type=Threading
8. java.lang:type=MemoryPool,name=Perm Gen [shared-ro]
9. java.lang:type=Compilation
10. java.lang:type=MemoryPool,name=Eden Space
11. java.lang:type=MemoryPool,name=Survivor Space
12. java.lang:type=GarbageCollector,name=MarkSweepCompact
13. java.lang:type=OperatingSystem
14. java.lang:type=MemoryPool,name=Tenured Gen
15. java.lang:type=MemoryPool,name=Perm Gen
16. java.lang:type=MemoryManager,name=CodeCacheManager

As you may notice, there’s a PS prepended to a bunch of those names on Linux but not on Windows, and the OpenNMS JMX config (jmx-datacollection-config.xml) didn’t have the PS entries for MemoryPool items. To fix the problem I edited the config and duplicated the affected entries, and updating only the name and objectname to add the PS but not changing the rest of the definitions. In this way (I hope) it will still see separate entries in the JMX config, but collect them into the same back-end databases for display.

A quick grep for Memory in my jmx-datacollection-config.xml now shows:

[...]
<mbean name="JVM MemoryPool:Eden Space" objectname="java.lang:type=MemoryPool,name=Eden Space">
<mbean name="JVM MemoryPool:PS Eden Space" objectname="java.lang:type=MemoryPool,name=PS Eden Space">
<mbean name="JVM MemoryPool:Survivor Space" objectname="java.lang:type=MemoryPool,name=Survivor Space">
<mbean name="JVM MemoryPool:PS Survivor Space" objectname="java.lang:type=MemoryPool,name=PS Survivor Space">
<mbean name="JVM MemoryPool:Perm Gen" objectname="java.lang:type=MemoryPool,name=Perm Gen">
<mbean name="JVM MemoryPool:PS Perm Gen" objectname="java.lang:type=MemoryPool,name=PS Perm Gen">
<mbean name="JVM MemoryPool:Old Gen" objectname="java.lang:type=MemoryPool,name=Old Gen">
<mbean name="JVM MemoryPool:PS Old Gen" objectname="java.lang:type=MemoryPool,name=PS Old Gen">

This seems to be collecting the expected memory stats regardless of platform. Yay!

Music in the Cloud

Now that Apple has announced their iCloud service, I thought I’d jot down some thoughts on music storage in the cloud — that is, on some company’s central server instead of on your PC, MP3 player, and other devices you own.

tl;dr – It’s a great shortcut for the music industry’s new business model of suing consumers en masse.

If you’re not familiar with this topic, see these. (most not available in Canada yet, but for reference…)
Amazon Cloud Player (damn, Amazon has crappy URLs)
Google Music Beta
Apple iTunes Cloud

First, let’s look at some underlying technology. Stay with me, it gets interesting in a bit. ;)

One central principle of any system where many people are storing the same thing is deduplication — that is, when you upload a file and someone else uploads the same file, only one copy of the file itself is actually stored, and the tracking system has two records pointing to the same file. Any other means of setting up a system like this would require ridiculous amounts of storage space, and whatever else Amazon, Google, and Apple are, they are not stupid.

One way to do this is through the storage layer itself, using something like Opendedup or various similar commercial solutions. But if you have everyone uploading all their files through a common interface, as all these cloud systems do, it’d be simple enough to just do a quick checksum on the file (preferably before upload to save time/bandwidth) and match it to the checksum of any existing files in the system. If the file exists already, just add another pointer to that file. If it doesn’t exist, upload the new one. This is certainly what Amazon and Google are doing. In the case of a file matched with iTunes Match, you don’t even upload a file, they just point to Apple’s official AAC version of the same track.

This means that any cloud-based system that’s charging you based on the “size” of similar files that many people upload is a scam. After the first person uploads a file there is no reason for additional storage to be used when a second, third, or one millionth person uploads the same file, aside from the space used for the file tracking system.

It also means that any cloud system can quickly and simply generate a list of every user who has uploaded the same file. More on that later.

Thinking on iTunes Match, I’m not entirely sure how that system would match tracks with random MP3 files (let’s assume you ripped them from a CD using something besides iTunes, and didn’t ‘acquire’ them using other means). I would think ripped MP3 files would not be generated exactly the same on every different PC and not easily identifiable as a specific audio track by checksum, and Apple certainly can’t trust the easily manipulated metadata within the MP3 file for identification. It seems likely that iTunes Match may only match music ripped using iTunes itself, which associates additional metadata from the physical CD with the music files, or that the service can identify by checksum as an authorized download. Going back to Apple’s information, at no point does the iTunes Match announcement discuss matching “random MP3 files you acquired from somewhere”, just “songs you’ve already ripped yourself” or “bought from another online store”.

It’s possible that the technology Apple acquired from Lulu might have some kind of magical audio scanning system that looks at the actual contents of an MP3 file and compares it to audio tracks in a central database, but that seems like a lot of work. Far easier for Apple to just restrict sources of files to ones they can easily identify.

Now, let’s move on to tracking and privacy.

If you have a bunch of MP3 files on your PC and audio playing device of choice there are very limited ways that anyone can authoritatively find out what they are, for example if they wanted to initiate legal actions alleging you stole music (whether or not you really did). If you’re using iTunes to manage the files on your device then Apple likely has some data collection options, but there are still privacy issues with them scanning your library and collecting specific details about the contents (though I have to admit I haven’t read the terms & conditions on iTunes lately, so maybe they’re working around that). If you are actively sharing files that’s different, there are means of collecting data across the network about what you are doing, but if you just have a bunch of files sitting on your machine and are not sharing them you’re not likely to be hit up with a lawsuit.

However, if you are uploading files to a centralized storage service (for music or any other files), you have effectively handed over any and all expectations of privacy about your files to whoever is running that service. This is especially the case when the storage service is specifically intended for content that is illegal when duplicated without authorization and licensing — like, say, music.

In and of itself this doesn’t seem particularly bad — I’m sure you wouldn’t be actively torrenting music and then uploading to iTunes Cloud. That would just be dumb. But it’s entirely possible that a friend could give you a MP3 of a music track that he likes, and you have no idea where it comes from or who else has a copy, and you upload it with all the rest of your ripped files. Maybe you rip a track to MP3 from your own CD, give a copy to a friend, and unknown to you their kid gets a copy and puts it out on a torrent.

Then you upload the file to the cloud, and suddenly you’re added to a list of everyone else using the system who has uploaded that file, tracked by it’s unique checksum fingerprint. It would be foolish to think that Apple and the others haven’t made agreements with the music labels to review those lists, perhaps even as they’re trending, and hand them over for legal action if the file is found to be an unauthorized copy (ie, not one that the music labels provided to an authorized reseller). I’m sure there will be details in the terms and conditions of use allowing them to do this, there are usually clauses about illegal activities rendering all privacy protections void.

I wouldn’t be surprised that the music labels would even release versions of new tracks via the illegal torrent scene that are specifically intended to generate these lists, allowing them to take action much more quickly, because they will already have proof of the origin of the file. This is already possible, but there’s a lot of legwork involved now that makes it prohibitive — tracking a downloader, forcing their ISP to divulge their contact info, collecting all the downloaded files after getting a court order to seize their PC(s), then doing detailed computer forensics work to compare the files to the original, all while preserving the chain of evidence. The cloud service removes this requirement — the list of users who have uploaded an unauthorized file is readily available.

So… yeah. Cloud based music services providing quick and accurate evidence for music industry lawsuits.

But remember, it’s all about convenience for users!

Useful Android apps

I got a Nexus S phone a week and a bit ago, and am quite enjoying Android. Here are some apps I’ve been using — let me know if you have others to suggest! Though I’m not likely to pay for any apps… :)

I think you can get any of these from the Android Marketplace, some come with Android.

  • Google Reader – I actually don’t like this one much, if anyone has a good RSS reader app let me know, otherwise I’ll just keep reading my feeds on a computer
  • Android Music (the one built in) – actually works quite well for any MP3 files I’ve copied over
  • Google Listen – once you get used to it, not bad for audio podcasts; would like something that also handled video podcasts
  • MoboPlay – good video player; if/when VLC ever comes to Android I’ll certainly switch to that (unless it’s a pay app)
  • WordPress – pretty good, though I’m not using it to write this…
  • Facebook – yeah, I use it
  • Amazon Kindle – have a few free books on it, am planning to try some from the library as well – the phone is a bit small for reading, but I’ll give it a try
  • Password Safe – same password management app I use on Windows (and Password Gorilla on the Mac)
  • AndFTP and AndSCP – seem to be good file transfer apps, though so far USB has been easier
  • Wifi Analyzer – excellent multiple views of wireless networks
  • Google Translate – Bri has been having lots of fun with this one, especially with the voice input
  • Google Sky – looks very cool, look forward to it being warm enough outside to play with it
  • Google Goggles – also very cool, snap a picture and it uses the power of the Internet to recognize what it is
  • Angry Birds – all versions ad supported and free, yay!

Aside from this, I’ve been looking for a nice and clean way to manage media between a desktop and Android device. In particular, I’m looking for something that will manage copying media files to the device, downloading both audio and video podcasts, and not require iTunes.

I did look at DoubleTwist, and it looks nice and seems to work as advertised, but requires iTunes. I also looked at Songbird, but wasn’t happy when it asked to check my Google Reader account for media and then just sat spinning for a long, long time. I might try it again though, and just skip the Google Reader part.

Any other suggestions?

New laptop

I bought a new laptop yesterday. My old one (bought off-lease about 3 years ago) had a busted screen due to dropping my old work laptop on it last week — no damage to the work laptop, but the corner of it scratched along my screen, d’oh. Getting too old for juggling laptops I guess. The old one also had issues with the hard drive, it would get very unhappy and lock the machine for minutes at a time when hot, and the battery was only good for about 10 minutes (just long enough to move to another power outlet). So it was time for a new one.

I was planning to hit Canada Computers in Ajax, but had to go to Best Buy anyway to get a new cel phone (my almost-3yr-old phone also had display issues, but just from wear), so while I was there I decided to check out the laptop section. BestBuy’s laptop selection is pretty vast, there must’ve been 40 different models on display. I think more laptops than phones.

My basic criteria for the laptop was as follows:
- max budget of $600+tax
- prefer non-Intel graphics processor
- Need at least 2Gb RAM and 200Gb drive
- Looks good, but not stupidly styled
- Whatever else I can get for that price

My basic usage is for standard Internet use/browsing, occasionally watching downloaded 720p videos, and low-end gaming (LOTRO and DDO at low/medium graphics settings). So not particularly strenuous requirements for a full-fledged laptop.

The one I chose is a HP G62-318CA (link to HP’s specs), which seemed a reasonable value. Best Buy has it for $499. If you don’t want to click through to the specs, it has a triple-core AMD Phenom II processor (not very fast, but OK), 3Gb RAM and 320Gb drive, ATI Radeon HD4250 graphics (not very fast, but OK), 15.6″ WXGA screen, Blu-ray RO/DVD RW drive, and the usual assortment of ports.

The BestBuy guy seemed surprised at the triple-core and Blu-ray drive for that price, and I was inclined to agree.

After using the machine for a bit my impressions are as follows:
- There’s no separation between the touch pad and the rest of the casing, just a raised bit. There are buttons for the trackpad. This is a bit strange at first, but I like the design because you can’t get dust & other bits stuck in the corners of the trackpad.
- Speed is quite acceptable for a low-end laptop, definitely better than a netbook
- The display is quite nice, quite bright
- I like the styling in general
- Plays LOTRO on mostly medium settings at 1280×720 at 25-30fps, with a few of the more demanding performance options turned off
- Not wild about the Realtek network adapter
- Reverse of most laptops, keys along are primarily for audio/brightness/wifi control and require pressing a FN key to get F1/F2/F3/…, which is a bit odd at first but I’m coming around to it — might try to investigate if it can be inverted to be more like a normal keyboard though
- Quick launch keys down the left side of the keyboard for DVD player, calculator, email, etc are quite annoying, especially if you accidentally hit them in the middle of a game — actively looking for a way to disable or remap them

Things I noticed this week

Here are some things I’ve noticed this week.

- The day after I come back from being off sick with some flu-type bug that makes my muscles ache, I shouldn’t be carrying a 38 pound Dell server (plus rack mount rails) to/from the data centre/cab/office, it will be painful and wipe me out
- Lentil soup can be good
- Setting a picture of Cthulu as my Facebook and Yammer pic is oddly calming
- When your one-way door-to-door commute is 2hrs, additional accidental delays by the transit service don’t seem to matter as much
- I have always (that I can remember) auto-adjusted to Daylight Savings sometime before it actually arrives, making the actual day of the change somewhat of a relief; this process seems to be happening earlier each year

Whee, a mostly non-technical post.

Powershell and WMI, redux

About a year ago I posted some tricks for pulling information about WMI counters on Windows using the Powershell command line tools.

I’ve been frustrated when trying to use these to find details about the AppFabric Caching counters, because the command line tools are not returning the same data for these as for other counters I’ve wanted to track in the past.

When looking for better tools today I stumbled across this awesome GUI WMI tool written in Powershell that does everything I wanted. With it I was quickly able to find and get details about the AppFabric Caching counters I need. Yay!

Now on to adding them to OpenNMS…

OpenNMS and WMI, update

About a year ago I wrote a couple of posts about setting up OpenNMS with WMI (part 1, part 2), but until recently we were unable to leave this functionality enabled all the time because of a socket file descriptor leak (OpenNMS bug 3249). If we enabled WMI more and more socket descriptors would be allocated and not freed, and eventually everything would grind to a halt and monitoring would fail. So we left WMI disabled, and tested again each time we updated OpenNMS.

Happily for us, the OpenNMS folks have fixed this issue. It looks like it was fixed in OpenNMS 1.8.3, and I confirmed it fixed in 1.8.4, the current version. So I’ll be writing additional posts about implementing weird and wonderful WMI counters as we get them setup — likely the first set will be for Microsoft AppFabric Caching, which we’re now testing.