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 | |
SSO_START_URL= | |
SSO_ACCOUNT_ID= | |
SSO_ROLE_NAME= | |
cp ~/.aws/config ~/.aws/config.bak.`date +%F` | |
cat << EOF > ~/.aws/config | |
[profile root] |
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
#!/usr/bin/env python | |
# Initial script from: | |
# https://retropie.org.uk/forum/topic/13141/gpio-button-to-exit-emulator/3 | |
import RPi.GPIO as GPIO | |
import time | |
import subprocess | |
#https://github.com/crcerror/ES-generic-shutdown script location |
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
# Encrypt in base64 output STDIN and provide a password(prompt) | |
echo "message" | openssl enc -base64 -aes-256-cbc -a | |
# Decrypt STDIN and provide a password(prompt) | |
echo "encrypted" | openssl enc -aes-256-cbc -a -d |
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
function setup_aws_credentials() { | |
profile_name=$1 | |
role_arn=`/usr/bin/grep -A4 "$profile_name\]" ~/.aws/credentials|/usr/bin/grep role_arn|sed 's/^.*arn:/arn:/g'` | |
if [[ -z "$role_arn" ]] | |
then | |
role_arn=`/usr/bin/grep -A4 "$profile_name\]" ~/.aws/config|/usr/bin/grep role_arn|sed 's/^.*arn:/arn:/g'` | |
fi | |
local stscredentials |
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 | |
#HOW TO USE SCRIPT: | |
# curl https://gist.githubusercontent.com/ddepaoli3/495bb416217c97f9c1da1e5c7d84752a/raw/549b7aaad6529379297f62682f10887a725bde41/send_message_to_telegram.sh | bash /dev/stdin '<message>' '<chat_id>' '<chat_token>' | |
# | |
MESSAGE=$1 | |
CHAT_ID=$2 | |
TOKEN=$3 |
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
{ | |
"metrics": { | |
"namespace": "CWAgent", | |
"append_dimensions": { | |
"InstanceId": "${aws:InstanceId}", | |
"AutoScalingGroupName": "${aws:AutoScalingGroupName}" | |
}, | |
"aggregation_dimensions": [ | |
[ | |
"InstanceId" |
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 | |
# ./send_sms.sh +3934091929 "ciao ciao" "profile-name" | |
#Comand to set the default sender Name, i.e. the name you see in sms in the field 'from' | |
#aws --profile aws-profile sns set-sms-attributes --attributes DefaultSenderID=SenderName | |
NUMBER=$1 | |
MESSAGE=$2 | |
PROFILE=$3 |
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 | |
DEFAULT_GW_IP="192.168.1.1" #Local gateway | |
force_public_route() | |
{ | |
#netmask -c 0.0.0.0:9.255.255.255 | |
sudo route add -net 0.0.0.0/5 $DEFAULT_GW_IP | |
sudo route add -net 8.0.0.0/7 $DEFAULT_GW_IP |
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 | |
#Password: passed with argument or autogenerated | |
autogenpass=`date +%s | sha256sum | base64 | head -c 15 ; echo` | |
password=${1:-$autogenpass} | |
mkdir /root/.vnc | |
sudo apt-get update | |
sudo apt-get install --yes git ansible |
NewerOlder