Archive for November, 2007

Leopard + Juniper Network Connect + Subversion + VMWare Fusion -> how to

So you upgraded to Leopard (10.5) and now you cannot connect to subversion repository at work because Juniper Network Connect is fooked. Fear now, here’s the workaround, though it requires some pre-requisites:

- Leopard
- VMWare Fusion (or similar I suppose) running a Windows VM
- That’s it

1) Run the Windows VM
2) Install SVN Tortoise if you don’t have it already (http://tortoisesvn.net/downloads)
3) From the windows vm, open your vpn connection to work
4) Still on windows, browse to the mac file system (Z:/…) and then to your work directory
5) In file explorer, right-click your work directory and “SVN update”. If this works, you’re done

Back to the mac, do your changes there, then cmd-tab to the windows vm to svn update.

Not as easy as when the VPN client wasn’t broken, but it’s something.

Comments (1)

ActiveRecord#update_attribute saves the entire record

Let’s say that you need to update one attribute in an activerecord:

my_record.update_attribute("some_column", "some_value")

you might expect that only “some_column” will change, but that’s not what happens. When you call update_attribute the entire row (object) is saved, and validations are bypassed!

This might surprise you (it surprised me), especially the no-validation part. This means that it’s possible to corrupt a record in the database, by setting a column to an invalid value (for which there’s a validation). Then call update_attribute on a different attribute, and bam, the invalid field is saved along with the attribute being updated.

The proper way to update attributes while still invoking the record validation is to call update_attributes (notice the “s”) and pass it a hash of attributes to update:

my_record.update_attributes("some_column" => "some_value")

This will still save the entire record, but at least validations will run.

(more about ActiveRecord here)

Comments

pvp and leopard “spaces”

WOW PVP + Leopard Spaces = bad combo

ctrl-2 is supposed to be my “get the hell out” key when pvping in wow, but it’s also the switch to space 2 in leopard.

Luckily if I play in fullscreen mode (command-M) then wow wins over leopard. Whew…

Comments

leopard - more headaches - admin account no more

I like to have just one admin account per box, which is also an account that is used just for admin stuff. All the normal accounts are just standard. Nothing weird there I don’t think.

Well, I just noticed that after last night install marathon, something else happened and now my (only) admin account is fooked. He’s just a standard account like everybody else. That makes it hard to do anything of course.

After some research, this is how you trick 10.5 into creating a new admin account:

- Reboot while holding Command-S to boot in single user/root mode
- type: mount -uw /
- type: rm /var/db/.AppleSetupDone (actually I renamed it, just in case, but didn’t need to use the backup version)
- type: reboot
- 10.5 will think this is the first time you’re running the system, will ask you a couple of questions (registration, etc) and for an admin account. Create a temporary one now.
- Should be about it

I got to say though, I have to thank Apple for making it easier on us Windows refugees to upgrade the OS. I feel right at home with the blue screens and other snafus.

Comments (2)

leopard - stuck at the log in screen

I installed Leopard on 3 systems and the first two were mostly flawless. Only mostly though:

- You can no longer start mysql from the preferences pane. If like me you had to start mysql after rebooting (I like to control what resources my system uses…got that from Matt) start the preferences pane, change to “automatically run on startup” (or something) and reboot. MySQL should be running after that.

- The other slightly bigger issue is that I can no longer VPN into the office. Juniper Network Connect is broken on Leopard. Apparently Apple forgot to publish certain Intel binds. I tried going back to an older version of the Network Connect client and encrypting libraries, but it didn’t work. For now I can’t work from home. Sucks.

- Finally, the biggest scare was last night when I upgraded our brand new iMac to Leopard. I chose “upgrade” (instead of new install) just like for the 2 other systems. Big mistake. When 10.5 was finally installed and it rebooted for first log in, was when the pain started. I have four users on that box, and none of them could log in. After entering the password, it would show a blue screen for a second or two, then back to the log in screen. Frigging annoying.

I was really looking forward to sleeping an extra hour last night, instead I slept 4 hours less. That’s how long it took to fix the problem as I reinstalled 3 more times. Apparently there’s a known issue that makes Leopard fail in similar ways, but it’s related to “long passwords created in 10.2″. That wasn’t my problem but I tried the alleged fix anyway. Sure enough, it didn’t help.

Ultimately what fixed the problem was to do a “full install” instead of an “upgrade”. I was worried about full installs at first as I was under the wrong impression that it would take much longer or that it would lose my settings or whatever. None of that happened.

If you’re stuck on the log in screen after installing Leopard (upgrade) do this:

- Put the DVD in the drive
- Reboot while holding the C key (not Command-C, just C). This will make your system boot from the CD
- After the installer starts and you’re choosing how it should run, at some point you can bypass the default options. Do that and instead of upgrade choose full install. In addition to a clean install, you will have a new directory with the relevant files of your old/current OS.
- Install
- Wait an hour (remember to skip the disc verification thing, if you already know the DVD is fine)
- Enjoy

Comments