Wednesday, May 13, 2009

Power Tip #10: Terminology

This tip isn't so much a tip as a run through of important words that every good computer user ought to know.

First off, what's a kernel? Well, most every operating system has one, and Mac OS X's is called Darwin. A computer's kernel is a sort of program which doles out memory (RAM) to applications, what writes data onto the disk, and other sorts of things like that. A kernel is an integral part of the Mac OS X operating system. When thinking of the makeup of an operating system, it is helpful to think in layers, with the things a user sees at the top, and other things at the bottom. A kernel would qualify as one of those 'other things,' residing out of sight, right near the bottom.

Secondly, what's a volume? I've mentioned these a few times, and may have unknowingly confused my loyal readers. Just so you know, a volume is the place where data is stored on any sort of medium, such as a hard disk, CD, etc. You may be thinking "Wait, doesn't my computer write directly on my hard disk?" Well, a computer has to conceptualize the physical world by imaging everything as software, and in the case of conceptualizing storage mediums, your mac has to image the disk as a virtual place, which it calls a volume.
Your computer has a volume that was initially called 'Macintosh HD,' and this is "mounted" at start-up. "Mounting" a volume is loading it so that data can be written to or retrieved from it. You also mount volumes when you open disk images that some apps are stored in, as well as when you plug in a flash-drive.

Thirdly, why am I telling you this; isn't this sort of thing what Wikipedia's for? Well, let's just say that I was feeling generous today.
Speaking of looking stuff up, you can do such things quite simply in Leopard with Safari's dictionary dialog. All you've got to do is mouse over the mystery word, then press "Command" "Control" "D." Wah lah! Absolutely majestic!

And there we are, at the end of yet another post, brought to you by the illustrious Peter Story.

Sunday, February 1, 2009

Power Tip #9: The Totally Rad Power of Hidden Files

Today's post is going to concern hidden files, and the two ways to create them on Mac OS X.
Two ways? Yes. Had I read this a week ago, I would have been deeply disturbed. But as I installed iWork yesterday and saw that the background picture file of the install disk had no dot appended to it's name, and was invisible nonetheless, I was compelled to investigate.
*Note* The second method requires Developer Tools. Go Get'um!
http://developer.apple.com/

As I hinted in the intro, the first and most widely known way Finder (Apple's file manager, which displays file location, etc. to the user) recognizes hidden files is by appending a dot to the name of the file/folder in question. For example, below I will use "mv" to rename a folder on my desktop. The original "path" (location and name) is on the left, followed on the right by any location changes and name changes I might want.
mv ~/Desktop/MegaPower ~/Desktop/.MegaPower
And Bazam! It's vanished. If you run the applescripts I've got available on my downloads site, or if your run:
ls -A
In the command line, you'll be able to see them, but otherwise no.

The other way is a bit trickier, and doesn't apply in a traditional Unix setting. As I've been able to piece together, the information executed in the following command is recorded in the concerned file's metadata (extra info that the system uses for cataloguing, etc).
mkdir ~/Desktop/UltraLord
SetFile -a V ~/Desktop/UltraLord
And there we go. Same effect, but without adding an annoying dot to the name of the file/folder. To help you remember:
SetFile -attributes Vistability/visability Path
A lowercase 'V' will make the folder visible again. Fun, but scary, right?

Malware will have a ball on Mac OS X if it ever manages to find a hole in the Mac's impenetrable armor.

Sunday, December 21, 2008

Power Tip #8: Another Powerful List of Unix Commands

It's been too long, hasn't it? Oh well, no use begging for forgiveness.

Today's post is an extension (and possibly completion) of my series of posts on navigating throughout the wonderful world of terminal. So sit back, relax, and enjoy yet another wonderful post courtesy of yours truly.

The first command I'll tell you about is the "mv" command, which in addition to moving files, can also be used to rename them. When using it to move files, the syntax (way you right it out correctly) looks like this:
mv ~/Desktop/"Flipp'inSweetDocument.txt" ~/Documents/Text/"Flipp'inSweetDocument.txt"
First we typed "mv," followed by the original location of the file, and then the location we wanted it moved to. I used quotes because "mv" doesn't like my flipp'in sweet apostrophe. The other usage can be used in combination with this; all that's required is to change the name of the document in the first location to another, as seen below:
cd ~/Documents/Text
mv "Flipp'inSweetDocument.txt" "TotallyRadFile.txt"
And there you go, nice and simple.

The next command I'll get into is the command for making folders, "mkdir." To use it, type the following:
mkdir ~/Desktop/GnarlyDocumentReceptacle
You can also make folders without specify their location (path). Without telling "mkdir" where to put the new folder, it'll assume you want it in your current directory.

And now, the commands you've all been waiting for, the "sudo" and "su" commands. Here's a hint; they give you unlimited power. HAHAHA!!! "Sudo" can be used as a prefix to any other command. For instance:
sudo mkdir /System/TotallyRad
"Sudo" will ask you for your admin password, and after you've given it, you'll be free to do anything and everything on your system. But "su" (short for super-user) is even better. Whereas with "sudo" you must append it every time you issue a command, "su" only needs to be issued once (don't worry, it's not permanent; it goes away after closing your Terminal window).
To use "su" just type it by it's lonesome in the command line. However, in order to enable it, you must first enable the root user. In finder, go to /Applications/Utilities and open "Directory Utility." Next, authenticate by clicking the lock, and go to Edit>Enable Root User. Then make the password something cool.
A clear distinction between "sudo" and "su" is that while "sudo" asks for your admin password, "su" is asking for the password you entered for the root account in "Directory Utility."

Pheew! Well, hopefully I'll get a few more posts up during vacation.

Tuesday, November 11, 2008

Power List #2: Top 5 Preference Options

*As a helpful hint, don't torture yourself trying to read my blog on this site. The formatting is terrible, isn't it?*

peterstory.zzl.org


This not a wimpy list. Don't even think of thinking that. This is a manly list. If you really wanna see what puts the man in this list, skip to number five. I dare you.


Today's list is going to consist of the first five things I change whenever I'm starting fresh on a mac. For some you'll just have to find an obscure check box, for others more terminal fun will be involved, and for others... well, you'll see.


Show Network Drives on the Desktop. This fixes a change Apple made between Tiger (10.4) and Leopard (10.5). Previously, whenever you'd connect to a computer remotely the disks you'd mount would just pop up on the desktop. But with Leopard, they appear in the sidebar instead. All you've got to do is go under Finder -> Preferences in the menu bar. In the General tab, under "Show these items on the Desktop" check "Connected Servers."

Prevent Applications from opening when you insert a CD or plug in a Camera. Basically, I find it to be extremely annoying when programs start launching all over the place of their own accord. To prevent optical disks from opening iTunes, DVD Player, etc. open System Preferences, CDs & DVDs, then change all the options to ignore. As for cameras, memory cards, and those kinds of things, launch Image Capture from your applications folder. Now go under preferences, and make it so that when a camera is connected, no application opens.

Get rid of that shiny dock. I like the dock, I really do. I just don't like it shiny. There's two ways to deal with this. The best way is to open Macintosh HD/Users/PeterStory/Library/Preferences/com.apple.dock.plist with one of the property list editors I mentioned in an earlier post. Then expose root, and change the no-glass value to 'yes.' Of if you're lazy, just type the following into Terminal. "defaults write com.apple.dock no-glass Yes" And there you are, nice and simple. To change it back, just change the 'Yes' back to a 'No' and you'll be good.

Show Folder Information on the Desktop. Again, a nice easy one. Click on your desktop, then go to View -> Show View Options. Once you're there, check "Show item info."

Enable the debug and develop menus in Safari and make googlebot a choosable user agent. Wow all your friends! First, lets enable the debug and develop menus. Here's where it gets tricky. To enable the debug menu, type:

"defaults write com.apple.safari IncludeInternalDebugMenu 1"

The develop menu should be in Safari's preferences under the 'Advanced' tab. So that's neat. As a reminder, make sure you're running a relatively recent version of safari (3.1 or higher, according to Apple).

But before I tell you how to get "the googlebot," let me explain what a 'user agent' is. Every browser has a user agent, it tells websites which one you're using so it can optimize font size and other good things. Some websites, such as ones that also publish magazines, only let certain user agents access the page. This way, google can find the page, and it will turn up in your search engine, but you won't be able to read it without subscribing. Google has a special user agent that lets it do such things. Fortunately, it's no great secret.

Now that you really really want to be able to mask yourself as a bot, you've probably noticed that under the develop menu, you have to option to enter your own user agent. Problem is, there's no way to edit the list. So we're going to edit Safari! Find Safari with your mighty Finder, then right or control click and choose "Show Package Contents." In the folder that should appear, navigate to Contents/Resources and open UserAgents.plist. In the root directory, you'll notice a ton of numbers. Now for the confusing part; follow these directions exactly! Find the number at the bottom of the list, and press the button labeled "New Sibling" twice. If you don't see the 'New Sibling' button, then make sure the highlighted item isn't expanded. After that, change the class of your two siblings to "Dictionary." Expanding both, highlight the first and click "New Child" once, and do the same for the second, except for a total of four times. For the first, rename it's child 'separator,' change its class to 'boolean,' and it's value to 'yes.' For the second, using another property list as your guide if you so desire, change the child names to 'name,' 'platform,' 'user-agent,' and 'version' respectively. Now change their values to "GoogleBot," "whateveryouwant," "Googlebot/2.1 (+http://www.googlebot.com/bot.html)" and "2.1" respectively. With that done, save and check your develop menu.



Wow that was a lot of work.

Saturday, October 25, 2008

Power Tip #7: Troubleshooting Startup Problems

Although I've found macs to be notoriously reliable, every once in a while you're bound to run into trouble, and most of this trouble occurs at startup, or soon after.

Thankfully, Apple has provided a couple ways to deal with most problems.

If your computer can't get past startup, the first thing to do is reset the PRAM, or perimeter random access memory. This stores things like the current date and time, and the default boot disk. This can be done by holding down "Command" "Option" "P" and "R." You can also check which boot disk your computer is trying to startup from by holding "Option" as the computer turns on. I know I've had problems after booting from external drives, then trying to start up without the previous drive connected.

If your computer still won't get past the white startup screen, now would be the time to try booting from another source. If you have your install disks that came with your computer, you can put disk number one in and boot by holding "C" as the computer starts up. Assuming this works, you should be able to use disk utility to take a look at the condition of your computer's internal hard disk and fix it if need be. Another thing you can try booting from is another mac that doesn't appear to be broken. This can be done with a firewire cable, and target disk mode. Target Disk Mode turns your computer into a big external drive. With this method, you'll want to connect the two computers with a firewire cable (while both are off), then start up the working one while holding "T"; if you do it right, a big icon should start bouncing around the screen. Next, start up your 'dead' computer while holding "Option" and when you're given the choice, choose to start from the other computer you're connected to. If you manage to start up successfully, try running disk utility to fix up your broken hard drive.

But what if you don't have another boot disk? Well, you can start up from the firmware/EFI (or memory that has rules for controlling fan speeds, etc.). If you have an Intel mac, this can be accessed by starting up while holding "Command" and "S." And for all you PowerPC users out there, hold down "Command" "Option" "O" and "F." From the command line interface you should meet yourself at, type the following, very carefully:
/sbin/fsck -f
And after that, type exit. Running fsck should fix up your hard disk nice and good.

But if your computer won't even turn on, just try unplugging your it, and leaving it for 15 minutes to a half hour. Then try turning it on. This problem stems from not using a functional power surge protector; your mac's internal circuit breaker (as I understand it) was tripped to prevent the excess electricity from burning out your RAM, processor, etc.
I can vouch for the effectiveness of this technique myself, and I can also vouch for the importance of a good surge protector.

And if none of these tips work, then head on down to your local Apple Store. Unless a part is physically broken, the people behind the Genius Bar will usually be happy to repair your mac for free.

New Site for Blog!!!

Check it out at:
peterstory.zzl.org

In the future I'll be updating both blogs at roughly the same time, so feel free to bookmark the format you prefer. Eventually I'm hoping to get another URL, but that's a job for another day.

Personally, I feel the new site has more character, to be honest. Nevertheless, I'll admit it can be a bit more difficult to read. A high five to my sister for teaching me all the CSS I needed to know to make the layout as good as it is.

Monday, October 13, 2008

Power List #1: Top 5 Utilities

No, I haven't run out of ideas, don't worry :D
Today I'll just be introducing an idea I've actually been thinking about for quite a while.

Today's list will be of the top 5 most useful (and shiny) utilities I've managed to get my hands on (for free!).

  1. TinkerTool, by Marcel Bresink Software: If you've heard of this one before, that's because it's good. Really good. TinkerTool does what it says; it enables hidden features normally accessible solely from the editing of preference list files (you'll find more out about those in number 3).
  2. WakeUp, by Coriolis Technologies: For the few people who need this, it's tremendously useful. What it lets you do is wake your computers remotely. This can be helpful if you, like me, have a server in another room and don't feel like getting up to switch it on.
  3. Property List Editor, by Apple: This one's part of Apple's developer tools suite (Xcode). Thankfully, your can create a free account at developer.apple.com and download it at your leisure. Just like TinkerTool, this is a way to unlock hidden features and tweak things to your liking. However, rather than giving you pre-set options to fool around with, Property List Editor lets you open any of the plist files on your computer. They can be found in ~/preferences (~/ stands for your home directory, or the folder with your username on it, much as / stands for the root directory).
  4. CLIX, by Rixstep: I know I've mentioned it before, but CLIX is a great application, and I'd just feel bad not getting it on here. For those who missed that post, CLIX has lists of command line commands nicely organized for your convenience. You can even, lo and behold, edit certain preference lists with it.
  5. ClamXav, by Somebody: Yeah, I honestly don't know who made this piece of software, but it's pretty good nonetheless. ClamXav is a virus scanner, and even though I don't use virus scanners all that much, it still doesn't hurt to keep one around just in case. Plus, you can use it to check your friend's infested PC, if you're feeling nice.
As usual, I'll give my loyal readers a link to a page that'll keep them going till my next post (whenever that may be).
freemacware.com
That's where I've found more than a few of my handiest applications, so the site's worth a look.