Dave Landers

Dave’s thoughts (such as they are)

Archive for the 'Tech' Category

Lion upgrade issues

I just upgraded my MacBook Pro to Lion yesterday – and thought I’d summarize the things I’ve found so far:

The first thing to note is that, except for some issues noted below, this was a pretty smooth upgrade.  I usually don’t like upgrades and prefer to do a clean install and reconfigure or move stuff over.  But the upgrade install itself was pretty good.

I had terrible problems with Spotlight indexing – I think mdworker crashed about 10 times yesterday trying to get through the initial indexing.  It is possible that it was colliding with Time Machine trying to backup the 9Gb or so that changed during the upgrade.  Not sure, but now that it has (eventually) finished the initial index pass, it seems OK.

I had things just plain lock up several times – usually I was trying to get my Eclipse projects refreshed and rebuilt, and maybe that was deadlocking with the Spotlight vs. Time Machine issue.  I don’t know, but it really annoyed me to reboot and have Lion reopen the very thing (Eclipse) that caused me to reboot in the first place.

Reboot (or even logout/in) should start you off clean, IMHO, not “where you left off”.  If I wanted to be where I left off, I wouldn’t have rebooted in the first place.  I should at least have an option to turn this off (globally and per-app).

I had trouble getting my work calendar (CalDAV) to sync.  I eventually fixed it by deleting all the entries for that server in Keychain.  We hit the same server for Calendar, Mail, and IM, and several of the keychain entries were accessible by Calendar, and a few of those were old – so maybe it was confused about which one to use.

Something changed in Java (other than the install location).  I have stumbled upon two issues with WebLogic Server:  First, I now need to bump up my MaxPermGen even for a basic web app to deploy – I’m now using -XX:MaxPermSize=256m (before Lion these apps were getting by with the default).  Also, WLS is now not happy with Lion’s IPv6, and won’t bind to any port unless I specify a v4 listen-address (

I don’t really want my laptop to look/act like my phone.  That’s probably why I don’t like the new look in Mail.  So it’s Classic layout (under Prefs -> Viewing), and View -> Show Mailbox List.  Then, System Prefs -> General -> Sidebar icon size to Small so my mail folders (yes, I’m old-school and still use folders for mail organization) fit in the window.

I do think I might like Launchpad – although it could sure use some tooling to help make the configuration better.  But I finally think I got it usable enough to trim down my Dock.  A couple of hints:

  • You can drag an app from Finder onto the Launchpad icon (in Dock) to add an app (outside of the Application folders) to the Launchpad.   I got Eclipse.app into Launchpad like this.
  • You can bind Launchpad to a key shortcut in Sys Preferences -> Keyboard -> Shortcuts -> Launchpad.  Check Show Launchpad and enter a shortcut.  I went with Command-F12.
  • There doesn’t seem to be a (good) way to remove icons from Launchpad, and it’s pretty cluttered with everything.  So I made several groups/folders (whatever they’re called) to hide the junk, and tossed them on the last page.

The biggest surprise for me is that I am almost used to the upside-down scrolling thing.  I thought I’d hate it, but it seems like it might be ok.

Comments are off for this post

Network Location Switching

Been quite a long time since my last post, and I am not going to try to catch things up.  But I did want to archive this information:

At work, we have an http proxy – an idea from the 18th century it seems.  So I have to have two Network  Locations (one for normal configurations, another for the work proxy).  We also use Cisco AnyConnect VPN to connect from home.

I had been using MarcoPolo for switching locations.  This worked great for home and work, but I wasn’t happy with how it worked with the VPN.  All I could do was detect if the VPN application was running or not – so I couldn’t leave the VPN app open and connect/disconnect.  Also, the process was to launch the VPN app, wait for MarcoPolo to switch the network to VPN, make sure it was stable (not switching back and forth), and then connect to the VPN. Disconnecting has to be followed by exiting the VPN else MarcoPolo wouldn’t switch things back to my no-proxy Location.

I took inspiration from this and created a LaunchAgent and a simple script to switch Network Locations.

The LaunchAgent plist file goes in ~/Library/LaunchAgents/com.srednal.netswitch.plist, and looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

The script, in ~/bin/netswitch, is something like this (names and addresses may have been changed):

#!/usr/bin/env ruby
# Test network and switch locations based on vpn and ip address
require 'ipaddr'

# see if VPN is connected
def vpn?
    connected = false
    IO.popen( '/opt/cisco/vpn/bin/vpn status' ) do |out|
        out.each do |line|
            connected = true if line =~ />> state: Connected/

# are we on work network?
def work?
    # Work IP will be within  10.345.678.00/24 - obviously this is something you need to tweak
    work = IPAddr.new('10.345.678.00/24')

# lookup local ip addr
def local_ip
  orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true  # turn off reverse DNS resolution temporarily
  UDPSocket.open do |s|
    s.connect '', 1  # IP is anything
  Socket.do_not_reverse_lookup = orig

# set network location config
def location(name)
    system "/usr/sbin/scselect '#{name}'"

if __FILE__ == $0
  # let things settle down
  sleep 2
  if (vpn? || work?) then
    location 'Proxy'
    location 'Automatic'

The script can be run manually to test things.  Then load the launch agent with launchctl load ~/Library/LaunchAgents/com.srednal.netswitch.plist.

After I got that working, I went into the Info.plist file of the AnyConnect client app, and added (to the dict element)


That makes the Dock icon go away (but leaves the icon in the status bar), so now I can leave the AnyConnect client running and just connect/disconnect as needed – the LaunchAgent and script keep my network location set right.

1 comment

Colorado Software Summit wrapup

It has been a great week – I’ve now got a lot of things to dig into more. There were things I learned directly from the sessions, and other stuff that I picked up outside the sessions themselves.

I need to try out Virtual Box to host Linux on my Mac.

I want to look at World Community Grid and maybe contribute to something useful rather than my iPhoto screensaver.

I wish I could find an excuse to build an iPhone application – there were several good iPhone development sessions this week. Looks like fun.

I have this proxy application that I wrote and have re-written several times to investigate various technologies. I have a MINA version, and so was interested in the MINA talk this week. After that talk, I think I will now have to re-write it again to wire up the MINA filters and handlers using Spring.

I need to play more with JMX to understand how to use it for configuring and monitoring. Maybe I’ll do this as part of that same MINA/Spring update.

Simon Phipps, talking about standards, asserted that standards should be about Substitutability not Interoperability. That is, if we concentrate on building a standard that lets us Substitute one thing for another we will have a more useful standard than when we focus on interop. I’m going to have to think about that one.

And on Monday morning, I plan to clear the whiteboard and grab the slides and my notes from Subbu’s REST talks – because I have a RESTful service API to build.

What a great week. I am educated, informed, inspired, reconnected … and tired.

Technorati Tags: , ,

Comments are off for this post

Colorado Software Summit Day 2

More good sessions today, but the best was from my friend Subbu, who talked on Pragmatic REST.

Subbu gave a really great overview of REST – what is it, and how do you do it. This is especially going to help me as I am just starting a project to build a RESTful API for WebLogic Portal, so I have this timely reminder to serve as a guide – thanks, Subbu!

If any of you are interested in REST, I suggest you check out his blog and his slides from this conference (they should end up on the conference web site eventually, or Subbu said he would post them to his blog soon).

Technorati Tags: , , ,

Comments are off for this post

Colorado Software Summit

I enjoyed day one of Software Summit, now we’re on to day two.

Yesterday, I attended several sessions. Highlights for me included Bryan Basham’s Becoming a JavaScript Wizard and Simon Roberts’ What OO Doesn’t Address

I don’t actually do much JavaScript – I spend most of my time doing server-side stuff. But last year I made a conscious decision to shed my decade-old prejudice against JavaScript, and found it to be a language with some interesting concepts and features. It happens to have most exposure in a browser, but the Java Scripting API (and the inclusion of Rhino in JavaSE) now makes it a compelling option on the server. Bryan spent some time talking about the language basics before diving into browser-based stuff (he mostly talked about prototype for this).

Simon’s talk surprised me – I almost skipped it. I was going by the title, which doesn’t do anything to represent Simon’s entertaining and energetic presentation style. The main take-away I got from this is that we “Software Architects” are (should be) mainly around to inject reality into the design. That is, a pure OO domain model won’t necessarily consider things like security, performance, scalability, networks, usability, etc. Satisfying these concerns requires insight, experience, and a high-level understanding of lots of conflicting issues. And it often means backing down from an ivory-tower design purism.

We had some interesting weather come through in the afternoon – lightning, thunder, and rain. Then it turned to a rain snow mix – some really huge flakes mixed in with the rain. Very wet. The temperature was I thin just a few degrees too warm or we’d had a great snow.

The sun is coming out this morning, and I’ve got some good looking talks on my schedule. Should be another good day.

Technorati Tags: , ,

Comments are off for this post

Next Page »