Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryan Schlesinger ryansch

View GitHub Profile
@ryansch
ryansch / link_multiple_switches.yaml
Last active March 12, 2023 09:37 — forked from aderusha/link_multiple_switches.yaml
Home Assistant Blueprint: Link Multiple Switches v1.0.1
View link_multiple_switches.yaml
@ryansch
ryansch / Dockerfile
Last active February 15, 2023 17:03
Install nodejs in docker debian/ubuntu
View Dockerfile
FROM hexpm/elixir:some_version
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
# Install nodejs
RUN set -eux; \
\
apt-get update; \
apt-get install -y \
@ryansch
ryansch / unifi-ssh
Created January 30, 2023 23:43
Enable old SHA-1 based rsa stuff for unifi
View unifi-ssh
#!/bin/bash
set -euo pipefail
exec ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa "$@"
@ryansch
ryansch / README.md
Last active November 3, 2022 20:27
attr_encryption -> Active Record Encryption
View README.md

This is designed to work with https://github.com/PagerTree/attr_encrypted/tree/rails-7-0-support 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 = ActiveRecord::Encryption::EnvelopeEncryptionKeyProvider.new

in application.rb.

@ryansch
ryansch / Dockerfile.cloudflared
Last active May 13, 2022 22:16
Pihole Install
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 February 6, 2022 18:35
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 17:04
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 December 18, 2020 17:39
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 16:20
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', {