Rocu.de

Love, caffeine and omlette

Month: January 2013 (page 2 of 2)

Lock your mac from the command line

During my daily work I try to take breaks and move frequently. In order for
me to leave the room I have to ensure that my computer is locked.

I wrote a little script which does exactly this.

I only have to enter

lock

and my Mac starts to lock.

A nice varitation of this is to use this functionallity together with
my Pomodoro app. It locks my computer after 25 minutes of work for me.
Thats a pretty effective reminder to move 😉

Enough said. Here is the code:

#!/bin/sh
/System/Library/CoreServices/Menu
Extras/User.menu/Contents/Resources/CGSession -suspend  

Shorthand for creating a new file in the shell

This one is really nice for everyday use and easy to remember. I picked it up during pair programming. One of my colleagues used in the shell.

Its pretty easy to remember:

> foobar.txt

Nothing spectacular - but you might not know this yet.

Newer posts

© 2017 Rocu.de

Theme by Anders NorenUp ↑