Archive | Apple RSS for this section

Prevent BBedit to open last documents

Since MacOS X Lion (10.7.x) we are “blessed” by the general option that documents we have worked on the last time are automatically opened the next time we start up an application.

While we can argue if that is a boon or not, I personally don’t like this “feature”. Especially, when the last opened document has had errors or crashed the application.

Today, I was not able to open a document in BBedit and it crashed completely. But sure enough, the next time I opened BBedit again it tried to open the same file again, resulting in crashing again.

After some trial and error I figured that holding down the shift key during the startup of BBedit it will disable loading of previous documents. I hope this helps someone else out there.

Yes, I know there are ways to disable this globally. But in case one does not want to disable this feature globally.

Prevent high CPU usage on MacOS X Lion

Since upgrading to MacOS X 10.7 Lion and its update to 10.7.1, I’ve have had my fan coming on a lot of times. Something I have hardly every experienced with Snow Leopard. It seams that many are also experiencing this issue as the Apple discussion boards prove.

One of the “solutions” that have worked for me is to disable spotlight (I really don’t need it) with the following command (issued in the terminal):

sudo mdutil -a -i off

Another one was to remove any spotlight plugins that applications like Microsoft Office, Parallels, etc. put into your “/Library/Spotlight” folder. This helped big time.

Last but not least, you can also remove any processes that are being launched during startup which might cause a high CPU usage. In my case, I disable a couple of launchdaemons. The command to do so is:

sudo launchctl unload -w /Library/LaunchDaemons/{application}

Say, you want to remove the startup parallels daemon you would do a:

sudo launchctl unload -w /Library/LaunchDaemons/com.parallels.desktop.launchdaemon.plist

Hope this helps anybody out there. After all, there is still hope that Apple finally brings the much needed update that helps fix some issues that came up in MacOS X Lion.

 

Seamless server access from MacOS X to Ubuntu with SSH public keys

When you access a server over SSH you usually get asked for a password that you trustfully type into the terminal window. But doing so is insecure for many different reasons (I’m sure there are many people who wrote about this before and describe it better then I ever could). So, what is a better way to log into your server then? The best way so far is a method called “public key authentication”.

So, since we want to add security to our belt, we can simply use this technique for our SSH access as well. On MacOS X it is actually very easy to setup.

First up, you need to create your own keys. Doing so, is straight forward, all you have to do is to open up a Terminal window and type “ssh-keygen”. This will then prompt you some questions, where to put the keys (use default) and for the passphrase (I would suggest you use a good password). In the end, it will save your keys (your private one and a public one) to your .ssh directory.

Now what you got your public key, all there is left to do is to copy your public key to your server. In case you have root access to your server, it is simply a manner of doing it with “scp”, like:

“scp ~/.ssh/id_rsa.pub root@{yourserverdomain}:.ssh/authorized_keys”

This will copy your public key to the “authorized_keys” of the server.

Once done, you can now simply log into your server with ssh root@{yourserverdomain} without the need to enter a password since your server and you exchange keys for authentication.

Troubleshooting

When you copy your key to server you might get a error that the file “authorized_keys” is not found. If so, then simply create the file on the server and issue the copy command again.

 

Experiences with the iPhone and Internet Tethering

IMG_0164.PNG The last couple of weeks, I have had to use the Internet Tethering function that comes with the iPhone. During the course of this time, I made some interesting experiences that I would like to share.

Phone Calls
There is one thing I learned the hard way when I enabled Internet Tethering and wished that someone would have told me. That is, that when you don’t have a 3G coverage, like only Edge (the “E” in the upper left corner as shown in the images on the right), you will NOT be able to receive any phone calls during Internet Tethering.

Thus if you need a Internet Connection and you want to be able to receive calls make sure that you are on a 3G network.

Battery
We all know that the iPhone has miserable batterie life. When you enable Internet Tethering you have two options how you want to connect to the iPhone. One is over Bluetooth and one is with the USB cable.

For keeping your iPhone “alive”, I recommend that you connect it over the USB cable. Thus you will not drain your iPhone batterie extensively and will charge your iPhone at the same time. but there are two important things to know about this method:

1. While your iPhone is connected over the USB cable and charging it will also suck the batterie from your MacBook extensively. So, make sure that you connect your MacBook to the power outlet when you have your iPhone hooked up per USB.

2. Contrary to the above I have noticed that the iPhone is NOT being charged, even thought connected over USB. The reason for this is that as more connection you have open over the Carrier network the less the Mac is able to charge the iPhone. It is like the connection (of the USB cable) is fighting with the power, since both go over the same cable. The remedy is to lower your usage for the connection, like closing your eMail application or lowering how many times you get your eMails.

Other things…
Some of the things that I wished would be really different from a user perspective are;

… Every time I have to make a call, Internet Tethering is automatically turned off! Meaning I have to reenable it manually after the call is done. That means, clicking on “System Preferences”, then on “General”, then on “Network”, then on “Internet Tethering”, then enable it and selecting “USB”. That makes it 5 steps, 5 steps too much!

… The iPhone does not switch from Edge to 3G automatically. The only remedy I have found to this is to enable Airplane mode and the disable it again. Right after, the iPhone selects the nearby 3G network (until the next time it is back to Edge).

Setting up Apache2, PHP and MySQL on MacOS X – the easy way

Today I set out to get MySQL and PHP setup on my MacBook Pro. Since Apache2 already comes with MacOS X (mine is Snow Leopard and yours should be too!). Now, the funny thing is that I first searched on the web how to best install PHP and MySQL.

Surely, I came across MAMP (a package that gets you Apache2, PHP, MySQL and a couple libraries) in a nice one click application and some others. Being the guy who rather has things separated and controllable, I quickly shined away from those. Thought, I gave MAMP a try, but could not get MySQL to listen to anything else then the internal Apache2 server from the MAMP package (but guess that is another story and I’m really not doing this the first time.). Anyhow…

I then looked into getting Apache2, MySQL and PHP with MacPorts. Thought MacPorts has proven to be perfect in such circumstances, I had a hard time (and it took very long) to get this setup up and running. I’m sure, some of you have had successful installs and all works great, but at the end it did not work for me. There are even more instructions to get PHP running, with a lot of tweaking and such, but to be honest in the end…

Really the simplest and most straightforward method to get Apache2, MySQL and PHP running on MacOS X is;

MySQL

Now, this is really no brainer. All you need to do is to go to http://www.mysql.com and download the recent release. Within the download image you will find a nice installer and Preference pane which lets you start/stop MySQL. If you want to go all GUI, then also download the GUI tools from MySQL.

Apache2/PHP

The probably easiest of it all. Since MacOS X already comes with Apache2 and PHP all you need to do is to enable it. Thought, PHP is disabled in the httpd.conf, all there is to do is to edit httpd.conf and uncomment the mod for the php library.

That’s it!

Nothing to install, (almost) nothing to configure. Simple and easy.

A petition to Apple to drop AT & T

Thought this to be quite useful for my American friends.

Apple or not – that is the question

The recent eMail von Jason Calacanis and his blog post entitled “The Case against Apple in five Parts” brought a little up stir in the Apple world. The recent reply came from Marco.  You can read their back and forth on Jason’s take on Apple and make up your own mind. I have read all the blog posts so far, but I have been missing one simple thing!

The one single thing that makes me use Apple products is that they simply work!

I have used Windows, Linux and MacOS X over the last couple of years. Hell, this blog post is even being typed on a Thinkpad with Windows XP, but nothing has ever been an hassle free experience then with using Apple products, be it hardware or software.

When has there ever been a more relaxed operating system update then with MacOS X? All you have to do is to pop in your DVD, run the update and know for sure that it will reboot safely with the new update. Moreover, with the applications itself you don’t need to run trough a “painful” installations with minimum five “OK” clicks (I know you Windows guys don’t see this as a problem because you are used to!), on MacOS X you simply drag and drop an application to the place you want. Nothing else!

iPhone is another topic that people like to argue about. Sure, the hardware is behind the current standard. Bluetooth does not work with cars and you might have to reboot your iPhone sometimes. But, have you ever used a Windows Mobile and did you every try to sync it with your Windows OS? I hate to repeat myself, but with the iPhone all I have to do is to hook it up to my Mac, sync it with iTunes (including Music, Photos, Videos, etc.) it even takes over my eMail settings and my eMail and Calendar just works. Symbian based phones and Windows Mobile ones require you to spend at least an hour fiddling with setting and try and error attempts. I don’t think I have to start arguing about the usability of the iPhone. Apple has done something, that for many years no one could. It brought a phone that simply works and is easy to use.

Remember the “plug und play” wording? Well, what is a “myth” in the Windows and Linux world is a fact with MacOS X. You got a new digital camera? All you do is connect it and the system recognizes it, iPhoto opens and there you got your photos. No hunting for a updated driver , no installation, no reboot needed, nothing else, just plug it in and start working. Isn’t that worth the little more money you got to pay?

Regarding the price, I do have to say that a Dell Lattitude E6500 with the same configuration as an Apple MacBook Pro 15″ will cost you about the same (at least in Switzerland). Price is not everything. And when it comes down to usability you save a lot more then with the initial cost when you use something that simply just works.

For me, and I’m sure for many other people, it is the Apple eco system that saves us money in the long run because it just works!

Setting the correct Java version under MacOS X

My favorite scripting language is CFML, or as some know it as ColdFusion. I like it because it is very very powerful, easy to use and can do just about everything your xyz language can do.

For many years, ColdFusion was a closed sourced system, where the former Macromedia and now Adobe got the copyright of the code. Luckily, this has changed when OpenBlueDragon (OpenBD) came to play with the first open source CFML application server. So, now the CFML world got a very nice open source CFML language and server. Our very own open source Digital Asset Management – Razuna – runs on OpenBD as well and comes bundled with it.

Anyhow, the reason of this blog post is not CFML, but how to set the correct Java JRE environment under MacOS X. Then why did I mention CFML and OpenBD in the first place, you might ask?

Well, today I downloaded the latest version of OpenBD which runs now on Java 1.6 and is 64 bit. But when I tried to start our server (Tomcat) with the new OpenBD jar I got the following error messages in the log.

at org.apache.catalina.startup.
Bootstrap.main(Bootstrap.java:413) Caused by: java.lang.UnsupportedClassVersionError: Bad version number in .class file (unable to load class com.naryx.tagfusion.cfm.application.cfHttpSessionListener)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal (WebappClassLoader.java:1854)

As we can see from the “Bad version number…” in the above line there must be some misconfiguration of the Java runtime going on. But wait, does my execution of “java -version” not state that I’m running the latest Java version? Reading from those lines, you could think so.

java version “1.6.0_13″
Java(TM) SE Runtime Environment (build 1.6.0_13-b03-211)
Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02-83, mixed mode)

Apparently when one looks into the Java paths of MacOS X we see that the current “JDK” is set to 1.5 and not 1.6. Judging from this, I tend to think that Apple is not setting the JDK right for Java applications. You might say, well then just set it in the “Java Preferences”, right? Wrong, I already did that as the screen below shows).

Java Preferences

So, in order to solve this, I set the correct JRE_HOME variable in my .profile in order for all Java applications to pick up the current JRE. To do that, you simple edit your .profile (with vi ~/.profile) and add the following lines to it:

JRE_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
export JRE_HOME

Save it, open a new terminal window (or close and open one) and start Tomcat. Now Tomcat is picking up the new JRE path and Java application, in my case OpenBD, that depend on the Java 1.6 JRE version will run.

Reading books on the iPhone

I love to read. I like to get as much knowledge as possible into my system. So far, I have been an “old style” book reader, meaning I actually bought a book in paper form and read it. But in the light of a greener environment and saving trees I wanted to go more into the eReader craze.

stanzaThere has been a lot of buzz around the Kindle 2 in the last weeks, but I just did not want to carry around another device. Since I already have a iPhone I was looking for a solution for the iPhone itself. After some searching I found Stanza. Stanza is available as a Desktop application and as a iPhone application, also. Since, both applications are free of charge there was actually no need of holding back.

I have to say, that I was highly skeptical, but I have been reading 4 books in the last couple of weeks with the Stanza application on my iPhone and have to say, that i was pleasantly surprised how good the reading experience was.

The application itself is very well made and easily understood. With a tip on the left of the right side you flip pages, with a tip in the middle you get some information about the book. Reading the book in landscape mode is just a move away, and Stanza is enough intelligent to stay on the same page and even move a bit if the pages have more text landscape mode. You can set bookmarks, also.

Reading books was actually very easy on the eyes as you can adjust the size of the test sizes, the same way as you would within Safari. You can change the color, text font and much more. But I have to say, that the default settings were just about perfect for me.

I have to say, that one of the best features must be that you can transfer eBooks from the Desktop application the iPhone with a single click. All you do it enable “sharing” in the Desktop application and within the iPhone you can browse “remote books” and download them to the iPhone. Nothing easier then that. All in all, I have to say, that the Stanza iPhone application must be one of the best iPhone application ever made.

Actually, Stanza must have made a big impression out there, so much that Amazon bought the company behing Stanza the other day. In any way, I hope that Stanza will not get lost into the migration of Amazon, but in the long run, I wonder if Kindle for the iPhone and Stanza for the iPhone, both from the same company really makes sense.

The almost perfect sound and TV setup

I am a huge fan of making my life “simple” and not complicated. After all, life around us is already complicated with all that is going on, so why bother taking it home, right?

That is also one of the reasons, why I use Apple Hardware and, to some extend, Apple Software. Not that I don’t know how to work with Linux or Windows, but Apple has one thing going for them, that is “It simply works”. That is true when it comes down to their Hardware, Operating System and Phone. You could argue, that this and that feature is not there and Apple is mediocre in their feature set (thought, this is mainly true), but I think because their not overloaded with features they have less to worry about and again it boils down that “it simply works”.

In that regard, I set out the other day to get my sound and TV setup right in my house. Something which I thought will take a long time, took merely minutes to get everything up and running. I took a new Mac Mini as the center of my “Hub”, meaning I have iTunes running on it, got it connected to my Apple Airport Extreme (with 2 Airport Express devices on other levels in the house) and have my Stereo connected to another Airport Express device. Then I also hooked up the Mac Mini to my TV Set.

remote_controls20080916Now, the best part of this setup is that I can control iTunes and the Mac Mini from everywhere in my house with my MacBook Pro, or from my wife’s MacBook or from my iPhone. Yes, iPhone!

Did you know that Apple has a great little iPhone app that allows you to control iTunes directly from your iPhone? I didn’t and so I as totally blown away when I found this little gem of software, called “Remote“. Once installed, again it took a minute to install and setup, you can control iTunes and Apple TV right there from your iPhone.

I remember when I was invited by Apple to come over to a MacWorld keynote and I saw Steve Jobs talking on the Apple Hub idea. His vision was that Apple devices become the Hub, the center of your life. Well, I have to say that they achieved it. Well done and thank you.