OS X User Account Control Popup: “finish_installation” wants to make changes.

Playing with my Mac this evening, the following system popup appeared, while I’m browsing around the web:

“finish_installation wants to make changes. Type an administrator's name and password to allow this.”

I’m always a bit suspicious, esp. if it shows up when I’m wandering around the web in Chrome. I assume nothing can get out of the sandbox, but who knows? I’ve already disabled the Java plugin, and nondescript programs asking me to type in my admin password always make me pause.

Various Google searches return non-helpful results, since it splits “finish” and “installation”, and, again doesn’t do order-dependent or phrase searches. And since most of the phrase is pretty non-unique, the results aren’t great.

But, I did manage to find this post on MacRumors.

Turns out the “finish_installation” is part of Sparkle, which is that handy-dandy autoupdate framework. But it’s not helpful when you don’t know which app is requesting the update, and/or if this app is legit.

So open up Activity Monitor, and Inspect the finish_installation process, which will tell you what you want to know.

Digging up info on the finish_installation process.
Digging up info on the finish_installation process.

In this case, the app to be updated is the Amazon Cloud Drive program, which is legit.

Shows us where this executable is being called from.
Shows us where this executable is being called from.

Old Machine Resurrection

So I spent the past evening and a few hours today playing Mr. Fixit with my sister-in-law’s old college laptop. This one set some new records in terms of things that Ccleaner and Defraggler found and cleaned up: 2.2GB worth of junk files! 12000 fragmented files, 90000 fragments, 40% total fragmentation on a 32 GB partition! Gigabytes worth of Windows Hotfix uninstallers and System Restore Points well past their expiration date. No wonder it was running so slow.

The system was a labyrinth of old Toshiba support utilities running at startup, unnecessary Windows services, auto-update background programs waiting for new versions of programs last updated in 2006, and other myriad performance-sapping programs. When I started the optimization, there were 70 processes running at a fresh boot (and swapping constantly to virtual memory); when I finished, there were a reasonable 30 processes running. Then came the inevitable bump from Windows XP SP2 to SP3, and the countless security updates (104 needed right after SP3 came online), and then the security update updates.

There were other problems to be surmounted, such as a broken keyboard with some of the numbers and control keys not working (2, 8, 9, 0, alt, w, r, s, x; there’s a pattern here) and a broken trackpad + pointing stick. Those stupid eraser-shaped trackpoint controllers were all the rage since the Thinkpad, but they always seemed to have hardware problems in later life. I know this because I have a Dell on which I had to physically disconnect the trackpoint to fix the identical problem. In these cases, the trackpoint controller sends a flood of incorrect signals (via the PS/2 interrupt), causing the mouse to either move continuously to one side of the screen or the other. In Windows, you can’t disable the PS/2 controller and you can’t permanently remove it either. In Linux, I had to disable the i8042 Programmable Interrupt Controller (PIC) using “i8042.noaux=1”, or the X server would seem to get stuck while loading. This all made the initial work a bit difficult, until I managed to disable the trackpoint completely in the BIOS settings.

But, once all the optimizations are in place and the system is thoroughly scrubbed, it’s actually a fine little machine. The surprising thing is the solid pieces of tech that were built into this machine from 2005. It’s got Gigabit ethernet, a PCIe 16x-lane Nvidia graphics card, an Intel Pro Wireless 2915abg miniPCI card, and SATA 1.0 connecting the hard disk. Spending about $100 on extra parts (SSD, 2GB DDR2 RAM, new USB keyboard and mouse) today would probably give the machine another 5 years of useful surfing life and would let it run Windows 8 or Linux actually pretty well. The great thing is that even the bargain-bin SSDs would fully saturate this thing’s SATA link nowadays. And with 1GB DDR2 SO-DIMMs going for $5 a pop used, upgrading is almost an afterthought. Alas, it’s not my laptop.

As a measure of thoroughness, I’d been trying to scan the system using a variety of Linux-based antivirus rescue CDs. The first one up is BitDefender, available here:

http://download.bitdefender.com/rescue_cd/v2/

Unfortunately, the BitDefender rescue disk’s root mount has too little space to store the necessary antivirus definition updates, and it throws the following error dialog:

The aufs entry below is the filesystem that is completely used up.

To try to fix this, I set a symbolic link up that points to the USB stick’s storage space, which is mounted under /cdrom, then try moving the existing definitions over:

But it seems like this isn’t working either.

On this rescue CD, only root can write to the /cdrom mount, so I tried to update the AV definitions using a cumulative.zip file, which BitDefender provides here:

http://www.bitdefender.com/support/Manually-Updating-Bitdefender-Security-for-File-Servers-using-cumulative-zip-1043.html
http://download.bitdefender.com/updates/bd_windows_servers_v3/x32/cumulative.zip

But this hangs the system somehow as well and doesn’t actually seem to write to the flash drive. Maybe I can try putting the definitions on one of the mounted hard disks and pointing the symbolic link there.

Damn You, iPhoto, Part I

(Presumably there will be more of these entries?)

The running joke among its users is that iPhoto is the product of Apple’s worst software engineers, a sort of place where the least-talented programmers go to fuck with their customers’ most precious data. And really, who wouldn’t you want in charge of that?

I dismissed this strain of thought for a while, until I actually tried using the software. Let me think about some of the things that are missing and presumed dead, and which I generally have to revert to my Windows machine or Picasa in order to do quickly/properly:

  • Batch lossless rotation with changes saved back to the original file.
  • Useful batch redating.
  • Fixing/removing the EXIF auto-rotation tag.
  • Panoramas, anyone?

But the kickers were these four:

  1. A hardcore system crash while using iPhoto, returning from the single, fullscreen image view to the albums view. The mouse could still be moved, but pressing the keys to perform a Force Close on iPhoto didn’t work, and pressing the Power button didn’t bring up the Shutdown dialog. The crash forced me to have to log into my Mac via SSH and attempt to ‘sudo reboot’ it. Which then also seemed to fail, and which killed my connection after attempting to at least ‘sudo sync’ the drives. A hard poweroff, pressing and holding the Power button worked. But it’s pretty disheartening when a single product can kill your whole system like that. Yes, I realize this could have been a one-off; but no, this should never, ever happen in userspace.
  2. Why does iPhoto insist on importing photos into the iPhoto Library bundle? Yes, I have a Macbook Air with SSD, and no, I really don’t particularly dig it when the iPhoto Library bundle is 6GB because it wants to manage the files for me and makes copies of everything I’ve imported. I don’t have that much space, really. Perhaps this is good for people who don’t want the hassle of managing their data. But it doesn’t help anyone else at all. Or, I take that back. If you have every last photo in your iPhoto Library bundle, then yes, backup is super easy. But guess what, it doesn’t even organize the files properly by date, it organizes them into folders by the date on which they were imported. Which is sloppy.
  3. When I make changes on the disk to the original file, iPhoto doesn’t pick up on them? What kind of bullshit is that? Oh, it relates to and is fully explained by point 2 above, but it doesn’t help when third-party tools that handle lossless rotation do their magic and leave you wondering why the changes don’t show up. You have to reimport those files, and then confirm that you want the duplicates to overwrite what’s already in the library. Awesome.
  4. Why is RAW or NEF import so slow on iPhoto? My brother’s quad-core iMac is able to import maybe 1 file per second. As if conversion and import was somehow still single-threaded (well, it probably is, but I haven’t checked).

To my mind, it feels like iPhoto isn’t getting dogfooded enough or at least that there aren’t enough champions of digital imaging actually using it at Apple. Free is very hard to compete with, and there’s no doubt in my mind that this stuff isn’t winning based solely on innovation. It’s good enough to be usable, but it’s definitely not as spectacular or “magical” as one could imagine. (But I guess for that there’s Lightroom, et al…)

Django IntegrityError On PostgreSQL

The answer is here:
http://www.chrisspen.com/blog/handling-postgresql-integrity-errors-in-django.html

I was seeing IntegrityErrors while trying to unit test uniqueness constraints within a database table (it’s not strictly necessary, I suppose, but I was just being thorough, so much for trying to do the right thing):

What didn’t make sense was that the exact same sequences of calls would work just fine in ipython, they just wouldn’t work when under Unit test.

Turns out, whenever an IntegrityError happens while using Django and PostgreSQL, for whatever reason you need to close the entire connection to reset the transaction in the exception handler, which looks like:

Django Unit Testing On Shared Hoster

So I’ve been trying to write unit tests for Django, but, as I’m doing a lot of work on a shared hoster, this isn’t working. The problem is that our user account doesn’t have CREATE/DROP DATABASE privileges on the server. This has been documented here, here, here, and here.

Which means I see the following if I try to run manage.py test, I get:

Unfortunately, there isn’t a first-class solution from the Django devs, so after reading that django-nose had a handy REUSE_DB parameter, I tried to install django-nose.

(no-deps because I’m working with Django 1.5 beta 1)

Then, in settings.py, I set TEST_RUNNER=’django_nose.NoseTestSuiteRunner’, and set the TEST_NAME key on your ‘default’ DATABASES entry to the same value as NAME.

Unfortunately, you still get errors, if you’re trying to use PostGIS, seems like transactions may not be a happy thing there:

So it looks like the only option I now have is to write unit tests that just run against a development database, and do a decent job of cleaning up after themselves in the setUp and tearDown methods. Using the standard nose distribution will do this, but if you just do “pip install nose” and try using “nosetests”, it will error out:

The problem is that nose doesn’t know about Django’s settings or modules. You have to make a copy of nosetests into the same directory where “manage.py” is located and change it so the DJANGO_SETTINGS_MODULE is incorporated into the os.environ resource. Like so:

Then you’ll see:

$ ./nosetests
……
———————————————————————-
Ran 6 tests in 4.955s

OK
$