Create Growl alerts for Address Book contacts' birthdays
I have a lot of people in my Mac OS X Address Book. I thought it would be a nice idea to have the system check the birthdays in Address Book, and inform me of any forthcoming birthdays via a Growl notification. So I've created an Apple Script to do that (with a lot of help from a few other peoples). First, install Growl if it isn't installed. Also install the Terminal growlnotify command, which you'll find in the Extras folder on the Growl disk image. Next, copy and paste the following into AppleScript Editor: delay 0.5 set isRunning to 0 set timer to the time of the (current date) repeat while isRunning = 0 tell application "System Events" set isRunning to ¬ ((application processes whose (name is equal to "GrowlHelperApp")) count) ...
published on Thursday, the 11. March 2010, macosxhints
Back up OS X to a Windows machine on the network
I know there are plenty of back up/synchronization packages for the Mac, and I know Time Machine is awesome. But as I have a Linux/FreeBSD background, I wanted to do it my way. And none of the software I tried was able to do it my way :-). So the command line seemed to be a good solution. My office Windows machine has plenty of disk space on it, and it is rarely used. It was an ideal system (with not so ideal a file system) to do backups on. The solution I came up with requires: A shared folder on the PC, mounted on the Mac. The Unix app rdiff-backup, available via MacPorts. Notifications are sent using growlnotify, part of the Growl notification system. The final step was to write a custom shell script to back up my Mac to the mounted Windows shared folder; here's what that looks like: ...
published on Friday, the 20. November 2009, macosxhints
Send Growl notifications to Macs from Linux boxes
There is a way of sending messages to Growl running on a Mac OS X machine from any Unix machine with the standard X11 tools. You do not need to install anything on the Unix machine, just use the xkbbell command.In short, you need to first install growlnotify on the Mac. You then need a configuration file, xkbevd.cf, with the following content:Bell() shell "/usr/local/bin/growlnotify --message \"$(name)\" --appIcon X11; true "Start the X11 server, then start the xkbevd daemon (again on the Mac) pointing to the configuration file you just created (xkbevd -cfg xkbevd.cf -bg). You can then call the command xkbbell on the Unix machine to generate a Growl notification on the Mac. For example, xkbbell "lasers offline". There are detailed in...
published on Thursday, the 13. August 2009, macosxhints
Toggle a proxy server on and off via scripts
I've recently configured my Mac to tunnel web traffic through my university to take advantage of some free services accessible only from their IPs. I accomplish this using a dynamic port tunnel over SSH with the great SSHKeychain tool (which handles SSH key management as well as tunneling). Enabling the tunnel is just a click in a menu bar drop-down. Enabling/disabling the global proxy settings is not quite as easy, however. You have to manage everything through a secondary tab in the Network preference pane. So I wrote ToggleProxy (874KB download) to speed up the process. It will toggle the SOCKS proxy on and off automatically (make sure the server and port are already set in the Network preference pane), and display the status with a Growl notification if you have the growlnotify tool installed,...
published on Wednesday, the 5. March 2008, macosxhints
Use Growl to monitor long-running shell commands
While waiting for long-running shell commands to finish, I often switch to Mail or Safari. Here's how I made Bash notify me via Growl whenever one of those commands finishes. It's a combination of a clever bash script by glyf and Growl's growlnotify shell script. Install Growl, including the growlnotify shell script (found in the Extras directory). Next, download preexec.bash.txt [hints mirror] and save it under ~/.preexec.bash, as an invisible file in your home directory (in case you choose a different filename or location, make sure to adjust it in the following script).Then add the following code to your ~/.bashrc:
published on Thursday, the 11. October 2007, macosxhints
Notify yourself periodically using Growl
You can use Growl to create your own notifications, assuming you've installed the included growlnotify extra (installation instructions). Here is an example of how to notify yourself every 10 minutes about something useful like "dont forget to drink something." Open Terminal and if your shell is the bash shell, then run the following command at the prompt: for ((i=0; i<1000; i++)); do sleep 600s && growlnotify \ -s -m "dont forget to drink"; done This will remind you every 10 minutes to go get a drink. [robg adds: To kill the command, just hit Control-C. You can change the delay, the message, the loop length, etc.]
published on Friday, the 28. September 2007, macosxhints