Created
May 24, 2016 14:38
-
-
Save anonymous/5bf92b9d14b8c529919c6027502fbd09 to your computer and use it in GitHub Desktop.
A hands-on workaround to avoid your laptop getting stolen in a security scanning. See http://www.echeng.com/journal/2016/5/23/tsa-gave-my-macbook-pro-to-another-passenger-at-lax-and-now-its-gone
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GNU nano 2.0.6 File: tsa Modified | |
#!/bin/bash | |
# Run this script just before you put the laptop in the bin for security scanning. | |
# You can add the seconds the laptop will be waiting before speaking. The default | |
# is waiting for 180 seconds (3 minutes). | |
# Switch to the login screen, effectively locking the screen. | |
function lockscreen() { | |
/System/Library/CoreServices/"Menu Extras"/User.menu/Contents/Resources/CGSession -suspend | |
} | |
function voice() { | |
echo "Locking screen now..." | |
sleep 1; lockscreen | |
sleep $1; echo "Hit Ctrl-C to interrupt the voices." | |
osascript -e "set Volume 10" | |
while :; do | |
# You could be creative here! | |
sleep 5; say -v Bell -r 50 dong dong | |
sleep 1; say -v Victoria -r 100 "I don't belong to you" | |
done | |
} | |
function volume_off() { | |
osascript -e "set Volume 0" | |
echo; echo "Turned volume off." | |
exit | |
} | |
trap volume_off INT | |
wait=$1 | |
if [[ $# -lt 1 ]]; then wait=180; fi | |
echo "Caffeinated. Waiting $wait seconds then starting voice..." | |
caffeinate -i & voice $wait | |
# caffeinate doesn't always work. InsomniaX seems to interfere. | |
# In such a case you have to disable sleep manually. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment