Archive for the ‘Apple’ Category.

updated svn+ssh with DreamWeaver article

After various Mac system and security updates found that ssh+svn would result in errors…

svnserve: Command not found.
svn: Connection closed unexpectedly

Updated my previous article on using svn+ssh with DreamWeaver with a solution.

apple security update 2009-001 breaking PowerPC apps ?

Since installing this update I observe on my intel based mac that two PowerPC based apps now crash immediately on launch. Logging “Exited abnormally: Illegal instruction” to the console. The two applications affected so far on my system are CanoScan Toolkit X and more importantly Retrospect. Unfortunately the installers for both applications also fail with the same error. I worked around the canon issue by installing the LiDE 35 driver (for my LiDE 50) – then using “Import image…” in Preview. However not found a workaround for Retrospect yet. Looks to me like Rosetta is not working properly, although I have one PowerPC process running “RetroRun”.

Annoying and scary for my backups to be crippled in this way. Investigating. Not sure it was the security update as yet, only ‘evidence’ being the timing of the failures.

Update: Solved…

The following typed into terminal, followed by a re-start fixed the problem…

sudo update_prebinding -root / -force

As per instructions by Charles Minow in this thread on the Apple support discussions.

AS3 reference docs on iPhone / iPodTouch

Really handy! … ActionScript 3, Air and Flex documentaion distributed as an application on iPhone and iPodTouch – by Mike Chambers.

Downloaded it, had a play, simple and effective. A ‘back’ button would be nice though in future versions 🙂

2006 iMac? perhaps AppleCare more important

Having just read a tale of woe regarding  a dead 2006 iMac, and the indications that this may be a particular issue with those machines, it is looking like AppleCare should be considered by owners far more seriously than normally would be the case. If the logic board dies in the way described, the machine as a whole, which should realistically be good for a couple more years productive life, will become an echonomic right-off.

While initial cost of ownership of Apple machines stacks up with similarly configured PCs, the cost of repair – particularly of the logic board is shocking.

Links:

migrate from file to svn+ssh for Dreamweaver CS4 on Mac

I’ve been using subversion for a few years now. Initially used through subclipse within Eclipse/Flex Builder then later also used with Dreamweaver sites using tools such as svnX and scplugin along with the “Cloak SCM directories” command. In most cases to date, I have used the “file:///” protocol as this provides direct and efficient access to repositories which are available within the local system or local area network. I had been looking forward to subversion integration in Dreamweaver and when the CS4 public beta was released I had a bit of a moan about the absence of the file protocol. Despite my efforts in the beta’s forum and the Dreamweaver wish-list, it remains absent. So now to look to using a different protocol.

There is a helpful 3 part article on the Adobe site describing how to get started with dreamweaver CS4 and svn. In part 3, the author chooses to present how jump through the hoops to get Apache to serve and access a local repository over http. There are a number of reasons why this approach is not right for me:

  1. svn served using mod_dav_svn through Apache over http is less efficient than svnserve through ssh.
  2. I have multiple repositories, one per project and all stored on a separate project disc. To use the http method, I would need to edit httpd.conf to add a directory mapping and manage access rights for each repository.

By using svn+ssh, svnserve launches on demand (no need for a running daemon) and we have access to all the paths available to the ssh user logged in.

So, to get this going on Mac OS X 10.5…

Turn on ‘Remote Login’ in the ‘Sharing’ system preferences. Rather than using the default of allowing access for all users, I restricted access to only my user.

At this point you should be able to use sv+ssh urls from within terminal. e.g.

% svn info svn+ssh://user@computer.local/Volumes/full/path/to/repository

However if you try to use the same connection in a tool such as svnX you are likely to get error : ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory

To get around this we really need to establish public key authentication, which also serves to avoid you having to use your user account’s name and password for the connection.  Based upon this article on OpenSSH, I did the following:

% cd
% cd .ssh
% ssh-keygen -q -f id_rsa -t rsa

If the .ssh directory doesn’t exist, then use mkdir to create it. ssh-keygen creates both public and private keys.

Update 16-Feb-2009: Since writing this and applying an number of mac system and security updates i today found that any attempt to ssh+svn would result in…

svnserve: Command not found.
svn: Connection closed unexpectedly
[exit=1]

To solve the issue (based on notes here and here) I prefixed line 1 of id_rsa.pub with:

command="/usr/bin/svnserve -t"

As this is my one and only public key, I simply uses the following line to copy the public key to a file called ‘authorized_keys’. However if you are dealing with more than one key, you should use the guaidance in the OpenSSH article to append the key to that file.
%  cp id_rsa.pub authorized_keys
Once this has been done, attempting to use your svn+ssh  url within svnX should now work. Note: you may get the error re-displayed, but it will dismiss to be replaced by a current view of the repository. Also the first time, you will be prompted for the password. Here you need to enter the passphrase you used when you created the rsa key. I chose for this to be remembered in my keychain to avoid having to retype it in future.

With this done, you are now ready to contemplate setting up Dreamweaver. You need to be aware that an subversion working copy knows the url to the repository from which it was checked out. If your existing DW local copies of sites are subversion working copies checked out like mine via the ‘file:///’ protocol, you need to migrate them to ‘svn+ssh://’ so:

  1. Firstly ensure that everything you need to retain from your working copy has been committed to the repository
  2. Drag your working copy to the trash
  3. Create a new folder to contain your local site
  4. In Dreamweaver create a new site and manage the settings accordingly, pointing the local site to the folder you just created.
  5. In the version control category of the site definition, choose ‘Access Subversion’
  6. Protocol SVN+SSH
  7. Server address is your local computer. i.e. ‘computername.local’
  8. Repository path is a full path to the repository then further on down to the folder containing the site. In my case, each repository is split into trunk, branches and tags folders, and my site folder named ‘webroot’ is a sub-directory of trunk. So my path will read:  /Volumes/full/path/to/repository/trunk/webroot
  9. Server port remains default
  10. Provide your user name
  11. Leave password blank. The connection will be authenticated using the RSA public key
  12. Click the test button and you should get the message “Server and project are accessible!”
  13. CLick ‘Ok’, to leave the site definition
  14. In the file view, right-click the site folder and choose Version control > Get latest versions
  15. The latest versions of the files in the repository will be checked out of the repository into your local folder which will now become a working copy.

Job done.

sensible(ish) code print from flex builder (on MacOS X)

Continuing the theme of occasional Flex Builder hints and tips…

Occasionally I need to see code printed on paper. Unfortunately the printing capabilities of Flex Builder, or more specifically in this case, Eclipse, are a bit messy…

  • the font is huge, and only 49 lines fit on an A4 page
  • if you have a background colour set to your code window, it gets printed – decimating your ink-tanks
  • printing is a two dialogue process – you have to go through Page Setup each and every time.

Of course in the actual Print dialogue, you have the standard Mac ability to change the page layout, paper handling etc, and save that detail in a pre-set. However…

The key things I want to achieve is to print 2up full duplex black and white, which gives me four pages of code per sheet of A4, and with a slightly smaller font size I get a more respectable 68 lines of code per ‘page’.

However I’ve found the following approach, once set-up, a little more convenient, and becomes a one-click print…

The Mac has a GNU enscript installed which converts text files to PostScript to send directly to CUPS. In my case I had to update the old Gimp-Print drivers to the current Guten-Print drivers in order to achieve duplex printing.

More information on Guten-Print and access to the drivers on SourceForge. The DMG contains good documentation and a simple package installer.

Once the new drivers are installed, and I’d recommend a new, additional, print queue be set up with appropriate defaults for your code printing, you need to set Eclipse to run an external script to print the currently active code window. From the menu: Run > External Tools > External Tools…

  • Name: enscript
  • Location: /usr/bin/enscript
  • Arguments: -2rT4v -DDuplex:true -diP5000 ${container_loc}/${resource_name}

Obviously you’ll need to tweak the arguments according to your personal print configuration.

External Tools Dialogue

flex, mac, external browser

Ted Patrick has been quite prolific of late at publishing little productivity hints and tips. I think this one from a couple of weeks ago is worth echoing and noting the workaround for the problem it raises on a Mac.

We are setting up Builder to launch the help pages into an external browser. The key advantage of which being that the code samples can then be copy/pasted. On a Mac there is a recognised bug in eclipse that if you choose Firefox as the external browser, and it is NOT your normal system default browser. Basically Eclipse attempts to launch a second instance of Firefox which will generate the “Only one copy of Firefox can be open at a time” dialogue…

Firefox close dialogue

So to get around this, you have two options.

Option 1, if you have Firefox as your default browser for the entire system, simply choose “Default system Web browser” in the Eclipse preferences panel.

Option 2, if you want to keep something else set as your system default browser e.g. Safari, but would use Firefox for displaying Flex Builder help, you need to either edit or create a new external browser entry using a command structure as per comment 5 on the eclipse bug sheet. Essentially the following settings work…

  • Location: /usr/bin/open
  • Parameters: -a firefox %URL%

Flex Builder > General > Web Browser >Edit external browser

initial gripes with new Flash CS3 ui

I know – I’m turning into Victor Meldrew. I can’t seem to help it. Should Adobe sort out the current licensing and pricing nightmare I’m going through, I’m sure I will become more chilled.

While others have been hung up on the new icons, personally I have no issue with them. They remind me of Rowntrees Tooty Frooties – which is not a bad thing! My issues (admittedly minor) are with some of the work on the new user interface.

I can appreciate the general investment in improving the UI. However I find some of the additions odd, and on my system some seem poorly implemented?

1. Introduction of Windows style controls on the Mac.

Most of the palettes introduce a collapse control (-) and close control (x) in the top right-hand corner. Mac convention is for the close control to be top left control and in both cases I think aqua controls and positioning would have been better – more consistent with other (non Adobe) applications.

I also find it strange that most palettes introduce this new arrangement, but other ‘windows’ retain the standard Mac behaviour (e.g. document windows and the control window). Mixing it up in this way just feels odd.

DebugController

2. Palette drag

When dragging a palette, it will go semi-transparent. Potentially useful – being able to see what will be covered up before dropping the palette into position. This is also part of the softening of the UI and should enrich the user experience. But on my system, when the mouse is released, the palette disappears briefly before being re-drawn opaque. This ‘flicker’ when a palette is released is plain ugly and detracts hugely from the user-experience. Until it is fixed I would have rather not bother with semi-transparent efforts.

I guess this might be an issue with my system being quite old? (Mac G4 Dual 1GHz Mirror).

3. Welcome panel links to the Adobe site are not working as intended

I think this is just an issue of the Adobe site not having been updated to service the links. You’ll find that from the Flash Welcome window, clicking on either “Getting started ››” or “New features ››” simply dumps the user at the flash product page. The problem seems to be server-side. The pages which flash attempts to take you to, simply re-direct back to the product page.

We fare slightly better with “Resources ››”. However most of the content on that page is written for FlashMX 2004 or Flash 8. I think by now there should be some CS3 articles on there.

Hopefully that’s the end of today’s grumpiness. Although I just read the SaveAs Gotcha written up by Aral. 🙁

Apple Security Update 2007-004 stuffed my Mac

Ok, this may be guilt by association, but since allowing this update to install last Friday, I have experienced serious problems. Many other folks around the web have reported problems with this update, but I haven’t yet found any postings covering the issues I encountered.

In recent years, I have been of the opinion that it is best to keep up-to-date with the latest patches, as the security risk of not being patched out-weighs the risk of the patch itself causing problems. This is the first time I have had cause to doubt this approach.

This entry attempts to describe some of the problems and the efforts I made to fix them. However I should probably have done this from the outset and saved myself a lot of time. I still have some residual problems, but the worst of it seems over. Note: None of this constitutes advice. Repeat any of my actions at your own risk.

The machine concerned is a Mac Dual 1GHz G4 Mirror.

My user data, and work data are all regularly backed-up using Retrospect, and I keep all my work data on a non-system disk. So I was able to tinker around confident in the fact all my important data is protected. However I don’t currently back-up the system or applications. The theory being that they can be restored by a fresh install of both the system and applications. That said, it would take a long time!

The symptoms…

  1. Firefox would crash almost immediately on launch
  2. FontBook crashed immediately on launch
  3. Most other applications would ‘unexpectedly quit’ after a few minutes operation. Such applications include:
    1. Safari
    2. Mail
    3. DreamWeaver
    4. Terminal
    5. TextWrangler
    6. The Dock !!!

Re-installing Firefox had no effect. It still crashed at the point after rendering the Mozilla title bar in the default site.

However, of these (3) is the most serious. Apart from anything else, crashing applications degrade document data over time. My first instinct was to think this may be due to a hardware problem, specifically failing memory?

I ran Apple Hardware Test a number of times, after-which I was relatively confident that the memory was ok. No problems were reported.

Using the Console utility to view the crash reports, it was clear that the applications where crashing each with the same instruction…

Exception: EXC_BAD_INSTRUCTION (0x0002)
Code[0]: 0x00000002
Code[1]: 0x902d6690
Thread 0 Crashed:
0 ATS 0x902d6690 AnnexFileFlushUnusedAnnexEntries + 24
1 ATS 0x902d5f54 ActiveContainerTimerFired(__CFRunLoopTimer*, __CFDictionary const*) + 248

I had no idea what ATS was at this stage. But stands for Apple Type Services. There are various MacFixIt articles describing some fixes with respect to ATS cache files. So I did spend a whole load of time as Super User in Terminal, deleting / moving the cache files and restarting to see if there was any difference – there was not!

I later read that starting in Safe Mode should effectively clear the user’s ATS cache, and only activates system fonts. However even in this mode, applications continued to crash in the same way.

My next consideration was that I may have a damaged font? So I ended up paying to upgrade my Suitcase X1 to Suitcase Fusion which includes FontDoctor. (My old copy of FontDoctor simply quit immediately when trying to launch it with the system in this state.) The new FontDoctor did run and did find fault with two of the system fonts – something to do with a finder flag. These were repaired. That solved the problem with regards to FontBook crashes. The remainder of the crashes continued.

The only thing that worked…

I downloaded and installed “Mac OS X 10.4.9 Combo Update (PPC)” from the Apple Downloads page. BUT! My first attempt was to do this on the machine concerned. Big mistake! The install failed, and at that point the machine would not shut-down normally nor would it fully start-up again when re-powered.

Fortunately I had an old G3 PowerBook to hand. Combined with a FireWire cable, I restarted the G4 in Target mode and re-installed the combo update onto the G4’s system drive from the PowerBook. (That’s the first time I’ve used Target mode and I’m well impressed – really useful)

This worked. I no-longer have applications crashing. Firefox now works fine. OpenOffice still failed, but once that had been re-installed, that is now working fine.

Residual problems…

There are still some residual issues I need to track down. For instance I can no-longer connect to my Windows server through SMB. It gives error type -50 – what that means I have no idea.

I can also see that I continually get errors I suspect from my use of RSS in Safari which seems to occur for each feed I am subscribed to.

2007-04-24 12:21:29.002 SyndicationAgent[410] WARNING: BestCalendarDateFromString – can’t interpret: ‘Tue 24 Apr 2007 03:12:14 -800’

In future…

  • Maybe it is time I started backing up the system and applications in addition to my home dir and projects drive – allowing me a quick revert should this kind of system update mess things up again in future.
  • Maybe I should give an update a week or so for brave soles to try out, before adopting it myself.

UPDATE 30/4/2007: Today I re-installed the security update. Doing so did not re-introduce the problems described above, and seems to have solved one of the residual problems: I can once more connect via SMB.

i finally hot-fixed flex builder

The hotfix was published a few weeks ago. I had been suffering the debug problem on the Mac (193086), so it was time to apply the fix. (NOTE: Unless you are suffering any of the problems listed you are adivsed not to bother applying this fix)

I found the instructions more confusing than they needed to be. They essentially boil down to ‘make a backup copy of your current installation prior to applying the fix’. This is kind of vital, because if you do a straight replacement of the old “Flex SDK 2” folder with the fixed version, and you happen to use charting, you’ll find that the charts.swc is missing!

Also you need to be aware that first time you run the application after the fix, you will need to re-enter your serial numbers.