The library - what does it sound like? A library. It’s a library of resources. Since there are way too many subdirectories to go through in detail, I’ll only go through the ones which might be relevant to someone in need of some hacking…
Application Support - These are some non-critical resources for apps such as Automator, Grapher, Mail, GarageBand, Microsoft Office, etc.
Desktop Pictures - These are desktop pictures; if you want to add some to the preloaded Apple Desktop Pictures for whatever reason, simply add the desired photos to this directory.
Dictionaries - If you want to add dictionaries to the dictionary.app, such as, for example, an IT dictionary or a foreign language dictionary, you must move your downloaded .dictionary files to this folder.
Fonts - You can add font files here. Note that the directory “Fonts Disabled” contains Times New roman, Verdana, Wingdings, Arial, and Brush Script - all windoze-y fonts. If you want to use them, simply move them to the Fonts directory.
Frameworks - Here are the frameworks for iTunes, AudioMixEngine, AEProfiling, AERegistration, AudioMixEngine, NyxAudioAnalysis, PluginManager, and other programs. They are filled with important files like libraries and supporting programs. More on this later; I don’t understand them entirely.
Java - This contains basically all the important files needed for java to run. /Library/Java/Home/bundle/Commands and /Library/Java/Home/bin are two paths to where all command-line commands for java are located… Who knew there was more to java than just jar, java and javac?
Keychains - Keychains are here. More about keychains here: http://en.wikipedia.org/wiki/Keychain_(Mac_OS)
Ok, it’s late and I’m sleepy; I’m less than halfway through, but I’ll stop for tonight and continue tomorrow.
The /Applications directory contains .app files. These are apps; programs. They are what appear in your launchpad or applications folder… It’s pretty self-explanatory. .app files are executable. If you try to open one in a text editor, you won’t see anything.
Yes. Enjoy your Mac. I wish I owned one because then I wouldn't have to muddle with GNUstep when I could be using NeXTSTEP, which is natively on the Mac. Then, I could try developing some iPhone/iPad/iPod applications using Objective-C. And Linux is great and all, but if you ever have problems with a Mac, you can bring it to the Genius Bar and ask questions, which is far easier than tracking down answers in forums and discussion boards.
True. I love your thoughts-on-computing blog, btw.
One really important step to understanding and manipulating an OS is knowing the directory structure; where important system files and other files are stored. So, I’ll explain the directory structure of Mac OS X.
You may want to open of Terminal (under Utilities) and follow along.
Type in “cd /”, then “ls”
/ is the root of the directory tree. OS X is based off of FreeBSD, a *NIX operating system, so the directory structure is very similar to that of linux or any other *NIX OS.
This is a really useful utility which allows you to protect your computer against other people with knowledge of single user mode and other goodies.
Also, if you don’t want others installing linux on your mac without permission, this protects against that as well.
On Snow Leopard, you’ll need to stick in the install disc which came with your computer and then reboot. Open the Firmware Password utility under Utilities and set a password.
Once a password is set, a password is required to boot from an external drive and single user mode.
In lion, command-R will do the trick. It is especially important to set up a firmware password in lion, since you don’t need access to the installation disk to reinstall the operating system or do anything equally harmful. If a firmware password is set, the following screen will show up when command-R is executed.
So, I’ll begin a series of basic hacks; really simple foundations to start with.
First off: Single User Mode.
Well, there are several ways to control a computer which you do not have access to. Assuming you have physical access of a machine, but do not have access to an account on the machine, single user (aka verbose) mode is probably the single most effective way to control it.
I won’t go into much detail about what it is (read the wikipedia article for that), but it is simply a runlevel which allows one to control a computer as the superuser.
On Mac OS X it looks like this:
You can change the root password of the system and fiddle around with lots of important files like sudoers and pam.conf.
Reboot your computer. Hold down command-S (⌘-S). If your computer is not protected by an open firmware password, you should see something like the screen shown in the picture. It’ll ask you to fsck with the command /sbin/fsck -fy and /sbin/mount -uw / to make modifications to the file system.
Well, what do you want to do now that you have control over this computer?
Change the root password: Use the command passwd
Add a user to the sudoers file: visudo -f /etc/sudoers (man visudo for more info)
Well, those are the two most useful commands, but go ahead and play around yourself to discover more.
Limitations of Single User Mode:
Single user mode has several limitations. First of all, it is easily disabled. One can switch it off easily using the firmware password utility.
Dscl, which is used to create new accounts from the command line, cannot be used in single user mode either.
So I’m a linux enthusiast, computer enthusiast, math enthusiast, linguistics enthusiast, and philosophy enthusiast. And I play cello.
I became quite smitten by linux a few months ago and started giving a lot of my time to sysadmin-related activities and, of course, learning about unix and linux in depth.
However, my parents hate linux and think IT is all crap for unintelligent bastards. My dad basically stalks all my computer activity, even bash history at times. I dual-partitioned my iMac, planning on installing gentoo, only to have my dad see the extra partition and threaten to remove the computer lest I repartition again.
Upon getting admissions to two selective music programs, my parents became quite happy with me and decided to get me a laptop.
The first thing I thought of was joyfully getting a nice dualboot of gentoo and either mac or windows, depending on the laptop. However, the first thing that came out of my parents’ mouthes about laptops was that the laptop would be confiscated should any trace of linux appear. To make things worse, they decided not to get me a thinkpad, but a macbook air 5,2 with a tiny 128 gb harddrive. And no CD drive. And no ethernet port.
I guess I’m simply damned. I’ll use this macbook air. I’ll use this iMac. I’ll ignore that nice pc tower we’ve got - used too much by my parents for important work purposes - I shan’t mess around with it. I’ll use Mac OS X.
Mac OS X is simply FreeBSD anyway. It’s UNIX. Thank god for that, at least. I plan on learning the ins and outs of the OS, I plan on doing some major hacking here. There’s a lot to learn, and here I begin.
I’m simply just another computer-obsessed teen living in the digital era.
Welcome, and I hope I can supply this world with a few useful Mac OS X hacks while learning about the design of this BSD-based system with which I am forced to be so acquainted with, since my parents strictly prohibit me from toying with linux.