•
Sometimes Murphy is just a little too lazy to go upstairs and reboot a Mac that needs rebooting. With an iPhone or iPod touch you don’t need to leave the sofa.
Today, Murphy was watching tv on the iPhone via EyeTV’s iPhone app. It started to lock up so a reboot seemed like a good idea. Murphy has Touch Term installed on the iPhone. And the Mac is set to accept SSH sessions. One tap to connect and one command to start the reboot was all it took. Here’s what you need:
- First, go to Sharing in your System Preferences. Turn on Remote Login. This allows your Mac to allow incoming SSH sessions.
- On your iPhone install Touch Term, or some other SSH client. Murphy remembers getting Touch Term for free, but now it starts at $3.99. You might want to comparison shop for similar products.
- Next, configure Touch Term to connect to your Mac, either by name or ip address.
- Once you’ve connected just type the command to reboot your Mac, and press Return. Here’s the command: sudo shutdown -r now
Murphy took the extra step of creating a shell script to run that command, so there’s less to type when it’s time to reboot. That’s all there is to it.
You might want a command to send your Mac to sleep instead of rebooting it. This command should accomplish that: osascript -e 'tell application "System Events" to sleep'
Of course, you can always try something completely different. A long time ago Murphy wrote some posts about using the Mail app on a Mac to trigger events. Murphy has Applescripts on the Mac that do different things when emails come in with certain characteristics. Scripts that adjust iTunes, retrieve files, or put the Mac to sleep. The whole thing was based on a post here.
Some of these scripts had issues with different updates to OS X and changes to Mail. Your results may vary…
I haven’t looked into other ways to reboot my Mac from the iPhone, so if you’ve got a good way let me know.
As always, be careful when using the Terminal.
|
Permalink
•

Murphy has built up a ton of duplicate files over the years. All kinds of stuff, some files with the same file name, some with different file names. Many of the files are half-baked backups thrown onto external drives in haste. Some are just the result of poor housekeeping.
I’ve used various tools to get the mess under control. Later we’ll be looking at a tool called CD Finder that despite its name can be very helpful in cataloging an unruly collection of disks and drives. We’ll be looking at the diff command too - which is already on your Mac. But first let’s take a look at Tidy Up, an extremely helpful tool for finding duplicate files and deleting them.
Tidy Up can look beyond the filename to determine if files are duplicates or not. In the screencast Murphy uses Tidy Up to look at file content and size. There are many other criteria sets the application can use to evaluate files.
Tidy Up can also dig into iPhoto and iTunes databases in search of duplicates. Mail mailboxes too. Information about deleted files is then synced back to the applications. We’ll look at these features in another screencast.
One feature Murphy really likes: The ability to keep a single copy from a duplicate grouping. Tidy Up groups identical files together in its search results. The application will display all but a single file from each group, allowing you to delete all the extras at once.
Tidy Up can also restore content you’ve deleted to its original location, as long as you haven’t emptied the trash.
You can use Tidy Up to scan multiple drives at once or just a folder that you suspect has duplicates. It’s probably best to experiment a little before deleting anything - to ensure you’re getting the results you expect.
Watch Now
|
Permalink
•

I’ve avoided the tar command for some time now, only to find there’s nothing to be afraid of. My Windows background always led to pkzip for compression and archiving. Knowing that zip shipped with OS X there wasn’t really a need to look any further.
But sometimes you’re sent things in the tar format. Or the even more mysterious tar.gz. If you have no experience with Linux or Unix the tar command and tar.gz files might leave you confused. Before OS X the only experience Murphy had with Linux was hacking a Directv TiVo so he could install a bigger drive.
Anyway - OS X makes tar and tar.gz files simple to work with. Double-click one in the Finder and its contents are extracted. But what if you want to create one? Or see what’s inside before you open it? We’ll do both of those things in the screencast, but here’s a quick overview of some tar basics.
tar -cvf irl08.tar Pictures/ireland_08
That command will create an archive called irl08.tar in the current directory. All the files inside the ireland_08 directory will be placed inside, without compression. The c creates the archive, the v displays progress as files are added, and the f specifies a file as the destination. (tar stands for tape archive)
tar -zcvf irl08.tar.gz Pictures/ireland_08
This command is almost exactly the same, but the z option compresses the archive so we’ve added the customary gz to the file name.
Here’s how to view the contents of a tar archive:
tar -tvf irl08.tar
The t option lists the files. If your archive is compressed add a z option too.
How does tar compare to zip? Murphy isn’t sure what all the differences are. He compressed a directory with dozens of screencasts in it using both utilities. The resulting archive was about the same size for each. The screencasts were already compressed themselves, so they might not be the best test subject.
A little research shows that extracting a single file from a very large archive might be quicker with zip than with tar. A zip file includes a table of contents that makes locating an included file more direct. And a zip file compresses the included files individually as they’re added. A tar.gz file creates the archive first and then compresses the whole thing at once. That can make single file extraction more time consuming as the entire large archive must be opened up.
There’s also gzip for compressing files. But gzip deletes your original file, replacing it with the compressed one. That makes Murphy a little nervous. tar leaves your original files in place, so you can delete them if you need to.
tar. One less thing to be afraid of.
You might find these posts interesting:
zip
command line encryption
Watch Now
|
Permalink
•

Using multiple devices with paid hotel Internet access.
This weekend I used the Internet at a hotel that charged for access. I signed up using my iPod, then later tried to access the service using a laptop. The sign-on page didn’t provide a place to sign in using my name or room number - it seemed like I might be charged again if I went any further. I had never seen the particular service before, so I couldn’t tell what would happen.
I didn’t feel like calling the front desk, and chances are I wouldn’t have had much faith in whatever they told me. Sounds cold, but it’s true. The solution I found was probably faster anyway.
I assumed the hotel tracked my iPod by its MAC address. If you’re not familiar with a MAC address, it’s a unique identifier assigned to network devices like your wired Ethernet port or a wifi card. (MAC addresses are not to be confused with Macs) Some software interfaces provide a simple way to change the MAC address your device presents to the network. I didn’t see a simple way in System Preferences.
A quick Google search landed me at OS X Daily. There you’ll find the exact command to enter in Terminal to change your MAC address. You may have to tweak the command a little if you’re using multiple network interfaces on your Mac, like wired and wireless.
So, I took the MAC address of my iPod and assigned it to the laptop. I didn’t try to use both at once, and both worked just fine. As soon as the MAC was changed on the laptop it was on the Internet, without having to access any special sign-up page for the service.
At some point hotels will probably update their services to help with a situation like this, but in the meantime OS X Daily helped me out in less than two minutes. Nice.
Read
|
Permalink
•
If you use Windows you might not be overly fond of the little bubbles that pop up down on your Task Bar. You know the ones — warnings about your firewall and unused items on your desktop?
A simple registry edit will stop the bubbles, for all applications. You can watch the screencast to see two ways to make the change. You can either make the edit manually using regedit, a registry editor that comes with Windows. Or you can download a file from Murphy and double-click it. The file will make the change.
You don’t have much to worry about. In fact, you can right-click the file (after unzipping it), select Edit, and you’ll see it’s just a couple lines of text. The change is easily undone. Simply delete the entry from your registry.
The balloons will stop appearing for all applications - only for the user you’re logged in as when you make the change. Log out and back in to test your results.
If you’re comfortable in the registry go ahead and make this entry:
Add a DWORD value in the following key, and name it EnableBalloonTips. Set its hex value to zero.
HKEY_CURRENT_USER\Software\Microsoft\Windows\
CurrentVersion\Explorer\Advanced
Not a registry person? Watch the screencast.
I don’t even know if they have bubbles in Vista…
Watch Now
|
Permalink