Skip to content

Instantly share code, notes, and snippets.

View matthewcosgrove's full-sized avatar

Matthew Cosgrove matthewcosgrove

View GitHub Profile
@matthewcosgrove
matthewcosgrove / cloudflare-update-record.sh
Created December 26, 2018 20:40 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="[email protected]"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@matthewcosgrove
matthewcosgrove / gist:3ce949f0f95c7da47b718ca4ae416ada
Created December 29, 2018 12:41 — forked from gin1314/gist:3697341
bash: redirection cheat sheet
.---------------------------------------------------------------------------.
| |
| Bash Redirections Cheat Sheet |
| |
+---------------------------------------------------------------------------+
| |
| Created by Peteris Krumins ([email protected]) |
| www.catonmat.net -- good coders code, great coders reuse |
| |
+-----------------------------.---------------------------------------------+
@matthewcosgrove
matthewcosgrove / 00_bootstrap_authorized_keys_on_linux
Last active February 10, 2019 23:00
Bootstrapping Linux VMs - Set up authorized keys
TITLE FOR GIST ;-)
# 'EOF' vs EOF with escaping --> https://stackoverflow.com/a/25903579/752167 and https://unix.stackexchange.com/a/405254/308152
cat <<EOF >/etc/nginx/conf.d/subsonic-proxy.conf
server {
listen 80;
server_name $SUBSONIC_SERVER_DOMAIN;
location / {
proxy_pass http://127.0.0.1:4040;
proxy_set_header Host \$http_host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
#!/bin/bash
# login with an account in wheel group and clone this gist to run
# Tested on
# $[cosgrom@vps ~]$ cat /etc/redhat-release
# CentOS Linux release 7.6.1810 (Core)
# $ cat /etc/os-release
# NAME="CentOS Linux"
# VERSION="7 (Core)"
@matthewcosgrove
matthewcosgrove / !_bash_snippets.txt
Last active November 18, 2020 12:00
Bash snippets
Selection of bash snippets
k3os:
password: rancher
boot_cmd:
- sed -i -r 's/^(\s*PasswordAuthentication\s*)no(\s*)$/\1yes\2/i' /etc/ssh/sshd_config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCo6Z1dGE1cNKcsG2f8nqLWehWDBu2zo/3RBRKeMU60uJ1E4CokzKk5uH15Zjbsj/d97WlP0YQ20nFiWPhvDYK7gydAWQl/HuA+k3bG2+/YCnmx8IRuNrDAX3PR4iYyCo30BVjn4qHadO2JMQDSp7UeYs5JziOpQKqxTxuQAubbrMwnm7j+ckhIDSc0c9faKvhUiuyZny4gWtCTP/R3Z6k/1qW4MH2QE0oeVFQ2CUpkn/5ffyVDKo9S2rFamv5hwuktM5jVHW1L+mbB0kFOF1X5Iwq+KOihRcBNhNFubPXzhq/BEshBnDRqqMtjKFp0fcnEXlu8XAr7LTm8eKdU0P1L ubuntu@mgmt-tools
# an opinionated Tools VM set up based on using an OpsMan VM from pivnet
# Intended to be used with BUCC, specifically https://github.com/matthewcosgrove/lab-ops
# Intructions for pivnet
# set env var
export PIVNET_TOKEN="grab a token from the GUI" # Deprecated approach but works for now
# Install
wget https://github.com/pivotal-cf/pivnet-cli/releases/download/v1.0.4/pivnet-linux-amd64-1.0.4
sudo chmod +x pivnet-linux-amd64-1.0.4
https://docs.microsoft.com/en-us/windows/wsl/install-manual
https://github.com/FRC2539/pybot/wiki/Windows-WSL-Install
https://github.com/FRC2539/pybot/wiki/WSL-Offline-Install
https://stackoverflow.com/questions/52512026/is-it-possible-install-ubuntu-in-windows-10-wsl-without-microsoft-store
https://docs.microsoft.com/en-us/windows/wsl/install-on-server
# Stuck with 14.04 as Windows 10 is old and useless