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

Remote Control Your DHCP Connected Laptop from Your iPad UNIX
I work in a growing school district with multiple campuses. Each week I find myself in different buildings for one reason or another. Like many people, I've realized it's much handier to grab my iPad and go, rather than lug the laptop. However, there are times when it's necessary to access information or applications on my laptop when I'm out and about.

The solution that I'm using to remote back to my laptop involves enabling VNC access on my laptop (System Preferences » Sharing » Remote Management » Computer Settings) and using a VNC viewer on the iPad (my choice, after trying many, is Remoter). There are two issues with doing this: (1) is that the IP address of my laptop changes from time to time and (2) when I'm out of the office, my iPad is not on the same LAN as my laptop, so Bonjour browsing doesn't do any good.

The script below, IP-Change-Notification.sh, takes care of those two issues by sending me an email every time my ethernet or wireless IP address changes. I then have the ability to look up my laptop IP address at any time by just checking my email on the iPad. Once I have the IP address, then I can open Remoter, paste in the IP, and connect. To get all this working, I simply put the script in an accessible folder (personally, I use ~/scripts). Then, I set up a cron task to run the script however often I want to check for a new IP.
read more (290 words)   Post a comment  •  Comments (26)  
  • Currently 3.86 / 5
  You rated: 3 / 5 (7 votes cast)
 
[7,259 views]  View Printable Version
DMG backup, archive, and transfer to remote machine script UNIX
The following hint creates a .DMG of a given directory/folder, then uses SCP to move it from your machine to another machine. It also appends a date onto the .DMG name, and lastly sends you an email that it was transferred successfully (or not).

The script has a few assumptions:
  • The source machine can send you email from the command line, if Postfix is working correctly.
  • The source machine has a password-less SCP connection to the destination machine. If not, see this hint for help setting that up.
Once you've moved the script to a location on your machine, you'll need to make it executable by typing the following in Terminal:

sudo chmod +x dmgbackup-script.sh

Of course, the script can then be called via a cron job or other scheduler if desired.
read more (224 words)   Post a comment  •  Comments (2)  
  • Currently 2.60 / 5
  You rated: 1 / 5 (5 votes cast)
 
[6,338 views]  View Printable Version
Backup the iPhoto Library to DVD's with tar UNIX
A recent Macworld article on backups stated:

'Regrettably, iPhoto no longer offers an option to back up your iPhoto library to optical media. Rather, you can burn only images to the disc rather than the library itself and you can't burn to multiple discs if the selected number of photos won't fit on a single CD or DVD.'

There is a command-line based workaround for that deficiency. You can split the iPhoto Library into DVD sized tar archives and then copy the archives to DVD's.

To create the archives, type the following command into a Terminal shell:
/usr/bin/gnutar -C $HOME/Pictures -L4588544 -cMv --file=$HOME/Desktop/tar_archive.{tar,tar-{2..50}} iPhoto Library
And then to extract them:
/usr/bin/gnutar -xMv --file=$HOME/Desktop/tar_archive.{tar,tar-{2..50}} -C $HOME/Desktop

[crarko adds: I haven't tested this one.]
  Post a comment  •  Comments (6)  
  • Currently 3.80 / 5
  You rated: 3 / 5 (5 votes cast)
 
[9,041 views]  View Printable Version
X11 Forwarding with PuTTY UNIX
PuTTY is an open-source, multi-platform SSH, Telnet, Rlogin and serial interface terminal emulation application with a host of configuration items. PuTTY can be operated from a GUI or the command-line. It is currently available for the Mac using the MacPorts environment. X11 forwarding, a tunneling function under SSH, is confused by the Leopard and later X11 DISPLAY string. This can simply be worked around by setting the 'SSH' menu » X display location item, to :0.
read more (298 words)   Post a comment  •  Comments (4)  
  • Currently 2.00 / 5
  You rated: 4 / 5 (7 votes cast)
 
[13,307 views]  View Printable Version
Resolve a Java dependency error in Fink UNIX
You may receive a build error when compiling some packages in Fink of the form:

Can't resolve dependency "system-java-dev (>= 1.5-1)" for package...

This is due to the recent Apple Java update [crarko adds: discussed in this previous hint] and how the developer interfaces for Java are now distributed.

From the Fink homepage: 'Users will also need to download an appropriate version of the Java Developer Package from The Apple Developer Connection site for all of the the system-java-dev packages to show up on 10.5 and 10.6.'

[crarko adds: The link to ADC above does require a free membership in the Apple Developer Program to access the Java developer packages.]
  Post a comment  •  Comments (3)  
  • Currently 3.50 / 5
  You rated: 2 / 5 (4 votes cast)
 
[6,329 views]  View Printable Version
Persistent Growl notifications for long tasks UNIX
I have a tendency to forget that I'm in the middle of a backup -- I use an rsync script that runs in the background -- so I needed a way to keep a reminder on screen for the duration of the task so I don't accidentally disconnect the external backup drive.

This turned out to be easy using Growl and the growlnotify utility. By creating the note as sticky (using the -s option) and giving it an identifier (using the -d option), the notification will stay on screen and can be updated periodically as desired.
read more (149 words)   Post a comment  •  Comments (5)  
  • Currently 2.88 / 5
  You rated: 3 / 5 (8 votes cast)
 
[5,533 views]  View Printable Version
Using VNC from the Terminal UNIX
OSX has a nifty program called Screen Sharing. It lets you remotely access other computers, whether they be UNIX, Mac, Linux, Windows, or any other type of box. All the other box needs is a VNC server, which Macs have built in since 10.4.

However, using this app directly is often a pain. You have to open it up, create a new session, type in the URL/IP, and then possibly authenticate. If you, like me, are accustomed to using Terminal for most of your tasks, there is an easier and quicker way: use the "open" command, which is built in to OSX.

From a standard shell, run open as in one of these examples:

open vnc://www.example.com
open vnc://111.111.111.111
open vnc://mylocalserver.local

If you often VNC into the same computer, you can create an alias in your shell's profile so you don't have to type the command every time. Combine this with QuickSilver, and you can open a VNC connection to the server of your choice in as little as 5 key-strokes!

[crarko adds: I tested this, and it works as described. This is an elaboration of an earlier hint.]
  Post a comment  •  Comments (25)  
  • Currently 4.00 / 5
  You rated: 4 / 5 (5 votes cast)
 
[36,546 views]  View Printable Version
Compile mp3info and install from source UNIX
Sure you could install mp3info with MacPorts, but if you prefer to build it manually -- this hint is for you.
read more (153 words)   Post a comment  •  Comments (7)  
  • Currently 2.00 / 5
  You rated: 4 / 5 (26 votes cast)
 
[6,114 views]  View Printable Version
Python and UTF-8 text encoding on OSX UNIX
I'm using a MacBook Air with Snow Leopard (10.6.2) as my development platform. And I'm using Python 2.6.4 with Unicode strings.

I received the following error when trying to run a script: UnicodeEncodeError: 'ascii' codec can't encode character u'xe9', indicating that the text encoding was wrong. So it couldn't output a word like appliqué correctly.

I tried adding # -*- coding: utf-8 -*- at the head of my Python script, but I still get this complaint.

To fix this, I found that the text encoding used for standard input, output, and standard error can be specified by setting the PYTHONIOENCODING environment variable before running the interpreter.

The value should be a string in the form <encoding> or <encoding>:<errorhandler>. The encoding part specifies the encoding's name, e.g. utf-8 or latin-1; the optional errorhandler part specifies what to do with characters that can't be handled by the encoding, and should be one of 'error', 'ignore', or 'replace'.

So typing export PYTHONIOENCODING=utf-8 prior to invoking the Python interpreter does the trick, or you could just add this setting to your environment file: ~/.MacOSX/environment.plist.

[crarko adds: I haven't tested this one.]
  Post a comment  •  Comments (4)  
  • Currently 1.83 / 5
  You rated: 5 / 5 (23 votes cast)
 
[12,673 views]  View Printable Version
Batch removal of tags/keywords from pictures UNIX
I used exiftool for batch removal of keywords for a long time, but recently it stopped working. I could still overwrite keywords, but as soon as I deleted the keyword, the old ones were back. After examining the binary files directly, I found out that at least Aperture writes the keywords as XMP Subject, and that Preview falls back to XMP Subject if there is no IPTC Tags. That's why when I overwrote the keywords, it seemed to work: XMP Subject tags were still there, but were not displayed by Preview.
read more (61 words)   Post a comment  •  Comments (4)  
  • Currently 2.17 / 5
  You rated: 4 / 5 (23 votes cast)
 
[5,930 views]  View Printable Version