Skip to content

Instantly share code, notes, and snippets.

View elerch's full-sized avatar

Emil Lerch elerch

View GitHub Profile
@elerch
elerch / flake.nix
Created November 14, 2023 19:45
Cross platform version of Julia Evan's flake from "Some notes on nix flakes"
{
inputs.nixpkgs.url = "nixpkgs/nixos-23.05";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
# Nixpkgs instantiated for supported system types.
nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; });
@elerch
elerch / packages.txt
Last active January 20, 2023 17:15
Standard Termux packages
pkg install openssh # Because ssh
pkg install mosh # mosh is great for mobile
pkg install curl # Handy for package downloading - one of wget/curl is needed
pkg install wget # Handy for package downloading - one of wget/curl is needed
pkg install perl # Docs in mr need perl
pkg install git # Because git - also, needed for mr
pkg install zsh # Because zsh
pkg install neovim # Because neovim
pkg install ncurses-utils # Needed for tput command, needed by liquidprompt
pkg install gnupg # gpg-agent is here and will eliminate ssh-agent issues that seem to be inherent to termux env
@elerch
elerch / example-api-gateway.yaml
Last active March 18, 2024 16:12 — forked from tmaslen/Lambda-ApiGateway-Cloudformation.json
YAML version of tmaslen's API Gateway cloudformation template - useful when you don't want to use SAM
---
AWSTemplateFormatVersion: '2010-09-09'
Description: Sample template that contains a Lambda function behind an API GW
Resources:
# BEGIN: Should only need this in an empty API Gateway situation
ApiGatewayCloudWatchLogsRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
@elerch
elerch / linters.md
Last active March 6, 2019 19:20
Linters

Want support for vim via Ale. See https://github.com/w0rp/ale

!! These linters check only files on disk. See :help ale-lint-file-linters

Chosen linters:

Language Tools
Bourne Shell/Bash shellcheck
@elerch
elerch / CJIS Policy diff.md
Last active July 31, 2017 20:55
CJIS policy diff procedure
  1. Download the PDF and pass new and old versions through: http://pdftotext.com/

  2. Take each text file and run the following bash file on it to strip out the pagination, which can really muck with the diff. Call it with < file strip-pages major.minor > file-stripped

#!/bin/bash

version=${1}
footer=CJISD-ITS-DOC-08140-$version
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKRF/xP6QW2On76if5qX+Hkj9jPDnToO2dEKQHacOOEh lobo@arch
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCoRxIS1Dr33Jhybd/ck7UCLQ1Df5msSpvw03w/ljgB+1sx/U+965+q597XRHHnzPey8NFrOdID4I1l0tfco1XG5DJG2yJ/zY+tbyK+0b0Yi4qbRFnH2kxKYcdHq29CiVk64o1VHJxxj78IO2wTUcgK4sXijm05LWqCik4LSfcOBEyOwK6f37Mew19KDq7UAojHLTEbVB6xiv2ufh9evn3PggirE1VtvQlTBnt3NdBDumxD1RzRoVgwMuU1FNvQeMwLnlMlvLX76vjPkRRrgBGEJ2k0BUm7slrAtRnBzIvIbouk55MIBzpPjCIi53L91KxwNkHNPldYG81C+BczN/R5 cardno:000604717732
@elerch
elerch / cloudformation-template-shell.yaml
Last active October 5, 2017 16:22
Useful shell for starting off a yaml CloudFormation template
AWSTemplateFormatVersion: '2010-09-09'
Parameters:
# Bucket:
# Type: String
# Default: emil
# Description: Bucket name holding source code for lambda functions
#Mappings:
#Conditions:
Resources:
MyResource:
@elerch
elerch / bootstrap.sh
Last active June 21, 2021 21:03
Bootstraps all the things (curl, git, mr, vcsh and dotfiles will exist after running)
#!/bin/sh
# To run this without copy/paste the whole thing:
# curl https://gist.githubusercontent.com/elerch/88ea951c9c4ec4c3c1604b8fc9167e53/raw/bootstrap.sh | sh
# mr is just a perl script
myrepos="http://source.myrepos.branchable.com/?p=source.git;a=blob_plain;f=mr;hb=HEAD"
# vcsh was just a bash script. After this commit, they have some autotools thing
vcsh=https://raw.githubusercontent.com/RichiH/vcsh/66944d009b8df64e0b2ddae757a83899ff8684b7/vcsh
_homebrew-installed() {
type brew &> /dev/null
}
_awscli-homebrew-installed() {
brew list awscli &> /dev/null
}
export AWS_HOME=~/.aws
@elerch
elerch / gist:74cc32ef31048778f10bb10110e59c42
Created January 27, 2017 23:44 — forked from agriffis/gist:2481292
.bashrc.virtualenvwrapper
# Dynamically load virtualenvwrapper functions to reduce shell startup
# time.
#
# Copyright 2012 Aron Griffis <aron@arongriffis.com>
# Released under the GNU GPL v3
#######################################################################
# Python virtualenvwrapper loads really slowly, so load it on demand.
if [[ $(type -t workon) != function ]]; then
virtualenv_funcs=( workon deactivate mkvirtualenv )