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
# 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
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
# 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
# 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
# Requirement | |
# - https://gist.github.com/mims92/83b911783c2a23377c3f7dc9d1fe38b9 | |
#-------- | |
# Installation | |
# - Create the exectuable file under your PATH | |
#-------- | |
# Files are being mounted in /app inside the container | |
#!/bin/bash |
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/bash | |
#Usage: aws-ec2 <profile name> | |
aws ec2 describe-instances --profile $1 \ | |
| jq -r '.[][].Instances[] | [ .InstanceId, (.Tags[]|select(.Key=="Name")|.Value), (.NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress)]' |
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/bash | |
#chmod +x /usr/bin/awsaccounts | |
#Usage: awsaccounts | |
aws organizations list-accounts --profile <profile name> | jq -r -e '["ID","", "NAME"], (.Accounts[] | [.Id, .Name] ) | @tsv' |
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/bash | |
#chmod +x /usr/bin/awsec2 | |
#Usage: awsec2 <profile-name> | |
aws ec2 describe-instances --profile $1 | jq -r '.[][].Instances[] | [ .InstanceId, (.Tags[]|select(.Key=="Name")|.Value), (.NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress)] | select (.!=null) | @tsv' | column -s$'\t' -t' |
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/bash | |
#chmod +x /usr/bin/awsssm | |
#Usage: awsssm <instance id> <profile name> | |
aws ssm start-session --target $1 --profile $2 |