Skip to content

Instantly share code, notes, and snippets.

View castironclay's full-sized avatar

castironclay castironclay

View GitHub Profile
certbot certonly --register-unsafely-without-email --agree-tos --standalone -d full.dns.name
@castironclay
castironclay / cloud_config_hypriot
Created October 17, 2020 19:14
cloud config for hypriot raspberry pi
#cloud-config
# vim: syntax=yaml
#
# Set your hostname here, the manage_etc_hosts will update the hosts file entries as well
hostname: hostname
manage_etc_hosts: true
# You could modify this for your own user information
users:
@castironclay
castironclay / gist:5f58b75c8bac0f8efee1c8328604cd0a
Last active September 30, 2020 04:30
OpenSSL Encrypt / Decrypt
# Done on raspberry pi 4
## Linux pi4-master 5.4.51-v7l+ #1333 SMP Mon Aug 10 16:51:40 BST 2020 armv7l GNU/Linux
## OpenSSL 1.1.1d 10 Sep 2019
# Generate Keys
ssh-keygen -t rsa -b 4096 -C "[email protected]"
ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
ssh-keygen -f id_rsa.pub -e -m PKCS8 > id_rsa.pem.pub
# Create password string
@castironclay
castironclay / nginx_jail_centos8
Last active April 15, 2020 00:32
This will setup nginx on centos8 to run within a jail and includes the geoip2 module. Have your geoip database .mmdb file and nginx module zip file within the same directory as this script.
#!/bin/bash
# Update
yum update -y
yum install epel-release -y
yum update -y
# Create jail directories
D=/nginx
mkdir -p $D
mkdir -p $D/etc
@castironclay
castironclay / wg_connect.sh
Last active April 14, 2020 23:54
Connect to remote wireguard server and create tunnel
#!/bin/bash
echo Peer IP Address?
read PEERIP
echo Peer Username?
read PEERUSER
echo Peer Password?
read -s PEERPASS
@castironclay
castironclay / wireguard_arm_install.sh
Created November 9, 2019 18:56
Install Wireguard on Debian Buster
#!/bin/bash
echo "deb http://deb.debian.org/debian/ unstable main" | sudo tee --append /etc/apt/sources.list.d/unstable.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 150\n' | sudo tee --append /etc/apt/preferences.d/limit-unstable
sudo apt update
sudo apt install wireguard -y