SamCogan.com

Archive for December, 2008

OSX Java Problem – LSOpenFromURLSpec() Failed

Wednesday, December 17th, 2008


I was getting netbeans crashing with this error today, so looking into I found its down to the latest update for Java causing the JVM to try and run 64bit code, on 32 bit systems, which it doesn’t like, and crashes.
So the following commands in the terminal fixed it for me. Bear in mind this has to be done as root, so consider the consequences!
Open Terminal.app, become root (sudo -s) and run the following commands.
(The ‘#’ is the shell prompt showing that we’re running as root)

# cp -p /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java /tmp/java_original_binary
# lipo /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java  -remove x86_64  -output /tmp/java
# cat /tmp/java > /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/bin/java

Tags: ,
Posted in OSX | 7 Comments »


My Apple Store Joy!

Tuesday, December 16th, 2008


My Macbook pro broke last week. It had been slowly breaking for a while. The keyboard and trackpad would stop worki9ng for 5-10 minutes, and then spring back to life. On Friday it didn’t spring back, it stayed dead. External Keyboard and mouse were fine.

I took it into the Meadowhall apple store (which was hell on a Saturday before Christmas), expecting the answer of “we’ll have to send it away”. Instead the guy on the genius bar took a look at and said “come back in 2 hours and it’ll be fixed”. I did, and it was.

Picked it up, had a new top assembly and keyboard, would have cost £250, cost me nothing as I have applecare, I’m glad I bought that; it’s just paid for itself.

Posted in Uncategorized | No Comments »


Disk Space in Powershell

Sunday, December 7th, 2008



Continuing with my project, I needed a way to get total and free disk space on the server. PowerShell Saves the day again with this command:

gwmi win32_logicaldisk -filter "deviceid='c:'"|select _Server,<request>


Replace request with size to get total size
Replace request with freespace to get freespace

Details of all comands for win32_logicaldisk are here:

http://msdn.microsoft.com/en-us/library/aa394173.aspx

Posted in Uncategorized | No Comments »