Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mims92's full-sized avatar

Mims mims92

  • Liege
View GitHub Profile
@mims92
mims92 / Dockerfile
Last active March 25, 2020 16:51
Linux - Docker - python & aws cli
# Requirements
# - Docker
#--------
# Installation
# - docker build -t <your image name> .
#--------
# "root" folder is app
FROM python:3.6-alpine
RUN pip3 install -U awscli
@mims92
mims92 / update_ip
Created December 20, 2018 09:43
Linux - Bash - Update AWS Route53 DNS with public IP
# 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)
@mims92
mims92 / Linux - Bash - Purge iptables rules
Last active February 19, 2018 14:13
Linux-Empty_iptables.sh
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
@mims92
mims92 / Ordoid-TurnFanOnOff.sh
Created January 7, 2018 20:23
Odroid XU4 - Bash - Turn the fan on or off
# 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
@mims92
mims92 / Odroid-TurnLedOnOff.sh
Last active January 7, 2018 20:23
Odroid XU4 - Bash - Turns the blue LED off/on
# $ led [on|off]
#!/bin/bash
led_path=/sys/class/leds/blue\:heartbeart/trigger
if [ "$1" == "off" ]
then
echo none > ${led_path}
fi
@mims92
mims92 / Linux-ListCrontabForAllUsers.sh
Created December 6, 2017 15:20
Linux - Bash - List all crontab for all users
####################################################################################################################
# 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
@mims92
mims92 / Linux-RandomPasswordGenerator.sh
Last active December 1, 2017 07:58
Linux - Bash - Random Password Generator
##################################################################################
# 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;
@mims92
mims92 / Linux-RandomPasswordGenerator
Created November 28, 2017 10:14
Linux - Bash - Random Password Generator
##################################################################################
# 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 ""
@mims92
mims92 / Linux-RandomPasswordGenerator
Created November 28, 2017 10:14
Linux - Bash - Random Password Generator
##################################################################################
# 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 ""
@mims92
mims92 / Linux-RandomPasswordGenerator
Created November 28, 2017 10:14
Linux - Bash - Random Password Generator
##################################################################################
# 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 ""