Skip to content

Instantly share code, notes, and snippets.

View mnebuerquo's full-sized avatar
😎
Being awesome!

Sherman Adelson mnebuerquo

😎
Being awesome!
View GitHub Profile
@mnebuerquo
mnebuerquo / clear-iptables.sh
Last active April 26, 2018 16:48
Clear all rules from iptables without locking me out of the server
#!/bin/sh
# Clear out all iptables rules and make the changes persistent.
# first, find out if we're sudo
if [ $(id -u) -ne 0 ]; then
echo "Nope. Simon didn't say so.";
exit 1;
fi
@mnebuerquo
mnebuerquo / curl-or-wget.sh
Created August 18, 2022 13:04
curl-or-wget.sh
#!/bin/sh
# this one saves to a file
download_file(){
curl -f -o "${1}" "${2}" || wget -O "${1}" "${2}"
}
download_file /path/destination https://sourceurl