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

Remove footers from 'man' pages UNIX
If you view 'man' pages in the Terminal (or using something like ManOpen in the GUI), then you may be familiar with the footers that are inserted every so often, as shown in this snippet from "man tcsh":
       ......
......
Sets the environment variable name to value.
(Domain/OS only) (+)

Astron 6.10.00 19 November 2000 1

TCSH(1) TCSH(1)

-e The shell exits if any invoked command terminates
......
......
These footers are somewhat annoying in the terminal, and very annoying if you're trying to print the manual in ManOpen, as they do not align with 'real' page breaks.

Carl Lindberg, the author of ManOpen, went looking for a solution to this problem after I (annoyingly?) asked him why they appeared regardless of what kind of tweaking I did in the Terminal. It turns out that the version of 'groff' (a document formatting utility) installed with OS X is a bit out of date. Installing the new version (1.17.2) removes the page footers, making the man pages print quite nicely in ManOpen.

If you'd like to install the newest 'groff', read the rest of the article for the instructions.
read more (169 words)   Post a comment  •  Comments (8)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[3,686 views] Email Article To a Friend View Printable Version
Secure and easy OpenSSH key management UNIX
Security is good and passwords are boring. I use RSA/DSA key authentication when I connect to my web servers via SSH and made a habit of not setting a password for the keys. This way I could connect without logging in. Very easy but not very secure if someone got their hands on my RSA/DSA keys.

Thanks to the article "OpenSSH key management" by Daniel Robbins, Part 1 and Part 2, I now have a secure *and* convenient setup.

The program that made the solution extra good is Keychain, by the author of the article. Install Keychain and then add the necessary lines to your login script.

Read the rest of this article for an example using the Bash shell...
read more (112 words)   Post a comment  •  Comments (4)  
  • Currently 1.25 / 5
  You rated: 2 / 5 (4 votes cast)
 
[43,216 views] Email Article To a Friend View Printable Version
Better hostname completion UNIX
The default global completions file that comes with Mac OS X uses /etc/hosts to get a list of hostnames. This isn't terribly useful since that file generally never contains anything useful (and there is a comment in the completions file suggesting that it be replaced with something smarter).

Create a file in /usr/local/share/ called common_hosts (make sure it is world readable - 'chmod 644'). Inside this file, list common hostnames (on seperate lines) that you commonly have to type out.

Now edit line line 83 of the global completions file (/usr/share/init/tcsh/completions) so that it refers to the new /usr/local/share/common_hosts file instead of /etc/hosts. i.e.: alias list_all_hostnames 'grep -v "^#" /usr/local/share/common_hosts'

Say your common_hosts file contains the hostname:
dhcp-user.192.168.1.1.somehost.edu

If you need to ssh or that host you could just type:
ssh dhcp[tab]

And the shell will expand the hostname.
  Post a comment  •  Comments (6)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,864 views] Email Article To a Friend View Printable Version
Restart scripts for system services UNIX
I haven't seen this posted anywhere, but Apple has included several scripts to nicely restart various services (as opposed to using ps and manually kill HUPing the daemons)

They are located in this directory:
/System/Library/SystemConfiguration/Kicker.bundle/Resources/
The scripts are:
restart-AppleTalk
restart-automount
set-hostname
restart-NetInfo
restart-lookupd
The names are self explanatory. Run them as root. Quite useful if you are doing work remotely.
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[6,151 views] Email Article To a Friend View Printable Version
MySQL 3.23.45 fixes shutdown problem UNIX
One of the big problems that anyone who wants to use MySQL on OS X faced until now was the inability to safely shutdown the MySQL daemon. Version 3.23.45 was released in the last day or so and fixes this long-standing bug. More information on the changes since the previous version can be found here.

I've downloaded and compiled this version from the source code using some pretty standard configuration options (see below for what I did) and everything appears to be working wonderfully.

Here's the breakdown of my configuration options:
./configure 
--enable-assembler
--prefix=/usr/local/mysql
--with-named-z-libs=/usr/local/libz.a
--with-innodb
--with-mysqld-user=mysql
Then just run the make and make install commands to compile and install the new binaries. I suspect Marc Liyanage will shortly post a precompiled binary installation but if you're somewhat impatient like me, you can always go this route.

As always, more information can be found on the MySQL website.
  Post a comment  •  Comments (4)  
  • Currently 3.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[4,478 views] Email Article To a Friend View Printable Version
Colorized 'ls' in the Terminal UNIX
I was talking to someone over on MacSlash and they commented that their 'ls' command didn't output in color. Hmmph...mine did. I looked and found that I had some "carry-overs" in my .cshrc file from my SGI box. To give yourself colorized 'ls' add the following lines to the end of your .cshrc (if you are using tcsh as your default shell):
  alias ls 'ls-F'
setenv LS_COLORS 'di=35:fi=0:ex=31:or=90'
set color
You can change the colors and/or styles for different types of files by using the variables on the second line. Linux StepbyStep provides a good reference guide on color setting.

Hope everyone enjoys their color!
  Post a comment  •  Comments (6)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,272 views] Email Article To a Friend View Printable Version
A perl script for managing shared folders UNIX
When I first read the tip about sharing different folders, I thought surely someone will come out with something, and I was right, SharePoints came out, but it was lacking some functions I wanted, like restarting AppleShare.

So I started working on a tool in perl to take care of it for me until a newer version of SharePoints came out that would address these issues. While sharepoints is a great tool with a nice GUI, its new version still lacked this functionality, so I decided to post this one in case anyone wanted to use it.

Read the rest of this article if you'd like to see the script and how to use it...
read more (329 words)   Post a comment  •  Comments (0)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[9,136 views] Email Article To a Friend View Printable Version
Compiling and installing the latest OpenSSH UNIX
If you've tried to compile and install openssh yourself, chances are you got the error "Built against 90581f, you have 90602f" that happens when you try and build a new version of OpenSSH."

Most people just punt and stick with the older version of openssh provided with Mac OS 10.1. The trick to compiling openssh so it doesn't give that error is to completely remove the openssl installation and rebuild and install it from source.

The openssl source can be found at Apple's Open Source website. Beware though, the installer doesn't copy over all the header files. You'll need to manually put them in your include/openssl/ directory.

Once you've succesfully done that, you're all set to install the latest version of openssh (3.0.1p1) without any openssl mismatch problems!
  Post a comment  •  Comments (1)  
  • Currently 4.00 / 5
  You rated: 4 / 5 (3 votes cast)
 
[8,127 views] Email Article To a Friend View Printable Version
A primer on using 'jot' in UNIX UNIX
I am new to Mac OS X but come from the FreeBSD world so I'm having fun finding out what is here and what isn't. I just realized that one of my favorite tools, 'jot', is here and I wanted to point this out to people. jot allows you to print sequential and random data. More specifically, it allows you to do some really cool things in the shell. Let me give you an example.

I am a big fan of the online music trading organization Etree. There are well-established ways of organizing and naming the concerts that are traded. Occasionally I'll come across a downloaded show that doesn't follow the scheme. Say there are several songs from a Phish show named something like '2001-05-26-phish-d1t1.shn'. The correct format should be 'ph01-05-26d1t1.shn' It would be a real pain in the ass to rename them, right? Well, with jot the answer is a resounding "NO!"

Read the rest of this article for a great primer on using 'jot'...
read more (657 words)   Post a comment  •  Comments (5)  
  • Currently 4.00 / 5
  You rated: 1 / 5 (4 votes cast)
 
[15,560 views] Email Article To a Friend View Printable Version
Exit XWindows cleanly from console mode UNIX
If you use the XDarwin implementation of the X Windows system from console mode (logging in as >console and bypassing Quartz), you might notice that (on my machine at least) exiting X gives you a blank screen and a spinning rainbow cursor. The computer looks frozen, but in fact is still accepting input: typing "exit" or "logout" at this point will bring you back to the login window after a brief pause.

If you find this a little less than smooth, as I do, you can preface your "startx" command line with the "exec" command like this:
exec startx [X startup options ...]
This little UNIX trick starts X while ending your logon shell, instead of just running X as a child process of your shell. The upshot is that when you exit X, you're immediately returned to the login window, instead of having to type unechoed characters to a beachball. A minor tip, to be sure, but it makes running X from the console a little more elegant.
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[5,262 views] Email Article To a Friend View Printable Version