Categories: "Devices"

The power of the power button! (or eject key)

The power of the power button! (or eject key)
That on/off button at the top right of the keyboard can do more than on/off...

You might wonder what to do with that Eject key on your Mac keyboard, now that drives with ejectable media are gone... or you may not use your power key to its full potential...

Personally, I've been using Ctrl + Eject or Ctrl + Power (depending on what key you have at the top right of your keyboard) for quite some time now. It brings up a popup dialog with the following options:

  • Restart
  • Sleep
  • (Cancel)
  • Shut Down

But I always found a missing item here:

  • Lock Screen (or Login Screen would also do)

I accidentally stumbled on the right shortcut for that today: Ctrl + Shift + Eject or Ctrl + Shift + Power will put your display to sleep immediately, and if you have your security preferences set up to lock your screen when display goes to sleep, you're all set. Neat! This is the fastest way I know to lock a Mac when I don't want to put it to sleep.

By the way, if you want to put it to sleep, without confirmation, you can use Cmd + Option + Eject or Cmd + Option + Power .

Be careful though, there are also "deadly" restart and shutdown without confirmation shortcuts involving Cmd + Ctrl + ... A good way to lose some work... Thus I'd recommend to stay away from the Cmd key all together when trying out these shortcuts ;)

How to insert Tabs in a textarea (OS X)

How to insert Tabs in a textarea (OS X)

Whenever you're on a web page with Safari, Chrome or Firefox and want to type a code snippet (or maybe just align what you type) you might be tempted to use the tab key...

But no, luck it moves the browser focus instead of inserting a tab into your text.

In order to actually insert a tab you need to press the following key combination: ctrl + alt + tab.

Note: depending on your keyboard, the alt key is sometimes called the option key.

How to find files recursively on Linux (or OS X terminal)

How to find files recursively on Linux (or OS X terminal)

Sometimes you need an emergency reminder about how to find all files of a certain name in a directory structure… like say: find all .htaccess files hidden in my web site. Well, here’s the magic command:

Shell

find . -name ".htaccess"

Also if you want to look for all hidden files (all files starting with a dot), you’d go like this:

Shell

find . -name ".*"

Using this to find images in iPhoto or Aperture

Sometimes you want to find the original or a preview of an image that is in your iPhoto or Aperture Library but you just can’t find it when you click on "Show Package Contents". The above command is your savior. Just execute it from within the library folder and it will find any JPG file you know the name of in a matter of seconds.

How to automatically copy out the images you find

Now let’s assume you can use this command to find lost files in your library, here’s an example of how you copy them out:

Shell

cp -`find . -name "IMG_542*.jpg"` ../recovered_files

Note the backquotes (back ticks) are used to reuse the results of the find command as arguments to the cp command. This is called "Command Substitution" in the shell.

How to check when Linux was installed

How to check when Linux was installed

If you have several servers to maintain like I do, at some point you’ll want to know how old exactly an installation of Debian (or another flavor or Linux) has gotten since you last wiped it clean…

So how do you check the install date?

I found the easiest way was to simply check the date of the lost+found folder. This folder is created at installation time and basically never removed after that. So I just go with:

ls -l /home/

and look at the date for lost+found .

Parallels Desktop 7 with Retina resolution - FAIL! (Screenshots)

Parallels Desktop 7 with Retina resolution - FAIL! (Screenshots)
Parallels at 2880x1800 with mac set to Best for Retina display resolution - Click to the the actual screenshot

Parallels has recently announced in a video that their virtualization solution Parallels Desktop for Mac now “takes full advantage of the Retina Display on a Mac".

That sounds awesome, but it’s not true. It’s actually pretty much a lie! :( – You can take some advantage of the Retina display, but definitely not full advantage.

All you can do is set Windows to believe it is running with a 2880 x 1800 pixels display. And that is indeed the physical pixel resolution of a Macbook Pro Retina display…

But, in NO CIRCUMSTANCE can you actually map each pixel from the 2880 x 1800 virtual machine to a physical pixel of the actual screen.

What you get instead, is blurry scaling all the waty down!

On the first screenshot below (click to zoom) you will see how 2880 x 1800 is scaled down (and BLURRED down) to 1440 x 900 if you keep you Mac runnign with the default setting of “Best for retian display".

On the second screenshot below you will se how 2880 x 1800 is scaled down (and still blurred down) to 1920 x 1200 if you change your mac display settings to the highest scaled resolution. This solution makes your windows look a tiny little bit better but it also makes your mac apps look less sharp (because they are now scaled too! Remember, you are no longer running in “Best for Retina display” mode!)

Read more »