Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Thursday, November 19, 2009

Running VirtualBox in Headless Mode

I first started using Parallels on Mac OS X, later switched to VMware, and now use VirtualBox, which I love. But I have to say that I don't particularly fancy its UI. I find it inconvenient that you need to first hit special key (by default command) to escape the VirtualBox environment. Frankly, I'd rather use Remote Desktop to connect to VirtualBox. And now I do.

The process is rather simple. I'll start assuming that you already have a working VM setup in VirtualBox:

  1. You can have multiple VMs setup in VirtualBox. In my case, I have only one, named "Windows 7". To know the name of your VM, from the command line run:
    VBoxManage list vms
  2. Once you know the name of your VM (which I'll assume to be "Windows 7"), start the VM with:
    VBoxHeadless -s "Windows 7" &
    I like to start VirtualBox in the background, hence the & at the end of the command line. This is because VBoxHeadless doesn't output anything to the standard output after it has started, and you don't want to stop it by mistake by hitting ctrl-c, as you would loose the state of you VM. Instead you'll want to save the VM state (more on this below).

  3. Start Remote Desktop. If you are on a Mac, Microsoft has a free Remote Desktop for OS X. Connect to the VM using Remote Desktop using the host name or IP of the machine running VirtualBox. For instance, if you are running VirtualBox and Remote Desktop on the same machine, that would be localhost.

  4. To stop VirtualBox while saving the state of the VM, run:
    VBoxManage controlvm "Windows 7" savestate
    Next time you start VirtualBox (as in step 2 above), it will used that saved state.

Monday, June 09, 2008

TextMate Keyboard Shortcuts

Those who have been reading this blog know that I like IntelliJ and blogged about it a number of times in the past. But let's admit it: IntelliJ is a big guy. It is heavy. Starting IntelliJ takes minutes. Even alt-tabbing to IntelliJ after not using it for a while can take minutes. And all this on a fairly top-of-the-line laptop. This led me to experiment with other editors, in particular TextMate.

TextMate compares more to Emacs or SlickEdit. So it won't replace IntelliJ for everything, but I have been using it for a week and it worked quite well for simpler tasks. For those of you who would also be starting to use TextMate, I put below a list of the keyboard shortcuts I use the most. I hope you will find it useful, and if you have other suggestions please post them in the comments.

Bundles1
Subversion: ^⇧ A
Diff: ^⇧⌘ D
AckMate (powerful "search in project" using ACK): ⇧⌘ A
Git2: ^⇧ G
MissingDrawer (replaces the standard Project Drawer)
JavaScript Tools: ^⇧ V to run JavaScript Lint
Line/block operations
Select current word: ^W
Select current line: ⇧⌘L
Duplicate: ^⇧ D
Delete: ^⇧ K
Move: ^⌘ up/down
Re-indent: ⌥⌘ [
Indent left: ⌘ [
Indent right: ⌘ ]
Find
Find in project: ⇧⌘ F (but ack is better)
Copy to find buffer: ⌘ E
Go to file: ⌘ T
Go to symbol: ⇧⌘ T
Incremental search: ^s
Copy/paste
Paste previous: ⇧⌘ V
Paste stack: ^⌥⌘ V
Reveal and Project Drawer
In project: ^⌘ R
In Finder: ^⇧⌘ R
Move focus from editor to project drawer: ^⇥
Move focus from project drawer to editor: ⇧^⇥
Bookmarks
Create bookmark: ⌘ F2
Go to next bookmark: F2
XML
Type tag pair: <⇥ (then type tag name, then ⇥ again)
Insert closing tag: ⌥⌘ .
Misc
Completion: Esc
Show all the shortcuts that apply in the current context: ⌃⌘T
Disable/enable check spelling as you type: ⌘⌥ ;
For the sake of how it looks: the green moleskin icon3

1 To install a bundle, copy the MyBundle.tmbundle directory in your ~/Library/Application Support/TextMate/Bundles.
2 If you like me, your Git binaries are in /usr/local/git/bin, after installing the Git bundle, set TM_GIT to /usr/local/bin/git (in the TextMate preferences, Advanced, Shell Variables).
3 From the Green Moleskin package, I only use their gorgeous icon. Download the package, unzip it and you'll find the icon in Green_Moleskine/Etext Icon/moleskine_textmate.ico. First cp "Green_Moleskine/Etext Icon/moleskine_textmate.ico" /Applications/TextMate.app/Contents/Resources/TextMate.icns. Second, open the icon in Preview, select all, copy, go to the Finder, do Get Info on TextMate.app, click on the icon on the top left of the window, and paste.

Tuesday, April 08, 2008

Twitterrific Wishlist

Twitterrific is a great little program. If you are a Twitter user and have a Mac, I can wholeheartedly recommend it to you. But it could be even better, so here is my wish list for Twitterrific:

  1. New feature: A new search or filter, so we can quickly see all the twits with a certain keyword, or from/to a certain person.
  2. Consistency: Show outgoing direct messages in the timeline. Incoming direct messages can be shown, but the messages you send are never shown.
  3. Bug fix: The text field looses its focus when alt-tabbing to another application and then coming back to Twitterrific.
  4. New feature: Support for multiple Twitter accounts used at the same time. (From what I read this one is coming.)

Tuesday, February 26, 2008

Gmail IMAP + Apple Mail + lots of messages = Constant disk activity

January 21, 2009 – See update at the bottom for a solution to this issue.

I am a long time Gmail user, but have started using Apple Mail with Gmail over IMAP just a few weeks ago. Lately I noticed that:
  1. The disk activity is almost constant while Mail is running.
  2. Mail is constantly synchronizing and downloading messages from the
    server.

The almost constant disk activity is the most annoying issue, as all the applications feel sluggish when Mail is heavily using the disk, as if the machine was swapping. I can see the constant activity of Mail with fs_usage -w -f filesys Mail.

Message synchronization is causing lots of downstream network traffic (constantly about 20-30 KB/s). As annoying as this is, with a pretty good connection, this level of network traffic doesn't have as much immediate impact as heavy disk activity.

A few data points:

  • My All Mail contains more than 110,000 messages, about 2.4 GB or 35% of the Gmail quota.
  • My ~/Library/Mail folder weighs a little more than 5 GB.
I haven't found any good solution to this issue yet. If you also have this problem, here a couple of workarounds:
  • Exit Mail when you are not using it. (I had to state the obvious.)
  • To avoid exiting and starting Mail, you can stop the process and resume it. To stop it run killall -STOP Mail, to resume it run killall -CONT Mail. Some applications don't like being stopped and resumed; I haven't noticed any negative side effects with Mail, but use this at your own risk.
And of course, if you have a hint or advise, please post a comment here. I will make sure to update this post if I hear about a solution.

A Solution
Go to the Mail.app preferences. Under Accounts, go the Advanced tab. Then, in the Keep copies of messages for offline viewing drop-down, select Only message I've read.
This will drastically cut on the amount of data that Mail.app stores locally, and it solved the slowness, high disk activity, and hanging issues I had with Mail.app. Of course, this method has a few downsides:
  • You won't be able to use Spotlight to search through the body of your messages. (Which is fine for me, as I found Spotlight to create other performance problems, and I had it disabled anyway.)
  • You won't be able to access some of your emails when offline. (The next time you do email on a flight, you might find that some emails you haven't already read have not been downloaded.)
  • Mail.app will only download the body of a new message when you click on it, which adds a little lag. (Before, Mail.app was downloading new messages in the background, so when you were clicking on a new message, that message was already there and no network activity was necessary to show the message. Ideally, I'd like to tell Mail.app "only download messages that arrive in my inbox".)

Monday, January 28, 2008

Memory Settings for IntelliJ

By default IntelliJ is setup to use a maximum of 192 MB of heap. The JVM memory settings are as follows:

-Xms16m -Xmx192m -XX:MaxPermSize=92m

I have found this to be almost always too low, systematically resulting in OutOfMemoryError. So every time I install a new version of IntelliJ, the first thing I do it to change this setting with:

-Xms16m -Xmx392m -XX:MaxPermSize=92m

If you are on a Mac, you can do this by editing the following file* and searching for -Xms in the file:

/Applications/Selena-7670.app/Contents/Info.plist

* Replace Selena-7670 with the name of your the IntelliJ executable, which, if you are using regular releases instead of EAP builds, will look more like IntelliJ IDEA 7.0.

Tuesday, November 20, 2007

FeedBurner Updates their Dashboard Widget

The FeedBurner widget is one of the very few Dashboard widgets I am using, and it stopped working when upgrading to Leopard. Fortunately, FeedBurner has since then released a new Leopard compatible version of their FeedBurner widget. Sweet!

Monday, November 19, 2007

Leopard Improves Renaming

Little things can make a big difference. Now in Leopard, when you rename a file (usually I do this by pressing the enter key), Leopard selects for you the file name without the extension, while it used to select the whole file name. This makes a lot of sense since in 99% of the cases you just want to change the part of the name that is before the extension. This is the type of simple changes that enhances your productivity and that I love to see in new version of an OS.

I am curious, is Vista now doing the same? Update Nov 20, 2007: Olivier left a comment below to say that this is implemented similarly on Vista.

Friday, November 16, 2007

A2DP Bluetooth support confirmed in Leopard

A2DP is the Bluetooth profile* you need to be able to listen to stereo music over Bluetooth. It needs to be supported both by the player (computer, phone, MP3 player...) and the headset. The good news is that now A2DP is indeed supported by both Leopard and Vista. The bad news to me is that according to TUAW, A2DP uses some form of compression that doesn't make it HiFi:

Unfortunately, A2DP compresses the audio, so it's not exactly a high-fidelity solution. But if you really want to listen to your tunes from your Mac without wires, this is probably the way to go.
According to Wikipedia, A2DP can use multiple codecs but only the low complexity Sub Band Codecs (SBC) is mandatory. The TUAW post seems to imply that only SBC is supported by Leopard, which would be a shame.

* BTW, why is it called a profile, and not a feature, as in: do both your phone and headset support the A2DP feature? I guess that you are geeky enough to know about A2DP, you might as well go all the way and talk about A2DP profile.

Thursday, November 15, 2007

Leopard, Solid Like a Rock... or Not

Erik warned me I had to uninstall ApplicationEnhancer.bundle, an application I didn't even knew I had, before installing Leopard. With this, the Leopard install went smoothly and after a few hours I had Leopard running on my laptop.

This was... until the next morning: Leopard had just crashed during the night. Apparently you're not supposed to use the network too much if you're on WiFi. Using BitTorrent or listening to Internet radio has been reported to cause this type of crashes. Hopefully that 10.5.1 update is on the way and fixes this issue.

Wednesday, November 14, 2007

Now we get a refresh in the Finder

While Bill Gates is famous for having said that 640 KB [of memory] ought to be enough for anybody, Steve Jobs must have once said that nobody needs a refresh in the Finder. But hell we do! :)

Here is a nifty little free application that comes to the rescue: Refresh Finder. And the latest version will work with Leopard too.

Tuesday, November 13, 2007

iMacs Crashing Too

My MacBook Pro is freezing from time to time, and others had the same experience with MacBook Pro. Now it looks like this is also a problem with the new all-alluminium iMacs.

Maybe even more frustrating, there is no sign that Apple even recognizes the problem. People are debating about whether the hardware or the software is to blame. I'll blame Apple, as they control both. Having your computer freezing should be just a memory of the Windows 3.1 and 95 days, not something you experience with the latest hardware and software. Apple creates truly wonderful hardware and software, but those crashes leave many people with a bitter taste.

Monday, November 12, 2007

Can't switch betweens files in IntelliJ with Leopard

I still haven't upgraded to Leopard. Call this prudence. So far the reports I have read have been mostly positive. Many were disappointed to see that Leopard didn't ship with Java 6, but it looks at least like Java 5 is running pretty well on Leopard.

With one exception: in some cases (all cases?), you can't switch between multiple files you have open in IntelliJ. This unfortunately is a major issue. One workaround is not to use the Mac OS X look & feel. I am not sure if this is a complete blocker for an upgrade to Leopard, but I will sure wait a little longer and see what happens with this one.

Update Nov 13, 2007: Great news: Dmitry mentioned in a comment that this issue should now be fixed in the 7.0.2 EAP build. Thank you Dmitry. For sure, those IntelliJ guys aren't sleeping!

Friday, November 02, 2007

Vote for Java6 on Leopard!

As The Sun BabelFish Blog puts it:

Java developers on OSX are upset at Apple's silence as to its intentions with respect to the release of Java 6. There used to be a developer preview available, which was pulled recently with no indication as to when a replacement would be available.
They started an open petition to get Apple to realize how important the Java platform is for Mac users. So here is my vote:
13949712720901ForOSX
Now make sure to vote yourself.

Monday, October 29, 2007

From WMA to MP3 on a Mac

I recently needed to convert a WMA file into the MP3 format. In case you're wondering, WMA stands for Windows Media Audio, which is both an audio file format and a set codecs developed by Microsoft. I could have used Zamzar, a free online file conversion service, but I figured that since I have a Mac, and because the Mac is strong on multimedia (isn't it?), this would be done in a breeze.

First, I thought that I would be able to drag & drop that WMA file on iTunes, and that iTunes would just ask me if I want to import the file in the AAC or MP3 format. Wrong: iTunes just won't import a WMA file. Alright, then let's load QuickTime, the Mac multimedia hub. QuickTime can convert between media formats, but for that privilege, Apple wants you to pay $30 and get what they call QuickTime Pro. I am buying a $4,000 machine which comes preloaded with a bunch of software that I don't need (such as GarageBand), but Apple wants $30 more, now when I want to do something useful? I still can't swallow that.

You would think that you can open a WMA file with QuickTime Pro, wouldn't you? No! For this you need to download the Windows Media Components for QuickTime, which luckily is provided for free by Microsoft.

Now you can open and play that WMA file in QuickTime Pro. You would think you can export it to MP3, wouldn't you? Well sorry, again: no! That one was very surprising to me. I find it hard to believe that QuickTime Pro can't convert an audio file to the MP3 format out of the box. I am still wondering if I missed something. Here is your workaround: download LAME Component for QuickTime and you will be able to export to MP3.

Finally! Next time, I'm using Zamzar.

Monday, October 22, 2007

Mac OS X, Still Crashing

The last firmware update didn't help. My Mac is still crashing.

And this last crash was pretty annoying. I not only lost about 10 minutes, the usual time it takes to reboot the OS and restart all the applications I am using, but this crash also caused a database corruption which then took me more than an hour to fix.

Here all the crashes I had since July 2007:

  • July 21, 2007
  • August 9, 2007
  • August 20, 2007
  • October 21, 2007
This is about one crash a month. When I am asked what I think about Macs by people who are using Windows and maybe considering to switch, I have to tell them I cannot recommend Macs because of poor stability. And really this is too bad, because other than that, I am quite satisfied with the OS and hardware.

Friday, October 19, 2007

New Parallels, Still Using CPU When Idle

We now have a new version of Parallels (released September 11, 2007). The list of improvements includes "Superior Performance and Lower Overhead", so I expected that this new version of Parallels wouldn't use 7% of my CPU when all the applications it runs are just idle. But unfortunately that didn't change. Am I doing something wrong? Somehow I have a hard time accepting Parallels just needs to use close to 10% of the CPU cycles when none of the applications executed by Parallels take a significant amount of CPU.

Thursday, September 27, 2007

MacBook Pro Firmware Update

Today I installed the first firmware update since I switched to a MacBook Pro, earlier this year. The update is promising to improve the performance and reliability of Intel Core 2 Duo processors and fixes issues with Boot Camp for MacBook Pro computers. I haven't found more specific information about what specific reliability issue this update is fixing.

I experienced pretty significant stability problems since I started to use this machine. The symptom is always the same: a complete freeze of the OS; the screen does not refresh even if applications still seem to be running (e.g. iTunes would continue to play music). I have been having those freezes about every two weeks. So this hasn't been a total killer, but it has been very frustrating. Especially considering that I never had any stability problem on my previous Windows laptop.

Hopefully this update will do it!

Friday, September 07, 2007

Norm's Mac Love

Welcome to the Mac world, Norm! It is hard to resist to those shiny MacBook Pro, isn't it? Here at Orbeon, I made the switch a few months ago and Erik did a few months earlier. Yes, the Mac is a very nice machine. And Mac OS X also has a lot going for it. But is it perfect? If you ask me, far from it. Very far. One day, when I feel brave enough to confront feedback I might get from the Mac zealots, I will post about some of the darker sides of Mac OS X ;).

Tuesday, August 21, 2007

iTerm and CPU Usage

You are running a tail -f in an iTerm tab for a busy log file. Did you know that this could use quite a bit of CPU? In one case I had today, iTerm was using more than 30% of the CPU. This looks like a bug. Luckily, there is an easy workaround: minimize the iTerm window by clicking on the orange "-" button and iTerm's CPU usage will drop down to no more than couple of percents.