Skip to content

Instantly share code, notes, and snippets.


Ryan Schlesinger ryansch

  • Instance Consulting Inc.
  • British Columbia, Canada
View GitHub Profile
ryansch /
Last active Nov 3, 2022
attr_encryption -> Active Record Encryption

This is designed to work with as attr_encrypted normally can't coexist with Rails 7.

It will allow you to add encrypts and migrate_encryption_for to your models, migrate, and finally remove everything but the encrypts lines.

You probably also want to set

config.active_record.encryption.key_provider =

in application.rb.

View Dockerfile.cloudflared
FROM ubuntu:jammy
LABEL maintainer="Ryan Schlesinger <>"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt-get update -y; \
apt-get install -y \
ryansch /
Created Feb 6, 2022
Homebrew install w/ arm64 linux check removed.
# 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 /
Last active May 19, 2021
Launch a linode from an image
# 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 /
Last active Dec 18, 2020
linode stackscript for bootstrapping ubuntu with docker
set -euo pipefail
#<UDF name="name" label="Node name">
source <ssinclude StackScriptID="1">
#source ./
echo "Setting up ubuntu user's ssh key"
View starship.toml
# add_newline = false
# show_always = true
style_root = "red"
style_user = "purple"
# ssh_only = false
style = "yellow"
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 / 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
COPY . /srv/
View ssh_config
Host *
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication yes
docker images | tail -n +2 | grep -v "none" | awk '{printf("%s:%s\n", $1, $2)}' | while read IMAGE; do
echo $IMAGE
docker save ${IMAGE} | pigz --stdout > $filename