Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Setting up lpd printing on OS X UNIX
lpd is the standard Unix printing system, so others who come from the Unix community (as I did; a longtime Linux and NeXT user) might be interested in sharing their printers to their other Unix machines.

See, not having lpd as the printing system in OS X was a big bummer to me, because it meant that I could no longer print with my NeXT and other Unix computers, because my printer is now hooked to my G4 Cube (permanently assigned to OS X 10.1). With this little hacked up lpd, I can now do that again. :)

Read the rest of the article for the how-to.

[Editor's note: I have not done this on my machine as of yet, but 'eagle' vouches that it works but only on PostScript printers! Any errors in the following article are a result of my formatting work; please let me know if you see any troublesome lines!]
read more (338 words)   Post a comment  •  Comments (9)  
  • Currently 2.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[18,666 views] Email Article To a Friend View Printable Version
Run a caching-only name server UNIX
This one is for you hacking nuts that do absolutely everything possible to optimize your OS X machine.

If you are on a broadband network, then you can slightly optimize your internet access by installing bind, the Berkeley Internet Name Domain server name server as a caching server.

Using this caching nameserver setup should give you instant dns lookups on (pretty much) any hostname that has been used by any application on your machine at any time since the last reboot. Thus, if you access ftp.xyz.com using Fetch, the nameserver will look up the hostname and store it, so that tomorrow when you access it with Internet Explorer the caching nameserver will return the lookup information instantly.

If you'd like to set this up on your machine, read the rest of the article.

[Editor's note: I have not tried this myself yet, and it's a relatively complex hint. I believe I didn't lose anything in the formatting process, but please post if you notice any errors.]
read more (722 words)   Post a comment  •  Comments (30)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[21,188 views] Email Article To a Friend View Printable Version
High bit shell commands with AppleScript UNIX
I have written a script (with the help of James Sorenson) that allows AppleScript to execute shell commands containing high bit characters via the Terminal. The script additionally allows a very long sequence of commands to be run.

Please be careful with this for the time being. I have only tested it a little, and I would appreciate any input.

Download the Script

Note: The script passes the commands directly to the terminal, so you need to properly quote and/or escape the strings beforehand. Check out this hint for a way of doing this.
  Post a comment  •  Comments (0)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[3,431 views] Email Article To a Friend View Printable Version
One step User folder backup UNIX
This is just a couple of tips from the MacOS X Solutions Guidebook combined together in a way that some friends and I have found rather useful to quickly backup our home folder (requires Developer Tools Installation).

Read the rest of the article for the how-to...
read more (125 words)   Post a comment  •  Comments (20)  
  • Currently 3.00 / 5
  You rated: 3 / 5 (2 votes cast)
 
[7,235 views] Email Article To a Friend View Printable Version
Security considerations with root's crontab UNIX
Many people, in editing the root user's crontab, may not be mindful of the great security risks involved. I felt that it should be mentioned here that anyone who makes use of cron must be thoroughly cautious of the commands and programs that are to execute on a regular basis. Essentially, one should take precautions to ensure that the program/script/command executed by a user's crontab should be writable only by that particular user.

A sobering example is one in which a script is set to be run every x hours via the root user's crontab (/etc/crontab). If this script has its file permissions set such that any user can write to it, you have essentially provided a means for any user on your machine to execute any arbitrary command as root.

I realize that this may be obvious to some people, but for those who are not particularly mindful of computer security, it has hopefully drawn some awareness.
  Post a comment  •  Comments (0)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[5,035 views] Email Article To a Friend View Printable Version
A home made alarm clock script UNIX
This hint covers using a combination of the UNIX shell and AppleScript to make a simple but effective alarm clock. If you are like me, you are a geek that never turns off his/her computer. ;-) My iMac runs Seti@home and another distributed computing project all the time, so I rarely turn it off.

I figured out how to make a simple alarm using the terminal and AppleScript to cause a voice to start talking in the morning to wake me up.

Read the rest if this interests you.
read more (233 words)   Post a comment  •  Comments (2)  
  • Currently 2.67 / 5
  You rated: 1 / 5 (3 votes cast)
 
[14,819 views] Email Article To a Friend View Printable Version
Global xhost setting for X windows UNIX
After I set up X windows I ran into a small problem: I run X windows applications on a number of servers at work (some of them are randomly chosen by the application), but I don't want to have to use "xhost +" to allow any machine to access my X server (doing so opens up all kinds of security risks). Issuing multiple xhost commands in my .cshrc file works well enough, but when .cshrc is run by Terminal.app, I get an ugly error for each xhost command.

The solution I found is to create a file "/etc/X0.hosts" (that's x-zero) which includes the names of all hosts that shall be allowed to open windows on my system. It's global, and thus not an ideal solution, but it works for me.

If you have a better solution please let me know!
  Post a comment  •  Comments (6)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,008 views] Email Article To a Friend View Printable Version
Automate FTP server logins from the Terminal UNIX
You can make file that holds a list of machines and their associated usernames and passwords quite easily. This file is also recognized by wget (a powerful ftp and http client). You need to be in your home directory and type
pico .netrc
This will open a text editor into which you type:
machine machine_name_or_IP# user your_username password  your_password
Then type control-X to save the file and exit from pico.

At the terminal prompt type:
chmod 700 .netrc.
This makes the file readable only by you.

Now when you ftp to that machine you will automatically log in. You can add additional machines one line at a time. If you want, you can make the last line look like this:
default user anonymous password name@machine.net
This will enable anonymous login. Even better is that wget recognizes this file and automatically logs into the machines specified. I got this from the ftp man page ('man ft' in the Terminal), very near the bottom. Enjoy!
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,814 views] Email Article To a Friend View Printable Version
Use Terminal with X11 instead of xterm UNIX
This is a relatively simple hint, but it makes sense for people who use X11 (XDarwin) in rootless mode. A shell environment variable "DISPLAY" tells XWindows applications where the windows should display. When you start XDarwin, DISPLAY is automatically set to :0.0, but this variable only gets exported to new xterm shells.

xterm is slow while scrolling, yet Terminal.app is quite quick. Why not use Terminal.app instead of xterm? To do this, use this command in a variant of csh.
setenv DISPLAY :0.0
(if you don't use a variant of csh, you will need to know how to set environment variables in your shell.)

Put this in your shell init script (which is most likely .cshrc for those who haven't changed their default shell or made a .tcshrc file instead) or just use it at the command prompt. From then on, you can use Terminal.app to open your x windows apps.

This is only useful if you're using XDarwin in rootless mode; it looks great with OroborOSX!
  Post a comment  •  Comments (7)  
  • Currently 3.00 / 5
  You rated: 4 / 5 (2 votes cast)
 
[13,409 views] Email Article To a Friend View Printable Version
Finding files with 'locate' UNIX
A while back there was a post regarding using 'find' to locate all non-English .lproj files.

Since then, I still haven't gotten the hang of 'find'. But my find demands are fairly minimal. Even so, it'd be nice to have a simple CL utility for searching. Today I ran across an article at O'Reilly & Assoc. that mentions the program 'locate'. Check out Unix for the Rest of Us for a great overview of the UNIX underpinnings of OS X (on the first page) and a detailed example of using 'locate' on the second page.

[Editor's note: This is an article from June, but it's still quite relevant today, and makes for good reading. Once you understand how locate works, go grab a copy of the freeware program Locator, which wraps a nice Cocoa GUI around the 'locate' command, allowing you to run lightning-fast searches from the GUI. Locator's speed leaves Sherlock in the dust.]
  Post a comment  •  Comments (9)  
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[4,704 views] Email Article To a Friend View Printable Version