Clean install of OSX Lion on your Mac but keeping documents and applications
November 26, 2011
My Macbook Pro ground to a halt after 6 months of heavy usage.
It started to freeze up frequently preventing it to load anything from the hard drive. Things that already were in memory continued working but accessing anything from the hard drive or unlocking the screen saver took up to 2 minutes. Not even "ls -l" worked.
A quick visit to the Genius Bar and after running many hardware diagnostics test it was diagnosed as a software error. They weren't sure whether it was a problem just with the user account or whether it was in the system so the recommendation was to reinstall OSX.
Since OS X Lion (10.7) was out I thought I might as well install that rather then re-installing Snow Leopard (10.6).
Call me old fashioned but I don't trust OS installations over older OS installations. I prefer fresh installs from removable media so I starting looking for a method to install OS X Lion from fresh but it wasn't as easy as it should be!
By installing the OS X Lion on a new partition on the hard drive I was able to keep all my documents and application and move them across when needed.
What you need:
OS X Lion installer (purchased from Apple store)
An empty recordable DVD (it may be possible to install Lion from USB but I haven't tried that)
First you need to create a start-up DVD from the OS X Lion installer. The trick is to find "InstallESD.dmg" inside the Lion installer. You can navigate items inside the installer by choosing "Show package contents".

WARNING: The OS X Lion installer is deleted after you have installed Lion so make a back-up copy of it for future use!
Insert the blank DVD and choose to start Disc utility.

Drag InstallESD.dmg to left-hand side of the Disc Utility, select the newly added InstallESD.dmg and hit Burn (and Burn again). It will take around 10 minutes to burn and verify the DVD.
Time to restart your Mac. Hold down Alt (Option) when booting to be presented with what media to boot from. The DVD should be visible after a short spin-up of the drive.
You can choose to install OS X Lion over your older version but this will delete all your files and applications. Instead you may want to consider keeping your old installation and install Lion onto a new partition.
Once booted into the Lion installer, don't click continue but rather select Disc Utility from the top bar. Shrink your old partition to minimum possible, create a new partition in the newly created space and continue with the OS X Lion installation into that partition.
The installtion takes a good 30 minutes but once you have re-started and logged into Lion, your old partition is visible and you can copy items from it.
If you were using File Vault to encrypt your documents you have to navigate to /Users/<user name>, show content, double click on "sparsebundle".
You will be asked for your original password and it will be mounted as a new image. You now have access to your old documents and application settings.
Most application you can simply drag from /Applications on the old partition but first copy the application settings (bookmarks, settings, accounts, passwords and etc). There are two places where the old application settings live:
<user home>/Library/Application Support/<application name>
<user home>/.<application name>
You need to show hidden files for this. You can enable hidden files by entering the following in a terminal window:
defaults write com.apple.Finder AppleShowAllFiles YES
Good luck and enjoy a clean install of OS X Lion (10.7)
Keywords: mac apple Lion OS X Lion hidden files InstallESD.dmg
JSR 303: Combining custom and standard validators
July 12, 2011We are using the JSR 303 Bean validation API (Hibernate validator as the implementation) on a project and recently faced a problem.
Whenever we were using our own custom validators in combination with standard validators like NotNull and NotEmpty, the standard validators seemed to be ignored.
The result was that we were getting NullPointerExceptions in our custom validators and sometimes we were getting duplicate error messages for the same invalid field.
I haven't poured over all of the JSR 303 documentation in detail so maybe I've missed a recommended best practice but the following code in the default NotBlankValidator gave me a hint.
public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) { if ( s == null ) { return true; } ...Why would you ever return true (i.e. valid) for an input that is null? That doesn't make sense until you realise that validation is a *combination* of all constraints.
This means that your validator should only return false for your specific test. If it fails for a chained validation, for example if input is null, it should return true and rely on the NotNull validation to report that error.
You still have to guard for null and empty inputs but return true if they occur rather then returning false.
Hide any required basic validations inside your custom constraint annotation. For example NotBlank does that:
... @NotNull public @interface NotBlank { ...
Keywords: java jsr 303 hibernate validator validation
Bali with children
February 02, 2011
We just completed what I believe to be our first adventure with our kids; a trip to Bali, Indonesia.
Our children are 4 and 3 years old and we were contemplating whether they would be able to handle the 17+ hours long *day* flight and the culture shock.
I'm glad to report that it all went spectacularly well and our children have memories for a life time.
We started out in Ubud which is a wonderful place busting with culture, music and art craft.
While the Mrs enjoyed browsing the markets and shops the kids were much more keen on excursions. Luckily there are a lot of activities in and around Ubud that are just a short drive away.
Monkey Forest is a little pathway in the local forest which is filled with curious and cheeky monkeys.
You can buy a bunch of bananas by the entrance to give to the monkeys but watch out, once they get a whiff of the fact that you are carrying their favourite dish, they will not leave you alone until they have robbed them all.
Out of 50+ friendly monkeys there was one that hissed at our daughter but we just moved on swiftly and didn't have any further problems.
The elephant safari park is just an hour away and while outrageously expensive ($100 for the four of us) the kids loved the elephant ride and feeding the elephants.
To be honest you can give the 20 minute elephant ride a miss and just enjoy the elephant park.
Favourite restaurant: Cafe Lotus and Wayan Cafe
Favourite stay: Kori Ubud
After a few hectic days in Ubud we decided to relax at the beach for the rest of the holiday.
Out of all the various beach locations in Bali like Kuta, Seminyak, Legian, Nusa Dua and Sanur we opted for Sanur. Crowded with retired ex-pats and families with young children, Sanur seemed like the perfect spot.
Half-way between Ubud and Sanur is the lovely bird park. Walk around the aviary and see that many, many colorful birds up and close.
The kids loved discovering all the different bird species (from tiny to large) but the highlight was when 3 birds were placed on each of them. Great photos in the park btw!
Sanur is a very laid back town with the usual tourist shops, bars and restaurants but no chaos (like in Kuta). You get the occasional guy on the street calling "taxi?" at you but nothing intense.
We had such a great time in Ubud doing daily excursion we decided to continue with the theme.
First day out was a busy day with Uluwatu temple, white beach and water sports at Nusa Dua, Dreamland Beach and food at Jimbaran (no sunset).
Just a sad word about Dreamland Beach; it is totally wrecked. Car parks, sewage like water, hordes of "local" tourists and an abandoned concrete construction. Give it a miss!
Going north turned out to be a much better direction. More rice fields, temples like Tanah Lot and Batukaru, lake Bedugul and hot springs. All in all some of the best sights Bali has to offer.
Waterbom is a water park in Kuta. Again it is a very expensive experience compared to other less touristy activities in Bali but it is a wonderful break in pace for the kids.
We spent a whole day swimming, running around and sliding down various slides. The kids loved it and it's needless to say they fell asleep early and hard.
Favourite place: Tanah Lot
Favourite stay: Tandjung Sari
Favourite restaurant: Tandjung Sari
In summary Bali turned out to be a great beach and sightseeing holiday with the children. The combination of Balinese culture, nature, people and great value was just unbeatable.
DO IT!
PS Wayan, Made, Nyoman and Ketut are Balinese names where Wayan is the first born, Made the second and so on. If you want to get some laughs and instant acceptance from local people call your kids Wayan and Made and watch their sweet reactions.
Keywords: bali children ubud sanur indonesia travel
Logitech Squeezebox receiver with flashing red light
December 24, 2010
Got a Logitech squeezebox receiver the other day and after plugging it in to my switch, I assumed it would just acquire an IP (using DHCP) and just start working.
After 2 hours of changing network cables, restarting various network devices and a little bit of cursing I retreated to Google for some help.
Turns out that the Squeezebox receiver is not to be used on its own. It is to be used together with a controller and the controller is required for initial configuration.
The only reason Squeezebox receivers are sold on their own is for people that want additional receivers for their rooms.
In my case I knew there are mobile applications that can control the music playing or that one can even connect to the web interface of the Squeezebox Server.
The controller is twice the price of a receiver and being the cheapskate I am I didn't want to fork out extra money just to configure my receiver.
Two options:
1) Borrow a controller from a friend
2) Use Net::UDAP to find your SqueezeBox receiver on the network and to configure it
Net::UDAP is a Perl module so if you are not familiar with Perl programming just download the following executable:
For a wired configuration (not WiFi), you can use the below command sequence:
discover
conf 1
set interface=1
save_data
reset
Followed by:
discover
conf 1
set squeezecenter_address=[ip address of your computer running squeeze server]
save_data
For a wireless configuration use instead:
discover
conf 1
set interface=0 lan_ip_mode=0 lan_gateway=192.168.3.1 lan_network_address=192.168.3.10 lan_subnet_mask=255.255.255.0 primary_dns=192.168.3.1 wireless_SSID=3Com wireless_wep_on=1 wireless_keylen=1 wireless_mode=0 wireless_region_id=14 wireless_wep_key_0=[WEP key] wireless_channel=11 squeezecenter_address=[ip address of your computer running squeeze server]
save_data
reset
You will obviously have to be connected to the receiver via a network cable to be able to configure it.
Type help or fields to list all device fields along with some documentation of the values they can take.
Check out the Net::UDP project page for more information and don't forget to donate if this solves your problem!
Keywords:
Batalha Animal – Do you love animals?
July 01, 2008
Do you love animals and are you thinking about a different way to make a difference?
Do you feel disgusted, angry and heartbroken to see a suffering animal?
Would you rather want to make a difference and truly help out?
This is a remarkable story of an ordinary working mother that all by herself changed the fate of over 150 dogs left to die. This during 16 years of love, dedication and hard work.
If nothing else, it will at least warm your heart to hear it.
Very different from the reality in the UK, abandoned animals in the streets of Sao Paulo, Brazil are numberless. They are living in the most deprived conditions and are suffering from chronic (but often preventable) diseases and starvation.
Most of the abandoned animals are at first perfectly healthy but it is just a matter of time before they are victims of cruelty, disease or fatal accidents in the mad traffic.
For these unfortunate (hairy) souls, there is little to nothing available in the governmental system that could help them. Instead they rely solely on the pity of animal loving individuals.
That is a bit how Ines Sanches, an ordinary working mother of 55 years, started on her path of helping suffering animals in the city.
Living in a busy part of Sao Paulo, she was walking home one evening when a shrieking sound made her head turn: a passing car had hit a young dog with full force. She rushed to the scene, only to hear from the dog owner himself that he had no means to help the poor animal, and that he was going to leave it there to die.
Appalled by the cruelty and disregard, Ines did not think clearly and took the injured dog home. This despite her own busy life full of problems and lack of funds and space.
She named the badly injured dog Madona and against all odds, with time and proper care, Madona made a remarkable recovery. Little did Ines know, that that event would change her life forever.
Madona turned out to be a fantastic companion to all the family. Lifting up the spirits of the household when they most needed it. She turned their lives around with her gaiety, contentment and recognition that in a way, Ines had saved her life.
From that moment on, Ines realized that she simply could not turn her back on the agony of the animals abandoned or injured in the streets of Sao Paulo and despite her own difficulties, she decided to do something about it.
Ines started by taking the suffering animals into her own house, nurturing them, caring for their wounds and diseases and then putting them up for adoption.
Quickly Ines realised that she needed a bigger site to accommodate the dogs while they were getting well enough to be ready for adoption.
16 years has now elapsed since Madona had been left to die on the road and today Ines and a team of volunteers care for 150 dogs collected from the streets of the city in a purposed build kennel, funded solely by the charity of friends, family and passionate dog lovers.
Although this may seem basic compared to the UK initiatives such as the Dog’s Trust, Battersea Dogs Home and the RSPCA, I can’t stress enough how major this is for the cruel reality of Brazil.
Ines' initiative stands out for the longevity and professionalism. Her dedication to the project has overcome many difficulties in the last decade and despite the total lack of sustainable funding by the government, she has managed to secure a loving home and a much brighter future for the animals she has rescued.
As a fellow Brazilian dog lover, it makes me terribly proud to see what Ines has build up over the years. Facing the related financial challenges is very unique.
I know that many of you already have a continuous commitment to various charities which is maybe why I dare to ask if you can honour this amazing initiative with a donation. After all we are talking about changing the dark fate of suffering animals in one of the most violent and ruthless towns in South America (yes, my home town).
David has created this post to enable non-Brazilian residents to make a donation via paypal. We will collect all donations received and forward them to the Batalha Animal latest appeal (translated on the page) with a note from all of you.
If you have donated then thank you so much for helping, please feel free to share the story with other dog lovers you may know. We truly appreciate it!
If you are not able to donate than thank you for reading this far and please mention a word about Batalha Animal to your friends next time you have the chance.
Batalha Animal cares today for 150 dogs in a beautiful site with 5000 square meters. Batalha Animal has a live website with photos where they keep the interested parties and patrons informed on the use of the resources and on the development of the pets they care for.
For more info, lots of pictures, news and developments, here is the link to their local website:
www.batalhaanimal.com.br
Carla
Keywords: batalha animal dog charity donation cruelty brazil




