MacBook Pro and the SMC cure

2017-07-11  |   |  apple   Mac OS X  

The physical parts of your MacBook (fans, ports etc) behaves erratically? I might have a cure.

A story of crashes

My MacBook Pro was getting on my nerves lately. When plugged to my Thunderbolt dock and thus my external monitor, my laptop would crash randomly. Sometimes, once every 2 weeks, sometimes several times a day. I tried many things, like not starting all of the utilities one usually uses to verify that they were not involved but I could not find a culprit.

Then one day, I saw that one of my Thunderbolt port would not accept my Thunderbolt-Ethernet adaptor while the other did (the connection did not show up). I was convinced my laptop had a faulty hardware and needed repair.

System Management Controller to the rescue

So I called Apple and the support person told me to try something first: reset the SMC (System Management Controller) by pressing Shift+Control+Option on the left side and the power button for 10 seconds while starting the computer (after a full shutdown) - full procedure here.

And voila, all my problems are gone.

What is SMC anyways?

It turns out that there is a chip that manages a lot of hardware inside your laptop: fans, LEDs, IO ports, external displays, battery, etc. So slapping that chip on the face (figuratively) might make a lot of things go better.


Unstuck the unread count of Apple Messages app on Mac OS X

2015-02-20  |   |  apple   Mac OS X  

The text message synchronization between iOS and Mac OS X devices is very useful. That is until one of the unread count is stuck. There is nothing more irritating than a false unread badge.

It has happened to me on Apple Messages (iMessages) in Max OS X Yosemite. The message would "unread" itself in front of my eyes. I deleted the message, that solved that part.

But the unread count remained at 1. I fumed for a couple of days until I found the solution. Open your Terminal application (in Applications/Utilities) and type

killall Dock

The incorrect unread count disappeared. I can sleep now.


Change the Apple TV WiFi settings without remote

2013-08-15  |   |  apple  

You have your Apple TV but no remote and need to change the WiFi settings? Read on.

You're on vacations and as a good geek, you're fully autonomous and packed:

  • your Apple TV
  • a router
  • an HDMI cable
  • your iPhone
  • a couple of ethernet cables

You forgot your Apple TV remote chiefly because you always use the iOS Remote App at home.

Now you try and change the Apple TV WiFi settings and oh horror, either you plug the Apple TV through the ethernet cable and you can use the iOS Remote App, or you unplug the cable to set the WiFi but the Remote App no longer sees the Apple TV. You are stuck!

My friends, there is a way out of catch 22 hell.

  1. Find a regular TV remote.
  2. Plug the ethernet cable to the Apple TV.
  3. With the iOS Remote App go to Settings -> Geenral -> Remotes,
  4. Select Learn Remote and follow the easy steps to teach to Apple TV your TV remote.
  5. Once done, unplug the ethernet cable and set the WiFi under General -> Network -> Wi-FI.

Your vacations are saved. No need to thank me ;)


Making the best of Google Authenticator for One Time Passwords

2013-03-26  |   |  apple   tool  

You can't reorder tokens on Google Authenticator nor edit the associated description? Read on.

I use one time passwords everywhere I can. It's a little hassle but increases security by a whole lot. And the good thing is that more and more providers offer this:

  • GMail
  • Google Apps
  • Dropbox
  • Amazon Web Services
  • Your company if they are not too dinosaur-y

Go use one time passwords aka two factor authentication, you will thank me later.

I looked around on iOS and the most well known soft token application that supports both time based and event based tokens is Google Authenticator. Except that Google Authenticator's UI is really crap and buggy.

The edit button does not seem to function properly and nothing happens most of the time. The trick is to go to Legal information then back. You can now press the edit button and voilà! Things work. You can now:

  • reorder the list properly
  • edit the name under each token

That made my life much easier.


Multiple email aliases in iOS

2013-03-24  |   |  apple   productivity  

I have tons of email identities. Depending on which hat I am wearing, I use one alias or another. Most are behind my GMail address. It is easy enough to create and use multiple aliases in the GMail web client or even in Mac OS X's Mail app. But until recently I thought it was impossible with iOS Mail app.

It turns out it is possible but requires a bit of cheating. First off, instead of setting up your GMail account as GMail, set it up as IMAP. I already do that as I never give my GMail address (in case I change provider). Once setup, go in Note or any other editor and type the list of comma separated email aliases (including your primary address) and copy this line. For example:

scooby@doo.fr, scooby.doo@worldwildlife.org, scooby.doo@gmail.com

Then go to Setting -> Mail, Contacts, Calendars and select the email account you are interested in. In the Email field, remove the address and paste the list of comma separated email addresses. This whole gymnastic is necessary because iOS does not let you add commas in an email field.

Now you are good to go, when you create an email, you can change the email address with any of the aliases. Note that the last email in the list will be the default email (experienced on iOS 6.1.3).

I found the tip on iMore, they describe a more step-by-step explanation with some screen shot if you get lost.


In search for a 2560x1600 display

2012-02-13  |   |  apple   productivity   tool  

I have been using a Samsung SyncMaster 305T+ 30" monitor for 4.5 years now and have been very very happy with the screen real estate. Yes two monitors are nice but a big massive one wins for me. Anyways, it's failing me. The screen blinks more and more - luckily I'm epileptic - often and a few straps that used to display true back now are dark green. It won't last long. I am looking for a replacement.

I have a MacBook Pro with a mini DisplayPort but pre thunderbolt (by a couple of month...). I am quite interested in the Apple Thunderbolt Display:

  • it has the resolution I'm looking for,
  • great ports (USB, Firewire, Ethernet)
  • it's a breathe to dock a MacBook Pro
  • good reviews

There is one catch, it won't work on my current MacBook Pro - i tried. And that sucks big time. I can't justify buying a new MacBook Pro to secure a future proof screen and I could not find a way to make this Thunderbolt monitor work on a mini DisplayPort computer (no adapter, no nothing). Which means Apple will force me in the past :(

The alternatives I have are:

  • the Dell U3011 (30", 2560x1600, DisplayPort, DVI, HDMI)
  • the HP ZR30w (30", 2560x1600, DisplayPort, DVI)
  • the Apple LED Cinema Display (27", 2560x1600,mini DisplayPort, MagSafe power adaptor)

It seems to me the best option is the Apple Cinema Display. Despite the smaller screen, it's the same resolution, it's cheaper (by 200 to 400 euros) and I will have less cable to plug my laptop to. The sad thing is I'm not sure it will work on future Thunderbolt MacbookPro, let alone if I need to plug other Thunderbolt accessories in between, and for sure it will be inconvenient compared to a nice and well connected Apple Thunderbolt Display. And spending that much money on previous generation when the next gen is the same price really pisses me off.

Do I have any other alternatives? I looked for refurbished or second hand Apple Cinema Display (27", mini DisplayPort) but could not find any around Paris.

By the way, 4.5 years ago for a 30" 2560x1600 monitor, I paid the same price or less than what these beasts sell for today. Granted, these are new technology and new panels (IPS) but at constant size and resolution, price has not drop a penny. Where the hell have Moore's law corollaries gone? Oh and is 4.5 years old for a screen?


iTunes vs incoming connection and VPN vapors: fixes for unApple behaviors

2011-10-28  |   |  apple   Mac OS X  

I've just found solutions to two nagging problems I had on Mac OS X.

iTunes and incoming connection requests

Some times ago, iTunes has started to ask me every time it launches "Do you want the application “iTunes.app” to accept incoming network connections?". It gets quickly annoying.

There is a very simple solution. Move iTunes.app (from /Applications) to your trash, download iTunes and install it. The first time you start it, iTunes will ask you to change your firewall settings. Do so and you will be good to go.

If you want to know the tiny details, somehow your iTunes package got changed or corrupted and the firewall was not trusting iTunes anymore.

VPN connection after sleep

Another problem I had was that after the laptop goes to sleep, it is sometimes impossible to reconnect to a VPN. If that happens, you need to restart the right daemon. Open a terminal and run

sudo launchctl stop com.apple.racoon

sudo launchctl start com.apple.racoon

You are now able to connect to your VPN again.


How to install an Apple Keynote theme

2011-08-19  |   |  apple   productivity  

It is surprisingly hard to find on da internet how to install an Apple Keynote theme (and make it work).

Follow this procedure:

  • retrieve the .kth file (that's the keynote extension for templates)
  • alternatively open the .key file containing the theme you are interested in
  • double click on it or open the file in Keynote
  • In the File menu, click on Save Theme...

The file will be stored in ~/Library/Application Support/iWork/Keynote/Themes.

This technique is known to work for Keynote '09 (5.1) on Mac OS X 10.6 (Snow Leopard).


Script to hot switch JDK versions in Mac OS X terminals

2011-01-04  |   |  apple   java  

Personal note.

Here is a script that lets you switch your JDK version in a terminal window. It also has auto completion.

Put the script in a file and add

source filename

in ~/.profile or ~/.bash_profile and you will be able to call setjdk and use autocompletion (with <tab>) from the command line.

emmanuel@computer $ setjdk 1.<tab>

emmanuel@computer $ setjdk 1.5

Original version at codehaus.

#!/bin/bash

function defaultjdk {

local vmdir=/System/Library/Frameworks/JavaVM.framework/Versions

local ver=${1?Usage: defaultjdk }

[ -z "$2" ] || error="Too many arguments"

[ -d $vmdir/$ver ] || error="Unknown JDK version: $ver"

[ "$(readlink $vmdir/CurrentJDK)" != "$ver" ] || error="JDK already set to $ver"

if [ -n "$error" ]; then

echo $error

return 1

fi

echo -n "Setting default JDK & HotSpot to $ver ... "

if [ "$(/usr/bin/id -u)" != "0" ]; then

SUDO=sudo

fi

$SUDO /bin/rm /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK

$SUDO /bin/ln -s $ver /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK

echo Done.

}

function setjdk {

local vmdir=/System/Library/Frameworks/JavaVM.framework/Versions

local ver=${1?Usage: setjdk }

[ -d $vmdir/$ver ] || {

echo Unknown JDK version: $ver

return 1

}

echo -n "Setting this terminal's JDK to $ver ... "

export JAVA_HOME=$vmdir/$ver/Home

PATH=$(echo $PATH | tr ':' '\n' | grep -v $vmdir | tr '\n' ':')

export PATH=$JAVA_HOME/bin:$PATH

java -version

}

function _setjdk_completion (){

COMPREPLY=()

local vmdir=/System/Library/Frameworks/JavaVM.framework/Versions

local cur=${COMP_WORDS[COMP_CWORD]//\\\\/}

local options=$(cd $vmdir; ls | grep 1. | tr '\n' ' ')

COMPREPLY=($(compgen -W "${options}" ${cur}))

}

complete -F _setjdk_completion -o filenames setjdk

complete -F _setjdk_completion -o filenames defaultjdk


Mac OS X and IntelliJ crashes

2010-12-07  |   |  apple   ide   tool  

I've struggled in the past several weeks with repeated crashes from IntelliJ IDEA on Mac OS X. I suspect it started right after the upgrade to 1.6.5 and the latest Java VM update.

It seems it was cause by a couple of things.

Job scheduler crash
If your crash report shows something like
Thread 55 Crashed: Java: JobScheduler pool 1/2
This is a bug in the garbage collector. You need to pass an additional VM option to fix it
-XX:-ReduceInitialCardMarks
Open /Applications/IntelliJ IDEA x.y.z.app/Contents/Info.plist and update the VMOption key
<key>VMOptions</key>
<string>-XX:-ReduceInitialCardMarks -Xms128m -Xmx512m -XX:MaxPermSize=250m -ea -Xbootclasspath/a:../lib/boot.jar</string>
Font corrupted
Not sure if that was related to the previous issue but I initially had crashes with a different report involving directly the Garbage Collector (GC). My IntelliJ IDEA was using the Inconsolata font which apparently was somehow corrupted.

Removing fonts from ~/Library/Fonts solved the issue. What you can do is move them to a different directory and slowly re-inject them to find the culprit.

I am quite happy all this is behind me. I chose:

  • A Java VM
  • On Mac OS X
  • with IntelliJ IDEA

to precisely avoid this kind of bad experience and time waste :) Back to normal.


Name: Emmanuel Bernard
Bio tags: French, Open Source actor, Hibernate, (No)SQL, JCP, JBoss, Snowboard, Economy
Employer: JBoss by Red Hat
Resume: LinkedIn
Team blog: in.relation.to
Personal blog: No relation to
Microblog: Twitter, Google+
Geoloc: Paris, France

Tags