Skip to content

Instantly share code, notes, and snippets.

View ryansch's full-sized avatar

Ryan Schlesinger ryansch

View GitHub Profile
@ryansch
ryansch / stackscript.sh
Last active December 18, 2020 17:39
linode stackscript for bootstrapping ubuntu with docker
#!/bin/bash
set -euo pipefail
#<UDF name="name" label="Node name">
source <ssinclude StackScriptID="1">
#source ./bash.sh
echo "Setting up ubuntu user's ssh key"
# add_newline = false
[username]
# show_always = true
style_root = "red"
style_user = "purple"
[hostname]
# ssh_only = false
style = "yellow"
@ryansch
ryansch / init.vim
Last active May 1, 2019 16:20
neovim config
let g:ale_use_global_executables = 1
call plug#begin('~/.config/nvim/plugged')
Plug 'Shougo/denite.nvim'
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
Plug 'w0rp/ale'
Plug 'maximbaz/lightline-ale'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
" Plug 'autozimu/LanguageClient-neovim', {
@ryansch
ryansch / Dockerfile
Last active October 24, 2017 23:41
Docker snippet for rubygems
FROM outstand/ruby-base:2.4.2-alpine
RUN addgroup -S deploy && \
adduser -S -G deploy deploy && \
mv /usr/local/bin/rake /usr/local/bin/rake.back && \
apk add --no-cache bash build-base linux-headers tzdata curl curl-dev less && \
apk upgrade --no-cache
WORKDIR /srv
COPY . /srv/
@ryansch
ryansch / ssh_config
Created June 30, 2017 15:41
SSH Config
Host *
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do
echo $IMAGE
filename="${IMAGE//\//-}"
filename="${filename//:/-}.docker-image.tar.gz"
docker save ${IMAGE} | pigz --stdout > $filename
done
@ryansch
ryansch / README.md
Last active March 21, 2017 16:07
Build terraform for macOS with docker

Run the following from the location of the terraform git clone:

docker run --rm -v $(pwd):/go/src/github.com/hashicorp/terraform -w /go/src/github.com/hashicorp/terraform -e XC_OS=darwin -e XC_ARCH=amd64 golang:latest bash -c "apt-get update && apt-get install -y zip && make bin"

Resulting binary is in pkg/darwin_amd64.

@ryansch
ryansch / README.md
Last active February 5, 2019 21:18
openvpn-armhf

Configure openvpn

You can run this entire first section with ryansch/openvpn:latest on a more powerful machine than the pi.

OVPN_DATA="ovpn-data"

docker run -v $OVPN_DATA:/etc/openvpn --rm ryansch/openvpn:latest ovpn_genconfig -d -N -b -C AES-256-CBC -T TLS-DHE-RSA-WITH-AES-256-GCM-SHA384 -a SHA512 -n 192.168.8.1 -p 'route 192.168.8.0 255.255.255.0' -u udp://<OPENVPN_HOST> -e 'topology subnet' -p 'dhcp-option DOMAIN <LAN_DOMAIN>' -E 'remote <OPENVPN_HOST> 443 tcp'

docker run -v $OVPN_DATA:/etc/openvpn --rm -it -e EASYRSA_KEY_SIZE=4096 ryansch/openvpn:latest ovpn_initpki

@ryansch
ryansch / create.log
Created January 19, 2017 01:14
docker-machine create debug log
Docker Machine Version: 0.8.2, build e18a919
Found binary path at /usr/local/bin/docker-machine-driver-parallels
Launching plugin server for driver parallels
Plugin server listening at address 127.0.0.1:59493
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
[ 0.000000] Linux version 4.9.4-rancher (root@1165eab7f7a9) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #1 SMP Sun Jan 15 22:26:11 UTC 2017
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.9.4-rancher rancher.autologin=tty1 rancher.autologin=ttyS0 console=tty0 console=ttyS0 printk.devkmsg=on initrd=/boot/initrd
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] Disabled fast string operations
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'