Enable and disable Screen Sharing in macOS

These commands are useful if Screen Sharing gets turned off on a remote machine but SSH is still accessible, or in the event that Screen Sharing becomes unresponsive.

OS X 10.6 through 10.9

Disable:

sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool true

Enable:

sudo defaults write /var/db/launchd.db/com.apple.launchd/overrides.plist com.apple.screensharing -dict Disabled -bool false

Launch:

sudo launchctl load /System/Library/LaunchDaemons/com.apple.screensharing.plist

OS X 10.10 through macOS 10.12

Disable:

sudo launchctl disable system/com.apple.screensharing

Enable:

sudo launchctl enable system/com.apple.screensharing

Launch:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist

Tools to check for OpenSSL Heartbleed bug

Tools to check for the bug:

List of vulnerable Linux distributions: http://www.circl.lu/pub/tr-21/

 

List top 10 largest MySQL databases in Linux

Run the following command as root to list the top 10 largest MySQL databases in Linux.

du -s /var/lib/mysql/* | sort -n| cut -f 2-|xargs -i du -sh {} |tail -10

You may need to change the directory to match your configuration. /var/lib/mysql is the default MySQL directory on a cPanel server.