Even after trying this hint, I was still unable to get Windows XP to keep the right time. I could sync it over the internet using the Internet Time sync feature, which would fix it, but after a few hours, it would mysteriously go wrong again.
Then I found this page, which has some neat tips about adding new time servers, and (more importantly) making the automatic syncing more frequent. After changing the registry value (it mentions to a smaller value like 60; make sure you aren't in base Hexadecimal), and logging out or restarting, Windows will sync the time more frequently, correcting it when it goes wrong.
It's not the best solution, and the problem still occurs, but it shouldn't be noticeable anymore.
[robg adds: No, we won't regularly run Windows hints, but as noted on the linked tip, if they seem general enough and relate to the basic system, we will -- there are a fair number of Mac users who do run Windows on their Intel Macs, and this information can be of use to them. Note that we've only run a handful of such hints since the Intel Macs shipped, so there's no fear of the site's focus changing! :) ]
Often, a user may set up a preset via the Print dialog box, for example, to use when printing a photo with high quality settings. If the user forgets to reset the preset to defaults, the OS does not do this for him. One way to reset this, of course, is to go to File » Print, select the default preset, and then print the document. This wastes ink, paper, and time. But if one selects the default and then clicks Cancel, the previously-selected preset will still be in effect.
The workaround is to go to File » Print, select the default preset, but then click Preview instead of Print. Once the Preview window is open, simply click Cancel; the default preset is now selected for subsequent print jobs.
I've been a Mac user since the 512, yet this took me by surprise. Suddenly the type on just about everything on my desktop seemed a bit darker and a little blurry. I was convinced that my monitor was going ... or worse, the computer was not sending it the correct voltages anymore. I was minutes from getting it ready for repair, then I decided to look around a bit.
Somehow I had hit a keystroke combination which barely engaged a zoom feature -- just about 1% or so, barely off of zero. I didn't even know I had a zoom feature! I went to the System Preferences » System » Universal Access, and turned Zoom off (how did it get turned on?). This immediately brought my monitor back to the razor-sharp images I had been looking at for years. Whew! A close call, based on a very simple thing that many of us forget is even there.
[robg adds: The keyboard combo is Command-Option-Equals, and I think Zoom is enabled by default.]
I just got done re-installing OS-X (an old Microsoft habit, I guess), and was installing XCode when I realized that almost half of the installation size of XCode is the documentation. I need that documentation, but hate to see 1.3 Gb of my hard drive gobbled up by something that is:
Very compressible
Not demanding on resources
Only rarely used
So I hatched the hare-brained idea to compress it -- and it worked! I've cleaned up the code, so fire up Terminal and do this:
That will build the compressed reference library in the Developer folder. Once you are done, delete the "old" reference folder, and make an empty placeholder for later:
Note: I didn't sudo the mkdir command on purpose, to keep the following Folder Action from prompting me for a password just to open the Developer documentation.
If you have a number of words to add to Apple's spelling dictionary, it can get cumbersome; you have to type the words into a document, then spell check and add them one at a time. Or, as detailed in this previous hint, you can open the "en" file (for English) and type them there, copying and pasting a non-printable character (represented by an upside-down question mark in the file). Until now, that is.
Now you can simply run this Applescript that I wrote. You type each word, press Enter after each word, and then click the Finished button after you're, well, finished. Then click on the dictionary file you wish to update (normally the "en" file for English), and it's done.
[robg adds: I couldn't get this one to work in my testing, but it's working for the author and others, so here it is -- please post your experiences, especially if it won't work for you and you can figure out why :). On my machine, the script works, and I can apparently add words, but they continue to show up as misspelled in my documents.]
If you create many access control lists (ACLs), you might want at some point to flush them all. Unfortunately, there's no single command that allows you to remove all the Access Contrll Entries (ACEs) on a file at once, you have to remove them one at a time until there's no more left. There is no elegant solution, but this one-liner will remove all ACEs for you:
until ! { /bin/chmod -a# 0 filename 2> /dev/null; } do echo -n; done
Using the above, you could also create a small script that will recursively remove all the ACEs on a given directory:
#!/bin/bash
for file in $(find $1)
do
until ! { /bin/chmod -a# 0 ${file} 2> /dev/null; } do echo -n; done
done
This hint was emailed to me by Alexandre B. I haven't tested it, as I don't use ACLs. If you do test it, please leave a comment on your experiences.
I had the recent unforunate occurence of having my machine hacked into. And no, it wasn't a security hole, but simply a really weak password that was compromised through a brute-force ssh attack. During my audit/clean-up, I was trying to figure out what all the attacker may have installed, since I initially found a shellbot perl script running under the compromised account.
When a machine is compromised, you want to see what servers it may have installed, listening on your system. To do this, you need to "identify" all of the processes running servers. Normally you do this with fuser or netstat -nlp. Unfortunately, neither work on OS X.
I finally figured out how to do this, and just wanted to post it online so others searching could find it. In Terminal, just run this command:
lsof -i | grep LISTEN
This will list all processes that are listening on your machine. That's it!
I remember at one time being excited to find a "Create Font Sample" script -- it's in the AppleScript menu, under Font Book » Create Font Sample. I remember being disapointed to find out that it only worked on certain fonts. The only way I would be able to make it work would be to add all the fonts to the script.
Today I wished I had a sample of the couple thousand fonts I have on my system, so I decided to look at the "Create Font Sample" script again. Much to my delight, I found that, at some point, Apple fixed this potentially handy script and it now works. I don't know when they fixed it, but I'm glad they did.
[robg adds: I found that, on my machine at least, this script only samples the selected font families in Font Book. The first time I ran it, it printed exactly one sample font. When I looked at Font Book, that font was selected in the Font column. So I clicked on it (to make sure the Font column was active), then pressed Command-A (to select all), then re-ran the script. The script then created a new TextEdit document with a sample of every font on my machine. So if you don't get the results you expect, check the Font column selection in Font Book.]
Here's a hint ... don't put a mini CD in your MacBook! If you do, like I did, and it gets stuck, like mine did, well ... I managed to get it out by turning my MacBook on its side and shaking it.
[robg adds: Mini CDs (and any other non-standard CD size or shape, for that matter, should never be put into a slot-loading CD/DVD drive on any Mac that is thus equipped. If you have a tray-loading drive, I think the Mini CD format might work, but I haven't tested one myself.]
If you need a quick way to get the full path to a file or folder, save the following Applescript as an application:
on open {dropped_item}
tell application "Finder" to set the clipboard to the ¬
dropped_item as text
end open
Copy and paste the text into Script Editor, then choose File » Save As, and set the File Format pop-up to application. Then whenever you need to get the path to an item, simply drag that item onto your script's application icon, and the path to the dropped item will be placed on the clipboard.