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


Click here to return to the 'Restarting a remote Mac via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Restarting a remote Mac via AppleScript
Authored by: osxpounder on Aug 03, '03 04:17:17PM

Why not, since you're logging in remotely, simply start a VNC server and use the GUI to shut down any apps you see? If you're accessing it via a Windows client, you can get TightVNC, which offers a range of compression options to help you get optimal performance in any given VNC session.

Whatever you use, you can easily use VNC if you have a computer with a broadband connection to the Internet.

Here's a few tips for using VNC I've picked up, mainly from this site. I gather them here for your convenience:

- use a shell script to start the vnc server whenever you want, from a command prompt. That way, you can use the next tip:

- only run the VNC server for the time you need it. When you aren't logged in remotely to the server, kill the VNC server. Why leave a point of attack availalble for hackers if you're not using it?

- When you're done with your VNC session and you want to stop the OSXVNC-server program, type "ps -ax|more" at the command prompt and hit ENTER. This will list the programs running on your OSX box at the moment. Look for the OSXVNC-server program.

Note its process id number, and type "kill [paste its process id number here]. Press ENTER, and the server is killed.

- Since you know you might be using VNC to access your machine, leave its Display preferences and similar settings in a state that works best with VNC and keeps the display lag to a minimum:

-- Turn off Dock hiding, and turn off magnification in the Dock preferences, too.

-- If you have two monitors, go to Display preferences and click the Arrange tab. Check the box to "Mirror Displays".

-- Get rid of the desktop picture; go with a plain color.

-- Clean up your desktop, if you have a really slow connection. Give the VNC system less graphical detail than necessary, and your screen updates will happen more quickly, reducing the lag in the interface.

-- You can even hide drivers and servers on your desktop. You can always see them by creating a new Finder window; no sense lagging the display if you don't need to see them.

-- Use keyboard shortcuts; that way you don't have to wait for the VNC system to update your screen, and you essentially sidestep most of the lag you'd experience if you used the mouse. For example, on an Windows TightVNC client, connected to an OSX box that's running a VNC server:

Alt-N creates a new window in the finder Alt-Shift-N creates a new folder in the finder Alt-W closes a window in any app Alt-Q quits a program

You get the picture. My client maps the Alt key in Windows to the Apple key on the OSX machine. Using the keys means you don't have to deal with the display's lag issue at all.

- the most beautiful tip of all: if you forget to do any of these things, you can do them remotely via the VNC server; you'll just be dealing with a laggy display [and hence, interface response will be slower] long enough to make a few quick changes, such as mirroring displays, and then you're done. In other words, if you forget to leave your OSX display and dock preferences set nicely for VNC, you can make those changes after you log in with VNC. Not a problem.

---
--
osxpounder

[ Reply to This | # ]

Restarting a remote Mac via AppleScript
Authored by: derekhed on Nov 10, '04 01:56:51PM

Nice list, osxpounder.

Allow me to add one more thing that I have found useful. I allow only ports 80 and 22 through my router, and have VNCServer running at startup (boooot). (That's not a typo, my computer just takes a long time to start up :-).

Bad jokes aside, if I tunnel my VNC connection over SSH, I can also use the compression flag -C and get about 3X the speed of my broadband connection. Very nice. And of course, all the normal security advantages are there. This has made the entire procedure useful, where before it was just possible.

ssh -2 user_name@home_IP_number -L 5901:127.0.0.1:5901 -C



[ Reply to This | # ]