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

Burn discs from the terminal UNIX
From Ian M's blogger page:

"Open /usr/share/init/tcsh/aliases and add:
alias burn 'hdiutil burn'
alias mount 'hdiutil mount'
alias eject 'hdiutil eject'
so you can burn, mount and eject disk images on UNIX off the bat without the hdiutil thing, quite a simple trick. /usr/share/init/tcsh/aliases is for a system-wide implementation of aliases, for a per-user implementation use ~/aliases.mine."
  Post a comment  •  Comments (3)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[4,915 views] Email Article To a Friend View Printable Version
XFree86, fink, etc - Solution Guide #1 UNIX
[Click here for a large version of the image]


IMPORTANT NOV 14 UPDATE: The Mac development community appears to have lost a key member. Christoph Pfisterer, the lead developer on the Fink project, has given up. He lists the causes in his resignation letter, which I strongly encourage all of you to read. In particular, follow the links at the end of the letter for some excellent examples of how not to work with the Open Source development community. If you're interested in Fink at all, please take a moment and send a letter of thanks to Christoph for all his efforts. His contributions cannot be overstated, and he will be missed.


NOV 6 UPDATE: XDarwin 1.0.4.1 is now available from xdarwin.org. It addresses a number of bugs; see the comments for my posting with the full list of fixes.

UPDATE: Version 1.1 has been posted with a couple of typo corrections and a new expanded section on the methods of installing packages using Fink.

Although there have been a number of threads here on the installation and use of XFree86 (an open-source version of the X Window System) on OS X, I hadn't had much luck getting it installed on my system. Then I found Fink, an amazing package installer for OS X. With Fink, literally hundreds of pre-compiled UNIX and X Window applications (including XFree86) are as easy to install as typing a sentence. So I installed XFree86 (in two separate wasy), Fink, WindowMaker (a window manager based on Next's OpenSTEP), and GIMP (a complex image manipulation program that rivals Photoshop in its complexity).

Although Fink makes this all quite trivial, I still stumbled a few times, given my relative lack of experience with UNIX and total lack of experience with XFree86. So I decided to write up a simple guide on the installation of these packages on OS X. The result is the first of an occasional (whenever I get the urge and time!) series of "Solution Guides", which will explain exactly how to get certain things done on OS X.

This particular guide covers XFree86, Fink, WindowMaker and the GIMP. It is designed for XFree86 novices (like myself!), and does not go into the much detail on how to use what's been installed. It simply relates the steps I used to get each piece running. If you're an advanced user, there's probably nothing there you haven't seen before. So if you'd like to get the above programs running on OS X, take a look at the Mac OS X Hints Solution Guide #1. As with anything like this, what you do to your machine is your responsibility, so make sure you have a backup before you start!

All comments and technical corrections are welcomed, but I cannot possibly respond to all the individual questions that may arise. Feel free to post them here as questions in the comments area, however, and someone will more than likely respond.
  Post a comment  •  Comments (33)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[10,789 views] Email Article To a Friend View Printable Version
Kill any process by name UNIX
To kill an evil process you have to find the process ID through top or ps, in short it's a long process.

I devised a way around this using embedded commands. Type the following into the terminal to get a kill that works on process names:
alias newkill 'kill `top -l1 | grep -i \!* | cut -c1-5`'
The command outouts a log version of top that gets passed to grep that searches for the string you enter, cuts the first 5 characters, the PID and finally passes that to the kill command.

Be careful, top doesn't always display the entire name of the process and it will match all instances of the string and kill them.

[Editor's note: Definitely use some care here! Others simply use a modified "grep" and "kill" combo to accomplish the same thing. If you want this to be permanent, it will need to go into your aliases.mine file.]
  Post a comment  •  Comments (2)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[7,596 views] Email Article To a Friend View Printable Version
Terminal command history keystroke UNIX
Nifty little feature of the Terminal. If you press the up and down keys, it'll cycle through a history of the commands that you've entered. Handy for that annoying directory that you misspelled trying to switch. Just press the up key and make the necessary changes.

[Editor's note: If you're new to the Terminal and UNIX in general, I highly recommend a couple of things. First, read Neal Parikh's Terminal Guide, linked in the top right box off the macosxhints' home page. Second, download ManThor, a Cocoa application for reading UNIX manual pages ("man pages"). Install and launch ManThor (which features formatting, printing, and searching - all free!) and then type "tcsh" in the search box. The man pages for tcsh are very very thorough, and explain about the history buffer as well as a number of other cool features. Well worth the reading time!]
  Post a comment  •  Comments (8)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[6,137 views] Email Article To a Friend View Printable Version
Unstuff from the commandline UNIX
It's been a personal peeve of mine that Aladdin makes a CLI interface to their product for Linux, but not for the Mac. Here is a quick alias to fix this. It's not perfect (if you aren't logged in, this will have problems), but it works. The command to create the alias is:
alias   unstuff "open -a '/Applications/StuffIt Lite 6.5/StuffIt Expander.app'"
(your path to StuffIt Expander might be different)

Example usage:
% unstuff somearchive.sit

[Editor's note: To make this alias permanent, search here for 'alias' for instructions on creating your own alias file.]
  Post a comment  •  Comments (4)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[9,751 views] Email Article To a Friend View Printable Version
A script to help change file user ID's UNIX
I am in the process of getting my Mac integrated into our unix environment so I can NFS mount the unix directories. That meant that I had to change my UID on my Mac to match my Unix UID.

Using NetInfo Manager, it's easy enough to change a UID, and it also nicely updates the UID of all of the files in your official home directory. However, I had created files throughout the system as I installed software and such, which meant I had to update the owner of all of those files myself.

To automate this process, I created the following perl script. It takes the old UID, your short username and the directory to fix (allowing you to selectively fix directories, or allowing you to fix removable media at a later time). If you want to fix everything, just give it '/'.

[Editor's note: Read the rest of this article for Scott's script. I have not tried this on my machine.]
read more (186 words)   Post a comment  •  Comments (10)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[24,650 views] Email Article To a Friend View Printable Version
Make Apache parse regular HTML files for CGI's UNIX
If you use CGI's on your web pages (counters, etc.), then you've had to enable "shtml" processing in your httpd.conf file. Sometimes, though, you just want to stick a CGI counter on a plain boring HTML page. The standard solution is to rename the file with a .shtml extension so Apache will parse it. However, if you don't want to rename your files (as you'd then have to fix broken links from other pages), you can use the XBitHack flag in httpd.conf. Enter the following in your /etc/httpd/httpd.conf file:
XBitHack on
This directive tells Apache to treat any file that has the user-execute bit set as a server-parsed html document. So simply change the user 'execute' bit (chmod u+x filename.html) of any of the regular HTML files that you want parsed, and Apache will do the rest.

Remember to stop and restart the server for your changes to take effect. Note that I have not tried this yet on my Apache install, but this is basically right off the Apache documentation pages, so it should work as described.
  Post a comment  •  Comments (3)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,720 views] Email Article To a Friend View Printable Version
Useful utilities - GetFileInfo and SetFile UNIX
Stuck (almost uselessly) in /Developer/Tools/ are two rather incredible little guys you should immediately link (ln -s) right into /usr/bin/. They are GetFileInfo and SetFile.

For more on how to use these tools, including exactly how to create the links and how to hide a given volume on the desktop (for example), read the rest of this article.
read more (254 words)   Post a comment  •  Comments (5)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[23,839 views] Email Article To a Friend View Printable Version
Go to web pages from a shell UNIX
alias go "osascript -e 'open location \!:1'"

This is a neat script to put in your aliases.mine (.cshrc) file. Whenever you need to go a webpage just type go followed by the website in quotes.

ie:
go "http://www.linville.org"
  Post a comment  •  Comments (4)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[2,744 views] Email Article To a Friend View Printable Version
Use the command line to access files faster UNIX
The 'open' command from Terminal command line is like a double-click on an object, and sometimes it is much faster than using the Finder, at least for me. I've been a CLI user for decades and while I appreciate the GUI, many times it is too slow. Often the Finder requires far too many operations to get to the file or folder that I need to work on. Why 'Find' a location in the directory tree when I already know where it is?

Read the rest of this article for an interesting write-up on using the command line to improve the efficiency of the OS X GUI.
read more (243 words)   Post a comment  •  Comments (4)  
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[5,716 views] Email Article To a Friend View Printable Version