Skip to content

Instantly share code, notes, and snippets.

View willpower232's full-sized avatar
🤓
Hey there! I am using GitHub.

Will Power willpower232

🤓
Hey there! I am using GitHub.
View GitHub Profile
@willpower232
willpower232 / gogocertbot.sh
Created January 22, 2018 10:35
Certbot with DNS verification and AWS route53 plugin
#!/bin/bash
# run these first to install certbot globally with the route53 plugin
# $ sudo apt install python-setuptools
# $ sudo easy_install pip
# $ sudo -H pip install certbot-dns-route53
# verify the route53 plugin is present
# $ certbot plugins
@willpower232
willpower232 / tailscaleToHostCtl.sh
Created August 6, 2022 11:06
add your tailscale IPs to your hosts file when you're scared of messing up your DNS
#!/bin/bash
tailscale status | while IFS= read -r aHost; do
hostname=$(echo "$aHost" | awk '{print $2}' | cut -d '-' -f 1)
ip=$(echo "$aHost" | awk '{print $1}')
hostctl add domains tailscale "$hostname.ts" --ip "$ip"
done
@willpower232
willpower232 / bash.bashrc
Last active November 14, 2022 13:54
I am making my .bashrc portable as inspired by this https://www.cyberciti.biz/tips/bash-aliases-mac-centos-linux-unix.html
#### Set prompt basics ####
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color) color_prompt=yes;;
@willpower232
willpower232 / passmenu.sh
Last active November 17, 2022 09:35
dmenu script for pass
#!/usr/bin/env bash
# 1 - source copy from https://geluk.io/p/passmenu.sh (https://github.com/Baggykiin/pass-winmenu)
# 2 - make dmenu case insensitive
# 3 - correct include_username variable
# 4 - only pick out usernames if they are the start of the sentence, i.e. ignore non-primary usernames listed in the file (mostly for bitbucket)
# 5 - dependency test and install
# 6 - error output on bad argument
shopt -s nullglob globstar
@willpower232
willpower232 / etc_nginx_sites-enabled_test
Last active May 20, 2023 15:23
Run Nginx on WSL (Ubuntu on Windows) with automatic domain names and environment for local development
server {
listen 80;
listen 443 ssl http2;
# make yourself an SSL certificate for *.test.test (and your dhparam file if you're so inclined)
ssl_certificate /etc/nginx/ssl/test.cert;
ssl_certificate_key /etc/nginx/ssl/test.key;
# your other favourite SSL settings go here