Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Screensaver as desktop background

# cf. http://digg.com/apple/Top_15_Terminal_Commands_for_Hidden_Mac_OS_X_Settings

function sadb() {
# cf. /usr/bin/locate '*ScreenSaverEngine'
/usr/bin/screen -d -m /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background 
return 0
}

function sadb_stop() {
#/usr/bin/killall -d ScreenSaverEngine
#/usr/bin/killall -v ScreenSaverEngine
/usr/bin/killall -HUP ScreenSaverEngine
return 0
}

sadb
sleep 30
sadb_stop

Disconnect Windows 2000 RDP session from command line

I use SSH to gain access to my Windows 2000 command line, so that will be reflected in the below steps.


Step #1: Connect to the server if you are not sitting at it
ssh username@win2000server -i privatekey

Step #2: Find out which sessions are currently active
query session

 SESSIONNAME       USERNAME                 ID  STATE   TYPE        DEVICE
>console                                     0  Conn    wdcon
 rdp-tcp                                 65536  Listen  rdpwd
 rdp-tcp#7         fakeuser                  1  Active  rdpwd

Step #3: We want to kill the connection with an ID of 1 (we can tell by the username and that it is active)
tsdiscon 1 /v

Disconnecting sessionID 1 from sessionname RDP-Tcp#7

That's it :) Easy eh?