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
# Requirements | |
# - Docker | |
#-------- | |
# Installation | |
# - docker build -t <your image name> . | |
#-------- | |
# "root" folder is app | |
FROM python:3.6-alpine | |
RUN pip3 install -U awscli |
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
# Update a DNS record with the public IP | |
# Use a CRON | |
# chmod +x update_ip | |
# Run: source update_ip | |
#!/bin/bash | |
current_ip=$CURRENT_IP | |
new_ip=$(curl -s https://api.ipify.org) | |
new_ip_validation=$(curl -s https://checkip.amazonaws.com) |
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
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT | |
iptables -L |
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
# fan [on|off] | |
#!/bin/bash | |
if [ "${1}" == "on" ]; then | |
echo "0" > /sys/devices/odroid_fan.14/fan_mode | |
elif [ "${1}" == "off" ]; then | |
echo "1" > /sys/devices/odroid_fan.14/fan_mode | |
fi |
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
# $ led [on|off] | |
#!/bin/bash | |
led_path=/sys/class/leds/blue\:heartbeart/trigger | |
if [ "$1" == "off" ] | |
then | |
echo none > ${led_path} | |
fi |
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
#################################################################################################################### | |
# From https://stackoverflow.com/questions/134906/how-do-i-list-all-cron-jobs-for-all-users#comment81662841_44714620 | |
# Tested on Debian 8 | |
#################################################################################################################### | |
#!/bin/bash | |
cat /etc/passwd | sed 's/^\([^:]*\):.*$/echo "\ncrontab for \1:"; crontab -u \1 -l 2>\&1/' | grep -v "no crontab for" | sh |
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
################################################################################## | |
# https://www.howtogeek.com/howto/30184/10-ways-to-generate-a-random-password-from-the-command-line/ | |
################################################################################## | |
< /dev/urandom tr -dc "_A-Z-a-z-0-9&\/{}()@#^.?+=" | head -c16; |
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
################################################################################## | |
# https://www.howtogeek.com/howto/30184/10-ways-to-generate-a-random-password-from-the-command-line/ | |
################################################################################## | |
</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c16; echo "" |
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
################################################################################## | |
# https://www.howtogeek.com/howto/30184/10-ways-to-generate-a-random-password-from-the-command-line/ | |
################################################################################## | |
</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c16; echo "" |
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
################################################################################## | |
# https://www.howtogeek.com/howto/30184/10-ways-to-generate-a-random-password-from-the-command-line/ | |
################################################################################## | |
</dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c16; echo "" |