Life & Technology

Handful lessons in different areas of technology and life in general.

Category Archives: Mac OSX

Creating New Administrator Account on your Mac OSX Lion

Last week, I received my issued MacBook Air for a local client and upon logging in, I immediately fired up Safari  to download my most needed tools and utilities for my day to day ( I mean night to night) development. When I’m through, I then clicked the .dmg file to install on the machine and then the system prompted me for a password for authentication as this is a required step to be able to install new software on the machine. And for the moment, I went blank for a moment as I don’t know the password of currently logged-in user and then it hit me that the OSX allows you to create a new user with Administrator privilege via its root terminal. So I did.

Steps I used to achieve my goal:

  1. Reboot the machine either clicking the Apple logo and hit restart or via the Power button on the keyboard and choose Restart.
  2. Just so before the Apple logo starting to show up, hit Command + S key combination until you see the scrolling text messages appear right in front of you eyes. This step allows you to boot on a Single User Mode so that you can perform root level actions.
  3. Next is we need to check the consistency of the system first before we issue our commands. Type fsck -fk and hit Enter. You can learn more about fsck here. This command will take a while but not too long to finish.
  4. In order for us to issue a command, we need to make sure that we mount the root folder and make it writeable. We can accomplish this by typing on the root prompt: mount -uw / (slash). To know more about mount on Mac OS, you may go here.
  5. Next, we need to delete a single file that determines if our OSX Lion machine is already completed or not. Again, on our root prompt, type rm /var/db/.applesetupdone and hit Enter key. Please note the dot (.) preceding the word applesetupdone.
  6. The last step is the easiest of them all, restarting your machine by issuing the command reboot on the terminal.

When your OS X Lion is rebooted, you will be greeted a familiar Welcome Wizard for first time user of this machine starting out with choosing your Country, Keyboard preferences, Setting up your Network (internet), Signing on your Apple ID, etc. The most important of them all is you will now be presented with a New Account setup and choosing your own username and password on the screen that will be presented to you. After this, you will also be showing the iCloud Setup Wizard for which you might wanna need if you like to share your data across your Apple devices.

So there you go, after that click/next operation, it will be up to you if you like to delete that old user or not. Please note that I only tested steps above on Mac OSX Lion only.

I thank Apple for providing such control and access in order for us not to reinstall our existing Lion setup.


3 Smarter Ways to screen lock Snow Leopard

In a Windows world, Ctrl+Alt+Del or WinKey + L will lock your machine and bring up the login screen and this shortcut  is really a time saver and considered to be the quickest approach to lock your screen. But when you’re in a Mac world, there’s no such thing as Ctrl+Alt+Del that will lock your screen automatically and I just don’t understand why Apple doesn’t bother to consider adding one to their Snow Leopard.

But even the lack of the infamous shortcut in my Snow Leopard, I still managed to mimic the behavior that the Windows shortcut can offer to their users and I listed the 3 smarter ways to achieve the same task but with varying approach as listed below:

1. Using LockTight.
LockTight is a free tool that will sit on your System Preferences called LockTight that gives you quick access for assigning a shortcut key to activate your Desktop’s screensaver. So, if you’re the type of user that utilizes screen saver with a password on resume, this tool is for you.


Download and Installation:
First, download the .tbz file here and extract it via Terminal app like so:

   1: tar -xjvf <filename.tbz>

After extraction completed, go to the LockTight-0.1 Intel folder and just double-click the LockTight.prefPane to open up the System Preferences window and follow the on-screen instruction to install the AddIn.


2. Using Keychain Access

If you don’t like to hit any keystroke and just preferred to use the mouse, then using this method will be your choice. To lock screen your window using Keychain Access:

1. Go to /Utilities and click the Keychain Access. Or simply, Cmd+Space to search Keychain Access via Spotlight

2. Go to Preferences page as shown below

Screen shot 2011-06-19 at 12.27.39 AM

3. And just tick Show Status in Menu Bar check box. A lock icon will automatically be placed on your top menu bar on the right. When you click this icon, you will see that there’s a Lock Screen option. This command when clicked will make your screen black but when you touch your Trackpad/mouse or keyboard, a login prompt will be displayed to input your password to unlock your machine.

Screen shot 2011-06-19 at 12.27.23 AM

3. Using Automator

This is an advanced option but if you follow along, I guess you will be fine :). The last approach involves creating a shell script that will turn into a Service and creating/assigning a shortcut on this service.


1. Run Automator

2. Choose Service as a template

3. On the left pane, there’s a Library, select Utilities and select/drag the Run Shell Script on the empty right pane.

4. On the Server receives text on the upper window, select "no input" on the drop-down list.

5. Type the command script on the text area provided: Note: This is a one-liner script, don’t press Enter key

   1: /System/Library/CoreServices/Menu\ Extras/ -suspend

6. Click File/Save, name it as "Lock Computer" or "Lock Screen".

7. Exit Automator

Now to make a shortcut for this Service:

1. Go to System Preferences and click the Keyboard.

2. On the Keyboard Shortcuts tab, click Services on the left pane.

3. Scroll to the bottom list under General on the right panel until you see your Service named "Lock Computer" or "Lock Screen" as you name your service.

4. Select it, and just tap/click the far right of your selection to turn it into an editable textbox.

System Preferences

5. Hit your keyboard shortcut to activate this service. Mine is Command+Alt+L

6. Close the Preferences page.

Test your shortcut and voila, your screen will lock with 3D animation effect! Try it and you’ll love it 🙂

Of all these 3 smarter ways to lock your screen, my personal choice would be using the Automator as it feels like we mimic the way Windows does it, only much better with Snow Leopard with the added 3D animation/transition effect.

If you like this post, consider sharing this to others. Thanks and enjoy!