Here's a nifty but somewhat useless quickie that will pick random words from the built-in dictionary file:
perl -e 'open IN, "</usr/share/dict/words";rand($.) < 1 && ($n=$_) while <IN>;print $n'
Inspired by an example in the 'Camel' book and the fact that I couldn't come up with a non-Bash way to generate random numbers from the shell. (Any ideas why there's no /dev/random? It kinda seems that this was a design decision rather than an oversight...)
The /usr/share/dict/words exists on most Unix systems. Curiously, the words seem to be different from that of the system-wide spellchecker service built into OSX.
You can use the standard backtick operator to plop the word into another cmd-line program.
DO NOT *EVER* USE THIS [OR ANY DICTIONARY] TO GENERATE PASSWORDS!
[To the editor: I admit this is sort of off-topic as far as Mac OSX is concerned. Perhaps you can use it when there's a dry spell in hints or as a 'stupid shell tricks' feature.]
[From the editor: Hey, it is a bit slow with everyone awaiting 10.1's arrival, and this is an interesting trick. There are some strange words in the dictionary!]
I have spent the last few days trying to get xspim (a MIPS emulator) to work with OS X and have finally got it going. After spending many frustrating hours on it I figured that I would post how to get it working for the few who might need it (unless you are really into assembler or need it for class or work there is really no point). fyi: download spim from here
Read the rest of the article for detailed installation instructions...
Is there a way for me to let a script (or something similar) always check whether I'm online and to re-connect when I'm not? I have a dsl flat and would like my ftp and webserver to stay online. my isp tends to disconnect if after some idle time, and i'd rather not do a permanent ping which is good for "faking" user activity.
While working on an iMovie project tonight, I noticed something about the (much much loved!) ability to render transitions and other effects in the background. I started a large number of transitions rendering (probably 10 or so), and then switched back to the Finder. The machine (a G4/733) was usable, but very very jerky. I saw the spinning rainbow occasionally, and switching apps and selecting menus was very slow.
In the interest of trying anything to see if I could regain some speed, I hid the iMovie application. Amazingly enough, this made a huge difference. Although I can still tell there's background work going on (the CPU meter is pegged, for example), I have full control over the machine, the windows don't lag, and I haven't seen the spinning rainbow since hiding iMovie.
This is a very small sample size (one machine!), so I hate to jump to conclusions, but I've repeated the experiment a number of times with the same results. If iMovie is visible in the background while rendering, the machine slows dramatically. If iMovie is hidden while rendering, it's hard to tell there's much out of the usual going on.
If you work in iMovie, give it a shot and let me know if you see similar results...I'm intrigued!
The terminal's font spacing (even for monospaced fonts) suddenly went wacky and I haven't had any luck getting things back to normal.
Typed entries at the command line and even in editors like vi are offset by half a character to the right (relative to a normally positioned text, as output by "ls" for example). Pressing backspace returns the remaining characters to the "correct" position.
After deleting the terminal preferences, things go back to normal until the font size is changed from the default size.
Has anyone seen the following problem? If so is there a recommended remedy?
In the midst of looking for something else, I stumbled across an 'older' (May 2001) article concerning power management with OS X on PowerBooks. In the text of the article, there's a fairly good example of how to use "ps" and "grep" and a couple of other UNIX commands to get a handle on what may be going on with your system if you're experiencing slowdowns or fast-draining batteries.
If you're interested, head over to O'Reilly's web site and read Mac OS X and Battery Life by Derrick Story. Although Derrick wrote the story, the majority of the content is from a note submitted by Peter Fraterdeus, a long-time Mac user and developer. Peter gives some very good examples of how to use the features of the core UNIX system to identify potential trouble spots. Most of the article is relevant not just to PowerBooks, but to Mac OS X users in general.
If you're wondering why OmniWeb 4.0.X displays Arial instead of Verdana when Verdana is selected as the proportional font (very annoying and ugly IMO), I've been told by tech support at OmniGroup that there is a problem with the font metrics for Verdana under Cocoa and they are waiting for Apple to fix it before they re-enable Verdana in OmniWeb.
(Can anyone suggest a good non-serif replacement for Verdana until this is sorted out. I can't live with Arial or Helvetica so I've gone back to Geneva for the moment.)
Since reading a recent Hint, I'm compiling a C++ scientific computing package to run on OSX and do some parallel calculations on my dual G4 (MPI and OpenMP). It's all working fine except when I turn on a feature that uses the functions drand48() and sdrand48(), which are a random number generator and a seed respectively. In OSX they aren't defined.
On other *nix systems these functions are defined in stdlib.h, and the corresponding library. Taking into account that I have never compiled a library without explicit instructions - is there an easy way to add these functions without doing anything dangerous to the libraries that came with OSX? Could I replace the standard library safely?
I've currently installed bash and rpm if that would shorten the instruction list at all. Thanks for any help,
i think i saw a link here about this--cant remember [Editor: I thought I remembered it, too, but can't find it anywhere!]. anyways, here's a really cool UNIX admin application i just downloaded. go to: The Moose's Apprentice page and check it out.
i haven't had time to "battle test" it yet, but the documentation is *excellent.* I'll use it tonight to restrict ftp users to their home directories...an app like this is precisely what ive been looking for. hope it lives up to its potential.
[Editor's note: Based on a quick five-minute look, this looks like a very impressive application. It gives you a GUI tool to manage many of the low-level UNIX tasks, such as cron jobs, FTP user access, allowed shells, and authorizing services by user and address. Worth a look-see if you're looking for a way of handling some of the UNIX stuff without diving into the terminal. A note of caution, though - this app will let you change things that you may not fully understand! Make sure you have some concept of what you're changing before you start tweaking the settings...]