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

Using the 'cron' scheduler System
UNIX includes a program named 'cron' to handle the execution of tasks on a specified schedule, regardless of whether the user is logged in or not. Cron does this through a series of simple text files known as 'crontabs' which control the scheduling of jobs.

The cron daemon is used by the system for scheduled daily, weekly, and monthly maintenance, and can be used by users to run various programs at set intervals, such as to handle my site backup program as described elsewhere on this site.

Read the rest of this article if you'd like a simple overview of what cron is and how it can be used.
read more (493 words)   Post a comment  •  Comments (14)  
  • Currently 3.11 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (18 votes cast)
 
[266,144 views] Email Article To a Friend View Printable Version
How to automate a remote backup UNIX
This past weekend, I took advantage of OS X's UNIX core to automate the database backup for this site. Until recently, I backed up the data by connecting to the ISP, launching the mySQL database program, exporting the data, then using one of a number of transfer programs (Fetch, RBrowser, etc) to bring the file back to my home machine.

Although this worked, it was quite tedious, and I would often forget to do the backup. Then another geeklog-powered site had a major disaster, and lost all of their articles (macosxapps.com, if you'd like to stop by and help them rebuild, it'd be greatly appreciated!). This was the kick I needed to find a better way to do my backups.

Read the rest of this article if you'd like a little insight into how I used some basic UNIX programs to handle this repetitive mundane task. This is fairly basic stuff for UNIX wizards, and I'm sure I could be doing this in a more advanced way, but it does demonstrate how the UNIX core of OS X can be put to good use.
read more (605 words)   Post a comment  •  Comments (5)  
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[24,712 views] Email Article To a Friend View Printable Version
More login window customization System
login panel
(Click here for larger image)

In an earlier item, links were posted to Jordan Miller's site on altering the images used by the LoginWindow app. If you want, you can carry this bit of fun to more of an extreme.

First, you will have to register as a developer and download the OS X developer tools (instructions are elsewhere on this site). Don't be afraid, you can do a bit of interesting stuff with Interface Builder if you are careful. You can change the size of the image, the colors/styles of the fonts, placement of the buttons, etc. You can see an example of this in the screenshot above. The original screen is at 1280x1024. The image is of the wonderful David Hockney work, Kyoto. It calms me down before I login.

If you'd like to know how to edit the login window extensively, read the rest of this article!

[P.S. -- Are there any Cocoa programmers out there that can tell me what loginwindow is doing that makes the purple background not be captured when I try to capture the screen content? Is it drawing the background directly to video memory? Is there a way to capture the whole shebang?]
read more (335 words)   Post a comment  •  Comments (7)  
  • Currently 1.67 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[11,477 views] Email Article To a Friend View Printable Version
jEdit 'find' history Apps
If you use jEdit (see Favorites box at left) as your text editor, one of the cool tricks it performs is to maintain a history of your search and replace calls. If you command-click in the search or replace box, you'll get a drop-down menu showing the last 15 or so items you've searched or replaced. This little trick saves a bunch of typing if you're looking for the same thing somewhat regularly.
  Post a comment  •  Comments (0)  
  • Currently 1.60 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[3,065 views] Email Article To a Friend View Printable Version
Removing Samba from the system UNIX
I installed Samba a while back to play with it, but I've since moved my OS X box to a non-Windows environment. I want to uninstall Samba just for general "system purity," but I can't find any uninstall directions. Any clues?

[Editor's note - See the comments for the answer]
  Post a comment  •  Comments (3)  
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,161 views] Email Article To a Friend View Printable Version
Open GUI apps from the terminal System
You can open any of the standard GUI applications (such as Mail, Explorer, Address Book, etc.) from a terminal session. Although this may not have great benefits in day to day use (why not just click the dock icon?), it does imply that you could write a shell script to open a GUI app, and then use the UNIX cron program to schedule the 'open' to happen on a shedule. If the GUI app you open then had some command it executed at startup, this might prove to be a worthwhile trick.

In any event, to open a command in the terminal, just type
open /path/to/application/bundle
For example, to launch the Calculator or the game, type one of the following:
open /Applications/Calculator.app/
open /Applications/GrabBag/chess.app
As I said, I'm not completely certain about why or how useful this is, but it is somewhat interesting. It even opens the application in the background, so you don't switch out of your terminal window.
  Post a comment  •  Comments (3)  
  • Currently 2.33 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[7,113 views] Email Article To a Friend View Printable Version
Printing from a terminal session (lpr) UNIX
A while ago someone asked about how to configure osx for printing from the command line.

If you have a postscript printer in your network, this is actually pretty simple. Create a printcap file (named "myprintcap" for example) with jEdit, or vi or emacs or any other text editor:
lp:\
:lp=:rm=<printer ip or name>:rp=lp:\
:sd=/var/spool/lpd/lp:ty=PostScript:
Save this file somehere in your directory. Note: there should be backslashes terminating the first two lines. They were consumed by the scripts processing this hint, I guess. [Editor's note: Backslashes get stripped out, unless you enter in HTML mode, and use the character code '&#092;' for a backslash ... I've added them to the above lines.

Next you load this printcap into netinfo (line 1 below) and create the spool directory (line 2). Open a terminal and connect as root ("su"), then type:
niload printcap / < path/to/myprintcap
mkdir /var/spool/lpd/lp
Now you can print ps files from the command line by typing:
lpr file.ps
I should note that this hint is originally from the TeXshop readme.

Have fun,
Sven
  Post a comment  •  Comments (2)  
  • Currently 2.20 / 5
  You rated: 1 / 5 (5 votes cast)
 
[21,466 views] Email Article To a Friend View Printable Version
Classic won't launch? Classic
Classic no longer starts stating "no superuser priveleges for trublue environment."
Anyone know how to fix? Already ran X disc and reinstalled.

[Editor's note: Problem solved; see comments!]

Jim
  Post a comment  •  Comments (6)  
  • Currently 4.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,821 views] Email Article To a Friend View Printable Version
Finder preview pane functionality System
When in column view in OS X, the final column is designed to present a 'preview' of whatever file is highlighted in the previous column - text, image file, whatever. I've found that its behavior in the PB is somewhat unpredictable - sometimes you see a preview of an image file, sometimes you don't; text files seem to work regularly. Tonight, though, I noticed for the first time that Quicktime previews work really well. If you highlight a Quicktime movie in column view, you get a mini Quicktime player in the next column with audio and video controls. Easy movie browsing without launching anything!

When this feature is ironed out in the final release, it could be one of the nicer usability touches in the OS.
  Post a comment  •  Comments (1)  
  • Currently 1.20 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (5 votes cast)
 
[7,469 views] Email Article To a Friend View Printable Version
Mac OS X pre-orders available! System
I just stopped by The Computer Store, and had the sales rep look up Mac OS X in the Apple system. As of today, Apple has entered the part number in their systems, meaning that resellers can now take orders. So I reserved the very first copy at the Beaverton store.

I asked if they were going to do "Midnight Madness" for OS X. The rep told me he's not sure yet when they'll be opening on the 24th. He told me they opened at midnight for the OS 8 launch, and that was fine with Apple. But he also said they got in "a lot of trouble" with Apple over the iMac launch. I asked if they opened at midnight that evening as well. He said, grinning, "Well, it was midnight on the east coast!"

On a side note, they had one of the new G4 Titanium machines. This was my first chance to see one up close and personal. Incredibly thin, amazing screen, solid keyboard, and reasonably light. And the white apple on the cover glows with the light from the screen on the other side when the machine is on - a very impressive effect. Tempting, even though I have absolutely no need for one.

[UDPATE 2/2: As reported on the net, Apple has rolled out a PB rebate program; here's the text of the email that I just received:
  • "Thank you for being one of the pioneers who beta tested Mac OS X. Your feedback has helped make Mac OS X the world's most advanced operating system. To show our appreciation, we are offering you a $30 discount on the final version of Mac OS X.* You will also be among the first to receive Mac OS X when it ships on March 24, 2001. Again, thanks for helping to make Mac OS X the world's most advanced operating system."
I'm called (the online store system didn't work as described in the email) and ordered my $99 copy today, and will purchase a $129 version for work on Saturday the 24th - I'll keep the local dealer happy, and get a usable copy as quickly as possible!]
  Post a comment  •  Comments (0)  
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (3 votes cast)
 
[2,263 views] Email Article To a Friend View Printable Version