This file contains 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
#!/bin/sh | |
if [ "$UID" -ne 0 ]; then | |
echo "This script needs to be executed as root" | |
exit 1 | |
fi | |
vendor_id="0x3000" # Valve | |
product_id="0x28DE" | |
serial_number="$(dmidecode -s system-serial-number)" # The Steam Deck's serial number |
This file contains 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
# Forwarding your .ssh/sshrc file and sourcing it as .bashrc | |
# A function sudoi is defined on the remote machine, used | |
# instead of sudo -i, to run a shell as the specified user, | |
# or root as default, and source the local .ssh/sshrc. | |
function ssh() { | |
tmprc=$(/usr/bin/ssh "$@" "mktemp" 2>/dev/null) | |
rsync ~/.ssh/sshrc "$1:$tmprc" >/dev/null 2>&1 | |
echo "function sudoi() { sudo -u \"\${1:-root}\" bash --rcfile \"$tmprc\"; }" | /usr/bin/ssh "$@" "cat - >> \"$tmprc\"" >/dev/null 2>&1 | |
/usr/bin/ssh -t "$@" "chmod a+r \"$tmprc\"; bash --rcfile \"$tmprc\" ; rm \"$tmprc\"" |