Showing posts with label mac os x. Show all posts
Showing posts with label mac os x. Show all posts

Friday, March 9, 2007

How to Capture laptop screenshots to remote devices

What you need:
  • iSightCapture
  • A custom-made Automator workflow
  • A Blackberry with data services (I have a T-Mobile Pearl)
  • A free program called midpSSH installed on your Blackberry
I won't cover these things in this hint: Installing midpSSH on your Blackberry, setting up a static address to connect to (search Google for no-IP for mac), beginner information on using Terminal and Automator. Read on for the solution...

First, download iSightCapture and put it in /usr/bin. Then start a new Automator workflow, and make it look like this:
  1. Automator: Run Shell Script -- (240x260 is my Pearl's screen resolution). The script: isightcapture -h 240 -w 260 /Users/you/Documents/shots/snappit.jpg
  2. Finder: Get Specified Finder Items [ignore results from previous action] -- add /Users/you/Documents/shots/snappit.jpg
  3. Mail: New Mail Message -- enter your Blackberry's email address in the To: field, give it a subject and a message if you so desire, and select your account (note you must have already set up some email address using the program Mail)
  4. Mail: Send Outgoing Messages
  5. Automator: Run AppleScript [ignore results from previous action] -- This script hides Mail:
    tell application "System Events"
    tell application "Mail" to activate
    tell process "Mail"
    keystroke "h" using command down
    end tell
    end tell
  6. Automator: Run Shell Script [ignore results from previous action]:
    cp /Users/you/Documents/shots/snappit.jpg
    /Users/YOURUSERNAME/Documents/shots/snappit`date +%y%m%d%H%M%S`.jpg
Save the workflow and place it somewhere (remember where you save it). The command to execute an Automator script in the shell is: automator /path/to/automator.workflow/, and it takes no attributes. Test your workflow using Terminal. Set up your laptop with no-ip or some other dynamic DNS helper (dyndns.org). Connect to your computer via midpSSH on your phone, login, and execute the workflow. Obviously, you'll want to enable remote login via ssh in the Sharing tab of System Preferences first.

I also then put in an Automator pause for 20 seconds, and then the shell script killall Mail, b

How to Boot another OS while OS X is hibernating?

The Easy Way (PowerPC and Intel)
  1. Power on your Mac and press Alt/Option
  2. Choose the system to boot
  3. If you choose Linux, when you'll shut it down and the turn your Mac on again, your computer will wake from deep sleep (just like nothing really happened).
The Geek Way (PowerPC only)
  1. Write down the number of the Mac OS X and bootloader (like Yaboot) partitions. In my case, I have Yaboot on /dev/hda2 and Mac OS X on /dev/hda12.
  2. Put your mac to Safe Sleep.
  3. Power on you computer and immediately press Command-Option-O-F. Note that if you have security mode set to "full," this step is not needed, as it will happen automatically.
  4. You will se a command prompt; just to be sure type printenv. If needed, insert your password. Now jot down the value of boot-device. In my case (Mac OS X is on the twelfth partition of my disk), it is /pci@f4000000/ata-6@d/disk@0:12,\:tbxi. Be careful! The value is not /pci@f4000000/ata-6@d/disk@0:12,\:tbxi \:tbxi; the line just says what the actual value is, plus the default value (\:tbxi).
  5. You now have to change boot-device to the value of the bootloader partition (or directly to the number of the Linux partition you only have two OSes). In my case:
    setenv boot-device /pci@f4000000/ata-6@d/disk@0:12,\:tbxi
    Be careful -- there's only one backslash.
  6. Type mac-boot and press Return.
That's it; you're done. When you're finishing using Linux, reboot and your Mac will wake from deep sleep just like nothing happened.

You may be wondering: why should I take the geek way? There are two reasons:
  1. You may want to show that even on a Mac you can do complicated things :)
  2. You have security mode set to "full," and the easy way doesn't work.
Please also notice that, with the geek way, you actually get feedback that your Mac is waking from Deep Sleep while, with the easy way, you won't. In the latter case, just be patient: your Mac has not frozen. Have fun and break every uptime record! By the way, I won the uptime race. Next round will be Leopard vs Vista.

[robg adds: Note that I tried this with my MacBook Pro and Windows XP in Boot Camp, and it did not work. When I first tried it, OS X was set to use Windows XP as the startup disk. When I pressed the power key from Deep Sleep mode (with or without the Option key held down), Windows would boot, seemingly leaving me stuck in Windows (since the Option key was being ignored). To get out of this loop, I set the startup disk (using the Apple-supplied Control Panel in Windows XP) to OS X and rebooted. When I did, OS X booted from a cold start, ignoring my deep sleep state.

Then I switched the startup disk in OS X to my OS X partition, and tried again. This time, when waking from deep sleep, the Mac simply woke from deep sleep, again ignoring the Option key. I tried various combinations, including restarting instead of shutting down in Windows XP, but all to no avail. So it seems, at least on my sample size of one unit, that this trick won't work on a MacBook Pro.]
Your Ad Here