Skip to content

Instantly share code, notes, and snippets.

View SkaTeMasTer's full-sized avatar

$hawn Reimerdes SkaTeMasTer

View GitHub Profile
@SkaTeMasTer
SkaTeMasTer / pywallet-dump.sh
Created October 23, 2016 20:34
Getting keys from old Bitcoin-qt forks.
#!/bin/bash
echo "Enter directory with all the wallet *.dat files live:"
read walletdir
echo "Enter passphrases for all the encrypted wallets in directory:"
read passphrase
for i in $walletdir/*.dat; do
pywallet.py --dumpwallet --datadir=$walletdir --wallet=$i --passphrase=$passphrase
done
@SkaTeMasTer
SkaTeMasTer / ntp.conf
Created October 12, 2016 18:10
Raspberry Pi -- ntp server config. FROM: https://frillip.com/raspberry-pi-stratum-1-ntp-server/
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
# Local
server 127.127.1.0
fudge 127.127.1.0 stratum 10
# GPS with PPS enabled
server 127.127.20.0 mode 17 minpoll 4 maxpoll 4 iburst true prefer
# GPS time
@SkaTeMasTer
SkaTeMasTer / named.conf.options
Last active October 10, 2016 07:06
[Raspberry Pi] - DNS SERVER - list of open DNS servers (/etc/bind/named.conf.options)
options {
directory "/var/cache/bind";
forwarders {
208.67.222.222; # OpenDNS (1/2)
151.202.0.85; # Verizon
198.6.1.3; # uu.net
# ======================================
141.155.0.68; # Verizon (NY, USA)
@SkaTeMasTer
SkaTeMasTer / basic-bind.sh
Created October 5, 2016 20:14
DNS Server -- Simple script to generate a basic bind configuration for home/lab use
#!/bin/bash
#
# Simple script to generate a basic bind configuration for home/lab use
#
# Local config - adjust as required
OWNIP=192.168.111.3
NETWORK=192.168.111.0
NETMASK=/24
DNS1=192.168.111.1
@SkaTeMasTer
SkaTeMasTer / awscli route53
Created October 1, 2016 05:40
change route53 entry for domain
#!/bin/bash
local CONF="$LE_WORKING_DIR/dnsapi/dns-route53-python.conf"
[ -r "$CONF" ] && . $CONF
if [ -z "$AWS" ]; then
AWS=`which aws 2>/dev/null`
fi
#Usage: add _acme-challenge.www.domain.com "XKrx...."
@SkaTeMasTer
SkaTeMasTer / awscli IAM role injector
Created October 1, 2016 04:14
force sts command to use json output format. others formats will cause
roleArn="arn:aws:iam::"
roleArn+="$destinationAccountNumber"
roleArn+=":role/"
roleArn+="$rolename"
serialArn="arn:aws:iam::"
serialArn+="$sourceAccountNumber"
serialArn+=":mfa/"
serialArn+="$username"
@SkaTeMasTer
SkaTeMasTer / awscli create IAM user
Created October 1, 2016 04:08
Create a user user IAM
# 1. Creates an IAM user account in AWS
# 2. Randomly generates a password for the account using apg
# 3. Adds the user to the Administrators group
# 4. Creates a login profile for the user (set password and set flag to force user to reset password upon initial logon)
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 <username>"
exit 1
@SkaTeMasTer
SkaTeMasTer / awscli
Created October 1, 2016 03:30
List security groups for ec2 instances
# list security groups for ec2 instances
aws ec2 describe-security-groups --query "SecurityGroups[].GroupId | [0]" --output text
output:
si-22642348 sg-11662348
@SkaTeMasTer
SkaTeMasTer / awscli
Created October 1, 2016 03:30
List security groups for ec2 instances
# list security groups for ec2 instances
aws ec2 describe-security-groups --query "SecurityGroups[].GroupId | [0]" --output text
output:
si-22642348 sg-11662348
@SkaTeMasTer
SkaTeMasTer / disk usage recursive
Created October 1, 2016 03:27
Commands to see where you space is being used.
# disk usage recursive
sudo du / -h --si --max-depth=3 | grep '[0-9]G\>'