Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Schlesinger ryansch

  • Instance Consulting Inc.
  • British Columbia, Canada
View GitHub Profile
View Dockerfile.cloudflared
FROM ubuntu:jammy
LABEL maintainer="Ryan Schlesinger <ryan@ryanschlesinger.com>"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
\
apt-get update -y; \
apt-get install -y \
@ryansch
ryansch / install.sh
Created Feb 6, 2022
Homebrew install w/ arm64 linux check removed.
View install.sh
#!/bin/bash
# We don't need return codes for "$(command)", only stdout is needed.
# Allow `[[ -n "$(command)" ]]`, `func "$(command)"`, pipes, etc.
# shellcheck disable=SC2312
set -u
abort() {
printf "%s\n" "$@"
@ryansch
ryansch / launch.sh
Last active May 19, 2021
Launch a linode from an image
View launch.sh
#!/bin/bash
# On macos, this script's deps can be installed with:
# brew install jq python3
# pip3 install linode-cli
# If on another platform, remove the call to pbcopy at the end of the script.
set -euo pipefail
@ryansch
ryansch / stackscript.sh
Last active Dec 18, 2020
linode stackscript for bootstrapping ubuntu with docker
View stackscript.sh
#!/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"
View starship.toml
# 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
neovim config
View init.vim
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 Oct 24, 2017
Docker snippet for rubygems
View Dockerfile
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/
View 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
View docker-backup-all-images.sh
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 Mar 21, 2017
Build terraform for macOS with docker
View README.md

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.