Skip to content

Instantly share code, notes, and snippets.


Ryan Schlesinger ryansch

View GitHub Profile
ryansch /
Created May 17, 2011 — forked from mtigas/0001.markdown
Command-line s3 uploader that uses the MultiPart (chunked) S3 upload functionality to parallelize and speed up large file uploads.
#!/usr/bin/env python
# coding=utf-8
# 2010-2011, Mike Tigas
# Usage:
# s3up filename
# Uploads the given file to the DEFAULT_BUCKET (see below)
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 / hooks_controller.rb
Created Sep 28, 2010
Rails Controller for Chargify Webhooks
View hooks_controller.rb
require 'md5'
class Chargify::HooksController < ApplicationController
protect_from_forgery :except => :dispatch
before_filter :verify, :only => :dispatch
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change ].freeze
def dispatch
event = params[:event]
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 /
Last active Feb 5, 2019

Configure openvpn

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


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 -p 'route' -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 / elasticsearch14.rb
Created Mar 31, 2015
Elasticsearch 1.4 Formula
View elasticsearch14.rb
class Elasticsearch14 < Formula
homepage ""
url ""
sha1 "963415a9114ecf0b7dd1ae43a316e339534b8f31"
depends_on :java => "1.7+"
def cluster_name
ryansch / tar.rb
Created Jun 16, 2016
Create/Extract a tarball from ruby
View tar.rb
require 'find'
require 'archive/tar/minitar'
module IdiomaticTar
def create_tarball(filename:, directory:)
base_dir = do'wb') do |tarball|
Zlib::GzipWriter.wrap(tarball) do |gz| do |tar|
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
You can’t perform that action at this time.