Essential OS X tools

Since my conversion to Mac OS X at home, I’ve been coming across and using some essential or must-have tools to get the most out of my Mac.

Here’s my list in no particular order:

  • Firefox – Best browser by far!
  • StuffIt Expander – Like WinRAR/WinZip in Windows.
  • coconutBattery – Gives you definitive information about your battery.
  • Cyberduck – Best FTP and SFTP client.
  • ClamXav – Free virus checker for OS X (not that you really need it).
  • Adium – The only instant messenger client you’ll ever need.
  • Burn – Application that will take care of all your burning needs.
  • Handbrake – Open-source DVD to MPEG-4 converter.
  • MacJanitor – The janitor who will clean up your Mac regularly.
  • Remote Desktop Connection – You’ll need this if you need to control Windows machines.
  • Service Scrubber – An excellect service manager.
  • Senuti – Will assist you in transferring your music from your iPod to your computer.
  • Chicken of the VNC – Best VNC client for OS X.

That’s it! Hopefully, you find this list helpful, but more importantly, it will enhance your OS X experience exponentially.

Put your Mac to sleep via e-mail

You’re at work, with no remote control access/capability to your Mac at home, brown-outs are occurring, and you forgot to plug it into a power strip due to some unknown reason last night.  What do you do?  Well, read on…

With some preparation, you can take advantage of Apple’s Mail‘s rules feature to run an AppleScript on a filtered message next time.  Here’s how:

  1. Type this script using the Script Editor:
  2. tell application “Finder”

    display dialog “This computer will go to sleep in 1 minute.”  buttons {“Sleep”, “Cancel”} default button 2 giving up after 60


    end tell

  3. Save the file somewhere.  I suggest Documents/Scripts (create the folder if it doesn’t exist and start saving all your useful scripts in here).
  4. Open up Apple Mail and navigate to Preferences > Rules > Add Rules.
  5. Copy and setup the following rules based on the screenshot below:
  6. Fig. 1.1 – Apple Mail’s Add Rule window

    Apple Mail rules

  7. Apply the changes and minimize Apple Mail.
  8. That’s it!  All you have to do now is send yourself an e-mail with “Sleep My Mac” as the subject with the message of “Go to sleep” from anywhere.

One caveat: For this to work, Apple Mail will need to be running (minimized is fine). 

Hopefully, you find this tip helpful and empowering.  Now back to work!  =0)

Microsoft did right with Windows Live Writer (Beta)

My blog/site has been running for 17 days and it’s been quite a ride so far. And throughout my writing and posting, I’ve been using Microsoft’s beta version of Windows Live Writer.

I must say, it’s very easy to use and has a plugin feature like Firefox and WordPress. Here’s a screenshot:

There are, of course, some quirks that I find annoying such as when trying to change fonts: You have to click on Format > Font > Type or scroll through to pick your font. Sometimes, it doesn’t pick up the font I want when typing it; for example: “ver” for Verdana. The HTML will try to use “ver” as the font face.

On the other side of the coin, I really like how it detects, connects, and uploads your post and images to your blog platform without any intervention, other than the initial setup. The images, like above, is automatically created; a thumbnail and full view when clicked on. There are times, however, where I didn’t want it that way.

In any case, I believe Microsoft made the right decision with this desktop application. They’re headed the right direction within the context of the blogging world. Too bad it isn’t available on other OS platforms, but hey, it’s Microsoft. What do you expect?

Pros: Easily detects and integrates with numerous blog platforms, automatically saves as drafts, easy to use, has different “views” like HTML Code and Web Layout, automatically creates and uploads to your blog platform, supports plugins (i.e., Paste from Visual Studio plugin)

Cons: To access certain features like changing fonts is cumbersome, images uploaded do not include alt info thereby failing verification tools, not available on other OS platforms, still in Beta, might not be free later on(?)

I find it more user-friendly than w.bloggar or Deepest Sender (haven’t tried ecto yet which is OS X and Windows compatible), so I’ll continue to use it and write about it in the near future.

Take care. =0)

Windows PowerShell script to check for specific hotfix

I was asked by our IT department to write something that would check if a specific Windows Update hotfix was installed on a number of servers (they gave me list), and they wanted it ASAP.

So, I thought, hmm…this is the perfect opportunity to give Microsoft’s new scripting tool, Windows PowerShell, a try. I tip my hat to Microsoft for creating this tool – it was about time – since something like this has been in need to combat the “last mile” in the IT world.

It shouldn’t take more than 5 minutes to write this script, but being familiar with the .NET Framework is sort of a prerequisite:

# Get content
$computers = get-content c:\computers.txt

# Get all the info using WMI
$results = get-wmiobject -class “Win32_QuickFixEngineering” -namespace “root\CIMV2” -computername $computers

# Loop through $results and look for a match then output to screen
foreach ($objItem in $results)
    if ($objItem.HotFixID -match “KB932168”)
        write-host $objItem.CSName
        write-host “Hotfix KB932168 installed”

To use it:

1. Copy-and-paste this into notepad and save it as scriptname.ps1.

2. Set the execution policy, as Microsoft intentionally set it up like *nix scripts (right on!) wherein you need to chmod it, like so: Set-ExecutionPolicy Unrestricted.

Note: There are different execution policies, such as “AllSigned.” Google it if you want to know more about it.

3. Run it from the powershell by typing .\scriptname.ps1.

4. That’s it! Now wait for the results.

This script, unfortunately, will only print out the servers that have the specific “KB932168” (read: an example) hotfix installed. I could’ve expanded the script to output a list of servers that didn’t have it and output it to a text file using the Out-File cmdlet, but, at the end, it served its purpose and got the results our IT department needed.

BTW, this script will work on Win2k3, XP, Win2k, and Win98 – but the corresponding .NET Framework (version 2.0 is good; version 3.0 is already out) must be installed on the target machine. Also, know that the Windows PowerShell only works on Windows.

Hope this helps! =0)

Password-Protecting your pages with .htaccess

If you develop websites or adminster them, you’ve probably been asked or required to password-protect parts of a website. 

So, to help you out, here’s a quick how-to in Apache using .htaccess:

  1. Open a terminal window and navigate to the folder or page(s) you’d like to add a password requirement.
  2. Once there, type the following: htpasswd -c .htpasswd username.  BTW, you can name .htpasswd to another name (something that is hard to guess is preferable).
  3. Enter the password you’d like to associate with the username (from above).  This will create the user and an encrypted password.
  4. Next, create the .htaccess file by typing: vi .htaccess, and add the following in the .htaccess file:

To protect a folder

AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName “Your Secret Folder”
Require valid-user

To protect a page

AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName “Your Secret Page”
<Files “yourpage.html”>
  Require valid-user

Note: You can use a different name for .htpasswd so it’s harder for a hacker to figure it out.

5.   Type :wq! to save and exit. 

6.   For better security, perform a chmod on .htaccess, like so: chmod 644 .htaccess.

As you can see, the steps above are pretty straight-forward.  Also as an FYI, Apache blocks any requests for anything that start with “.ht”.

That’s basically it, I hope this post helps you out.  =0)