While we don't advocate actual killing of penguins or your laptop, The Penguin Killer is a reaction to the dangers of utilizing laptops in public places where unforeseen circumstances could threaten your privacy and data. The Penguin Killer is a variation on the USB kill cord concept. It's a USB cord with a novelty carabiner attached that physically connects to your belt loop or pants pocket and in the event your laptop is snatched a magnetic component connected to the other end of the cable snaps triggering a near instantaneous shutdown.
Following the instructions below will create a udev rule to monitor for the removal of the device and immediately power the system down.
To setup The Penguin Killer open a terminal and copy and paste the following lines:
echo 'SUBSYSTEM=="usb", ACTION=="remove", ENV{PRODUCT}=="346d/5678/*", RUN+="/sbin/poweroff -f -f"' | sudo tee /etc/udev/rules.d/kill-power.rules
# Create the shutdown script
sudo tee /usr/local/bin/kill-power.sh > /dev/null << 'EOF'
#!/bin/sh
# Use 'at' to defer execution and escape udev context
echo "/sbin/poweroff -f -f" | at now
EOF
# Make it executable
sudo chmod +x /usr/local/bin/kill-power.sh
# Create the udev rule
echo 'SUBSYSTEM=="usb", ACTION=="remove", ENV{PRODUCT}=="346d/5678/*", RUN+="/usr/local/bin/kill-power.sh"' | sudo tee /etc/udev/rules.d/kill-power.rules
# Reload udev rules
sudo udevadm control --reload-rules
