Skip to content

Instantly share code, notes, and snippets.

@mikesager
mikesager / wireguard_install.md
Created March 23, 2021 00:45 — forked from googya/wireguard_install.md
install wireguard on centos

on server

add private key

wg genkey  | tee my_private | wg pubkey > my_public # both for Client and Server
ip link add wg0 type wireguard
ip addr add 192.168.2.2/24 dev wg0
wg set wg0 private-key ./my_private # server's private key
ip link set wg0 up
@mikesager
mikesager / runcmd.md
Created July 20, 2020 04:00
SOLVED: cloud-init runcmd doesn't work

If you've added some runcmd lines to your cloud-init config, and the commands don't seem to be executing, here's a few things you should know:

WTF is going on?

  1. runcmd only has code to "shellify" your strings or array of strings (i.e: turns them into a shell script)
  2. runcmd will only write a shell script into the file /var/lib/cloud/instance/scripts/runcmd
  3. runcmd is part of the cloud_config_modules boot stage
  4. You need to execute that runcmd shell script using the scripts-user module
  5. scripts-user is part of the cloud_final_modules boot stage
@mikesager
mikesager / nfsn.api.sh
Created November 18, 2017 23:52 — forked from nmschulte/nfsn.api.sh
NearlyFreeSpeech.NET API request "library", in pure shell (requires sha1sum and curl)
#!/usr/bin/env sh
# Copyright (c) 2015 Nathan Schulte
# set LOGIN and API_KEY below --
# see bottom for example use, in this case, checking and updating the default DNS A RR for a domain
# 0: request URI, e.g. '/dns/example.com/listRRs'
# 1..n: parameters
make_request () {
LOGIN=''