GCC on your Mac without Xcode, Fink, or MacPorts
1One of the most annoying things about Apple charging for Xcode is that you now need to pay $4.99 for an easy way to setup your dev tool chain on your Mac. You don’t have to pay, there is always Fink or MacPorts but that too involves hassel.
Fortunately, there is now a third free option!
All you need to do is install the three packages contained in this zip. The packages came directly from the Xcode installation package, but as they don’t generally contain Apple specific code I think it is fair to redistribute them as you are not getting the awesome Xcode IDE and associated Developer Tools, you are just getting the bare bones binaries which allow you to such magical things as run “./configure && make && make install”!
N.B. This has only been test on Mac OS 10.6, when 10.7 comes out it is likely that I will need to re-upload the files.
Installing sha1sum on Mac OS X
0A tool that we use on the Roo project which provides a _fairly_ platform neutral sha1 hashing mechanism is sha1sum. The problem is that this tool isn’t included on Mac OS X. I have found a number of posts on the net on the topic of installing sha1sum on Mac OS, but all seem to reference outdated sources and in addition to this installation ends with an error.
To have the latest and greatest sha1sum on your Mac with no error upon installation all you need to do is the following:
- Download the latest GNU Core Utilities from here
- Decompress it and run “./configure –prefix=/usr” this will install sha1sum to the standard directory instead of “/usr/local/bin”. You can of course install the latter, but using “/usr” will cause a number of other tools to be updated in the process of install sha1sum.
- Run “sudo make && make install”
You may find that you need to install gcc and a few other dependencies to compile the code. The easiest way of doing this is downloading Xcode. If you are not up for paying for Xcode you can always just install each missing dependency, though this can be a tad tedious.
Install and setup S3cmd on a Mac
3The Roo project has recently setup continuous integration (we are currently using Hudson but will soon migrate to Jenkins) to hunt down committers that break the world, push documentation out faster, and reduce the need for developers to wait for final releases or build Roo from master to access fixes. As part of this we leverage S3cmd to automate deploying snapshots to S3. I initially thought that in order to install S3cmd on my Mac I would need to Fink or DarwinPorts it up. Not so. To install and setup S3cmd on a Mac all you to do is:
- Download S3cmd and extract it
- Run “sudo python setup.py install” from command.
- Finally, run “s3cmd –configure” from command to configure S3cmd.
And that is it, how simple! Make sure you are not running as root when performing the final step as to not create a config file that is only accessible by a root user.
How to make GWT 2.2 work with GIn
1Whilst not officially announced GWT 2.2 is out and it breaks GIn. To get around this you will need to recompile GIn with GWT 2.2, or, if you are lazy, you can just download the jar that I prepared earlier
If you choose to recompile GIn yourself you just need to:
- Checkout GIn, instructions here
- Change you GWT_HOME to point to GWT 2.2, this is just an environment variable
- Build GIn via ant by running “ant dist”
Maven tips (if you aren’t using Maven you are done)
If you are using Maven you will need to manually install the jar using the following command (make sure you replace LOCATION_OF_RECOMPILED_GIN_JAR with the physical location of the jar you recompiled or downloaded):
mvn install:install-file -DgroupId=com.googlecode.gwt.inject -DartifactId=gin -Dpackaging=jar -Dversion=1.0-SNAPSHOT -Dfile=LOCATION_OF_RECOMPILED_GIN_JAR/gin-1.0-SNAPSHOT.jar |
Once you have installed the jar you will need to edit the pom to add in the required dependencies (guice-3.0-rc2 and guice-assistedinject-3.0-rc2), locate your Maven repo and then open “gin-1.0-SNAPSHOT.pom” which is located in your .m2 directory (the default location of your .m2 directory is your user home directory so the file should be located at ~/.m2/repository/com/googlecode/gwt/inject/gin/1.0-SNAPSHOT/gin-1.0-SNAPSHOT.pom) and then add the following just above the closing project tag (</project>):
<dependencies> <dependency> <groupId>com.google.inject</groupId> <artifactId>guice</artifactId> <version>3.0-rc2</version> </dependency> <dependency> <groupId>com.google.inject.extensions</groupId> <artifactId>guice-assistedinject</artifactId> <version>3.0-rc2</version> </dependency> </dependencies> |
Profiling Spring Roo with Java VisualVM
1This post was born out of seeking to improve the performance of the GWT add-on in Spring Roo but the material is applicable to profiling any part of Roo or any application for that matter.
Before you do anything launch Java VisualVM from Terminal, or equivalent, by running “jvisualvm”. This wil launch Java VisualVM and you should be presented with the following (you may be asked to calibrate).
The “org.springframework.roo.bootstrap.Main” process is the one that we are interested in. Double click on it and select the “Profiler” tab. Check the “Settings” checkbox and designate which classes you want to profile. The more specific you are the less of an impact profiling has on your resources. I was only interested in the GWT add-on so i limited the scope to that add-on’s package as shown below.
Now uncheck the “Settings” checkbox and set the pause flag in Roo to attached profiler.
A flag was recently added to Roo’s launch script (ROO_HOME/bootstrap/roo-dev), which when set causes the roo to pause at startup to allow a profiler to be attached. The pause flag can be set by uncommenting (by removing the preceding hash i.e. #) the following line:
PAUSE="-Droo.pause=true" |
Once this line is uncommented the next time you run roo execution will be paused until you press a key. If all has gone according to plan you should be see the following.
Now go back to Java VisualVM and click on the “CPU” button. It may take a moment to attach so be patient, if for whatever reason you are stuck on “refreshing…” please restart your machine and try again. You should see the following output in the Roo shell once the Profiler is attached.
Press any key once the profiler is successfully attached continue launching Roo. If any methods of interest are encountered they will be displayed by Java VisualVM, below is the output whilst monitoring the GWT add-on.
Let’s take things dockside
0
Google have added a very cool feature to Gmail Labs today called “Unread message icon”. The new addition basically renders a favicon image which displays the number of emails you have yet to read. Those readers savvy enough to be using Chrome with the “Google Mail Checker” may be wondering why this is of interest to them, seeing as this appears to duplicate a feature that is already present in the aforementioned extension. One of the cool things about this new Lab is that it pays attention to what type of inbox you are in, i.e. Priority or Standard. The second cool thing is that it isn’t Chrome limited, with Firefox 2+ is also supported.
The new Lab feature is clever but Google really needs to do more. Both Mac and Windows provide in-dock notification systems, why can’t I register to receive notifications there? I know the standardised Notifications API is fragmented across platforms (at this point of time I think you need to Growl for Notifications to work on Mac OS and Windows supports it natively?), but why can’t you make use of what you currently have in the in-dock space. This is one of the limitations of using Gmail as my email client, I need to be in the browser to know if I receive an email (Google Notifier people shutup, I don’t want another menu icon). Also if I receive an IM via Gmail’s GoogleTalk, I should be notified dockside too.
[Update 27/01/2011] Google just announced that Gmail is now making use of the Notifications API. Even better than the favicon, especially for chats, but I still think dock based notifications in Gmail is the ultimate. Similar to how iChat and Mail alert the user to new emails and IMs.
Safari and iTunes combined
0MacRumors is reporting on claims that Apple is planning to combine iTunes and Safari into a single application. Whilst in many respects this seems like a somewhat unusual move (who in their right mind would want to have the memory footprint of Safari just to listen to a few tunes) it also is somewhat natural progression.
Let’s break iTunes down into its constituent parts, we have:
- a media player, which can be further broken down into physical media (music and videos) and streamed content (radio);
- a media management tool for music, video, books, apps, and ringtones;
- a media store, a place buy all of the media mentioned above; and,
- a social network, in Ping .
Except for the physical media component of the media player everything else can be transitioned to the web space. The iTunes store is essentially just a web app wrapped by iTunes, the same goes for Ping. Media management is something that really should live in the cloud, if I have playlist on one of my iOS devices it should be mirrored on iTunes and all my other devices. Cloud based media management is really just about syncing a library file representative the current state of your media, it is not rocket surgery.
There has been recent turmoil that iTunes has grown into a monster, this is rubbish as integrated is always better than segregated and iTunes is just wrapper for a bunch of web based services. If Apple moves to a streaming model, where purchases can be downloaded but the default is for them to be streamed from their shiny new massive data centre and cached locally based on preference, then there is absolutely no reason why the monolith that is iTunes is needed in its current form. Whilst I personally don’t see a iTunes/Safari hybrid in the wings, I do see the rest of iTunes moving to a web-based platform; that is media playback and management. The maybe Apple may release an iTunes plugin which interacts with a local library but means that iTunes is present when you browse. It makes a lot more sense for Apple to offer a web-based iTunes, which can be accessed regardless of browser, and plugins than it does Apple requiring users Safari to access iTunes services.
How to downgrade Safari 5.0 to 4.0.5
3I recently started to get back into GWT development and was shocked to find that my app kept freezing in Development Mode whilst using Safari on my MacBook Pro. The problem didn’t seem to occur in Firefox just Safari. So I searched using the symptoms as my guide “gwt dev mode crash safari 5″ and lo and behold someone has already reported the issue.
The submitter was using 10.6.3 and I am using 10.6.4 but the procedure should be the same.
- Download Pacifist and Safari 4.0.5 (when I downloaded it from Apple it was really slow)
- Open Pacifist, do this first so by the time you need to use it the 15 second delay has ellapsed
- Mount the Safari 4.0.5 image and open the Safari 4.0.5 package (Safari4.0.5SnowLeopard.pkg) with Pacifist. You can do this either by dragging the package on top of the Pacifist window or icon.
- Once open select the first item in the list and click the “Install” button at the top.
- A pop-up will appear, tick the “Use Administrator Privileges” box and press the “Install” button
- Another pop-up should appear telling you that the “Application already exists”, just tick “Don’t ask again for this installation” box and press the “Replace” button
- It will probably tell you a couple more times that a file already exists in which case just repeat step 6.
Once the installation is complete you will be back in Safari 4.0.5 land and able to use Dev Mode on your Mac!
Upgrading an Australian Tivo’s hard drive
0I have just installed a WD1002FAEX in my Tivo after my GreenPower 1TB hard drive failed. It is working well, nice and fast, though a little noisy.
This is just a brief list of what you need to do. If you have more questions just ask in the comments.
- Open Tivo by unscrewing the 6 Torx-15 screws at the back of the unit (you will need a Torx-15 screwdriver)
- Remove the hard drive by unscrewing the 4 Torx-15 screws
- Remove the hard drive from its caddy (the metal thing) by unscrewing he 4 Torx-15 screws at the base of the drive
- Go to a Windows computer and download WinMFS
- Plug the drive into a computer via SATA
- Open WinMFS and backup the hard drive (in WinMFS go to File->Backup->Tivo Hard Drive)
- Shutdown the Windows computer and connect your new drive and power it back up again
- Open WinMFS and restore the image to your new drive (in WinMFS go to File->Restore->Tivo Hard Drive – find the image of the backup you made earlier and press restore)
- Put everything back together and you are done.







Recent Comments