Tuesday, August 28, 2012

How do I get iTunes to scrub backwards or forwards using my Mac's keyboard?

To scrub BACKWARDS, perform the following 3 key combination:
option command left-arrow
To scrub FORWARDS, simply use the right arrow rather than the left as shown below:
option command right-arrow
Okay, it's official, you can now effectively and efficiently soak up iTunes U video lectures and tutorials (or any other iTunes content). Have fun.

Wednesday, August 22, 2012

How do I show hidden files in Finder in Mac OS X?

Execute the following two commands via Terminal.app:
defaults write com.apple.finder AppleShowAllFiles -bool YES
killall Finder

To hide hidden files simply run the following two commands via Terminal.app:
defaults write com.apple.finder AppleShowAllFiles -bool NO
killall Finder

Tuesday, August 14, 2012

How do I set a directory's owner, group, and permissions recursively on a *nix machine via the command line?

Execute the following commands via the command line:
sudo chgrp -R _www /Users/user_dir/target_dir
sudo chmod -R ug=rwx /Users/user_dir/target_dir
sudo find /Users/user_dir/target_dir -type d -exec chmod 2770 {} \;
sudo find /Users/user_dir/target_dir -type f -exec chmod ug=rwx {} \;
The first command sets the group to _www recursively.
The second command sets the owner and group permissions to rwx recursively.
The third command makes it so all new directories get created with the correct permissions (i.e. 2770).
The fourth command makes it so all new files get created with the correct permissions (i.e. rwx).

This post is simply a guide. Your values will differ depending on your desired outcome. In your case you may want to set only the group permissions or only the owner permissions (as opposed to both as illustrated in this post). The actual permission values you end up setting may differ too.

About Me

My photo
I code. I figured I should start a blog that keeps track of the many questions and answers that are asked and answered along the way. The name of my blog is "One Q, One A". The name describes the format. When searching for an answer to a problem, I typically have to visit more than one site to get enough information to solve the issue at hand. I always end up on stackoverflow.com, quora.com, random blogs, etc before the answer is obtained. In my blog, each post will consist of one question and one answer. All the noise encountered along the way will be omitted.