Thursday, May 31, 2012

Mac OS X 10.7 show the Users Library

http://osxdaily.com/2011/07/04/show-library-directory-in-mac-os-x-lion/

Show User ~/Library in OS X Lion

Launch Terminal from Spotlight or Launchpad -> Utilities, and enter the following command to show or hide the directory:
chflags nohidden ~/Library/

The users Library folder will immediately become visible again. Reverting this back to the standard Lion setting is simple too:
Hide User ~/Library in OS X Lion (default setting)

This returns to the default setting of hiding the user Library directory:
chflags hidden ~/Library

Changes take effect immediately again, and Library becomes invisible to the user.

Update: temporary one-off solutions are also available for quick access to User Library in Lion

Wolfenstein: Enemy Territory Available for Windows/Mac/Linux

Mac install instructions taken from http://forums.warchestgames.com/showthread.php/14517-ET-OSX-2-60d?p=383459&viewfull=1#post383459 Tested and working for me too (MacBook Pro 15-inch, Late 2011).
-----
How to run Wolfenstein ET on OS X Lion: (Tested on Macbook Pro 2011)

1. Download (Wolfenstein Enemy Territory 2.60d)
2. Drag the Wolfenstein ET folder to your Applications folder.
3. Run the punkbuster installer.
4. In ~/Library/Application Support/ create "Wolfenstein ET" folder and therein "etmain" folder.
5. Download a punkbuster etkey
6. Put the etkey in the following location: ~/Library/Application Support/Wolfenstein ET/etmain
7. In ~/Library/Application Support/Wolfenstein ET/etmain/ create a file: "autoexec.cfg"
8. Paste the two lines of this file:

seta r_colorbits "32"
set r_allowExtensions 0

9. Run ET.

10. Set screen resolution via the following commands in the game console (press ~ after launching the game to view game console):

/r_customwidth XXXX
/r_customheight XXXX
/r_mode -1
-----

Here is the proper link to download WolfET for Any OS
http://www.splashdamage.com/content/download-wolfenstein-enemy-territory

I'll see you on the battlefield. Enjoy!!!

Monday, May 28, 2012

AppCleaner

For those who are interested in cleaning out all traces of an Apple "App" when removed from the OS.

http://www.freemacsoft.net/appcleaner/

Sunday, May 27, 2012

com.apple.quarantine

If you are like me, you may have gotten annoyed in both Windows and Mac OS X by the warning window.

Mac OS X Example Screenshot

These warnings come from a metadata source that the OS is evaluating. On Windows, Microsoft uses a NTFS feature called Alternate Data Streams. In Windows when you open the file you get a warning...You can click OK and the ADS will remain, or you can uncheck the box "Always ask before opening this file". Unchecking that box and clicking Open/Run will delete the ADS which tells Windows that this file was downloaded from a network location. For more details on the ADS associated with a file, and/or to delete the ADS check out the Sysinternals Streams tool.


In Mac OS X, Apple uses a feature called extended Attributes. You can see that a file has extended attributes via the List Long output (ls -l) and looking for the at (@) symbol.

I downloaded synergy 1.4.8 from http://synergy-foss.org/ as an example
user:~$ ls -l synergy-1.4.8-MacOSX107-x86_64.dmg
-rw-r--r--@ 1 user group 13783645 Apr 25 17:42 synergy-1.4.8-MacOSX107-x86_64.dmg
Now let's see what Extended Attributes are associated with this file.

user:~$ xattr synergy-1.4.8-MacOSX107-x86_64.dmg
com.apple.metadata:kMDItemWhereFroms
com.apple.quarantine

Note: When opening the Disk Image we do not get a warning, however, some of the attributes follow any file copied from the Disk Image. Also, new attributes are added after opening thanks to some checks performed on Mac OS X. Just Notes, I haven't looked into these other items.

I extracted the Synergy.App so that I can use it to example the filewarning

user:~$ xattr Synergy.app/
com.apple.quarantine

If you do not want to receive this warning we need to remove (delete) the Extended Attribute com.apple.quarantine

user:~$ xattr -d com.apple.quarantine Synergy.app/
user:~$ xattr Synergy.app/
#Note: No Output since the one attribute was removed.
user:~$

When I am working with a large amount of data downloaded for tech-support purposes, and I trust the source, I will tend to remove this attribute manually from the Terminal just so that I don't have any trouble with any files not opening.

user:~$ xattr -rd com.apple.quarantine folder/

I hope this helps others dealing with there Mac and improves our knowledge. Thanks to this Macworld Article as the stepping stone to my understanding of Extended Attributes.
http://www.macworld.com/article/1145324/filewarnings.html

Tuesday, May 15, 2012

Get QuickSilver

Get quicksilver
http://www.blacktree.com/

This tool is similar to the built in Spotlight but is a little different. Many people find is more efficient for them.

After installing the tool then use Control+Space to launch and type what you want.

Monday, May 07, 2012

Lock Me Now

Those who have used Windows or Linux before are probably used to the Super+L or Control+Alt+L actions to lock your screen. The utility of this is noticeable when you work in a Cube Farm and need to ensure that no one access your workstation when you are away from it.

By Default the way to Lock the screen, not very intuitive if you ask me, is to hit Control+Shift+Eject on your Mac Laptop. Now how do I map this to a USB keyboard that I use when at the office? Not possible you might say.

Solution:
There are a couple solutions I have tried. One is okay, the other is good. The Okay method, which I do not recommend can be found here
I don't recommend it because it is a little finicky and does not directly address the concern.

The good way is to use Lock Me Now (iTunes Store) it's free. After installing and running it you will find a small lock icon in the System Tray (not sure if this is the proper Apple term). Edit the Preferences to configure the key combination you want and confirm that the Application starts at boot. The only complaint I have is that the "Paus iTunes Music" Option will start iTunes, even if it is not running, so that it can Pause the nothing that is playing.

Another Option Using BetterTouchTool (Read my previous post on how to get BetterTouchTool Setup)
http://www.tech-recipes.com/rx/9930/bettertouchtool-and-mac-os-x-lock-your-mac-with-a-touchpad-gesture-keyboard-shortcut-and-more/

Thursday, May 03, 2012

Mac OS X Manage Login Applications

Log in as the user who wishes to have a login item or as an admin user.
Choose System Preferences from the Apple menu.
Choose Accounts from the View menu.
Click the name of the user.
Mac OS X 10.3.x: Click the Startup Items button.
Mac OS X 10.4 or later: Click the Login Items button.
Click the "Add {+}" button.

Wednesday, May 02, 2012

MD5 sums

Mac OS X has a really awful MD5 tool. On Linux we have the md5sum tool which outputs the following when you run it against a file

#md5sum file
8c45b25f15362fb3a74959bb7056df5f *file

On Mac we have a wrapper for openssl md5 which provides the bellow output
#md5 file
MD5 (file) = 8c45b25f15362fb3a74959bb7056df5f

On Linux I can then sort the output numerically and then very easily see what files are duplicates. I can also use the wonderful -c option to take in a file containing MD5s and file-names in the same style as the output of md5sum so that I can -c Check that the files are the same.

On Mac OS X neither of these simple and effective uses can be completed without bending over backwards with manual work or coming up with some script to do the same thing. I tried to install md5sum from ports, however, it doesn't exist there. So for now I am stuck with an inferior tool which does not accomplish my goals of using the MD5 hash to both remove duplicate files and confirm that moved files haven't been corrupted.

This Rant is brought to you by Craig

Tuesday, May 01, 2012

Installing Applications

I have seen this problem since even before I got my Mac. Most Mac OS X Applications are packaged in dmg (Disk Image) files. By opening this file the Disk Image is mounted and the contents displayed in Finder. At this point I see some users double-click the Application and run it from there. They then keep this App icon in the Dock. When they do this, everytime they open the App it re-mounts the dmg and runs. This is an incorrect way to install your App and could easily cause problems when you clean up your Downloads folder.

Instead follow these steps
1. Mount the dmg (Open it)
2. Click and drag the App to the Applications folder (or any folder you wish to "Install to")
Mac OS X Apps are pretty cool in that they are a single file containing all needed libraries.
It is an archive that you can even navigate it, not that it is very useful, but you can by right clicking (Secondary Click in Apple lingo) and select "Show Package Contents".
3. Run the App from the folder that you installed it to. Add to Dock if you like.
Use the Finder to confirm that all Disk Images are un-mounted (click the Eject Icon) and then run the App again to confirm you accomplished the above steps and no longer have the OS doing double duty to run the App.

Just a quick tutorial, I hope it helps noobs get used to their Mac.