Skip to content

Instantly share code, notes, and snippets.

Loren McIntyre mcint

  • UC Berkeley
  • Berkeley
View GitHub Profile
@mcint
mcint / gist:3de07d8a2bebd6111c4eae0b632a5383
Created Dec 6, 2019
Jinja template testing one-liner
View gist:3de07d8a2bebd6111c4eae0b632a5383
# pip3 install fluentpy jinja2
python3 -m fluentpy '_.lib.jinja2.Template("""asdf\n{% if "qwer" in lst %}rewq{% endif %}\nfdsa""").render({"lst":["qwer"]}).print()'
@mcint
mcint / ke_config_skel.sh
Last active Jul 3, 2019 — forked from david-thorman/ke_config_skel.sh
Kloudless Enterprise configuration file skeleton generator
View ke_config_skel.sh
#!/bin/bash
set -eu -o pipefail
gen_priv() {
openssl genrsa 2048 2> /dev/null
}
gen_pub() {
echo "${1}" | openssl rsa -pubout 2> /dev/null
}
View keybase.md

Keybase proof

I hereby claim:

  • I am mcint on github.
  • I am mcint (https://keybase.io/mcint) on keybase.
  • I have a public key ASCfrC1CkNEqo47DDEgRsIdKR5ID8BGp719vfN0__wfCFAo

To claim this, I am signing this object:

View keybase.md-reset
### Keybase proof
I hereby claim:
* I am mcint on github.
* I am mcint (https://keybase.io/mcint) on keybase.
* I have a public key ASCUlyLiIN-lEUEuiJGoi1vceKBWs4nu9TifsX--2O99Ywo
To claim this, I am signing this object:
@mcint
mcint / unix-decal-lab1
Created Sep 19, 2017
Lab 1 - VPS setup
View unix-decal-lab1
# Unix SysAdmin Decal
## Lab 1: Unix, the Shell, OSS {#lab1}
[Slides](https://ocf.io/decal/slides/1) and [lab](https://ocf.io/decal/labs/1) links for Tuesday 9-12-2017.
### Table of Contents {#toc}
1. [Create ssh key](#ssh-create)
2. [VPS hosting provider](#vps-hosting)
- We'll be providing the machines, one of
- Amazon Web Services
- Google Cloud Platform - account provided by us
- Digital Ocean
View MSYS|Cygwin operational snippet - Clean %WINDOWS_VARS% in bash $PATH
if [[ "$PATH" =~ "%" ]]; then
PATH="$((for SUB in $(echo $PATH | tr : '\n'); do [[ \"$SUB\" =~ \"%\" ]] && (echo \"$(printenv `echo $SUB|cut -d% -f2`)$(echo $SUB|cut -d% -f3)\" | sed 's_C:_/c_g' | sed 's_\\_/_g') || echo $SUB; done) | tr '\n' : | sed 's_:$__')"
fi
View MSYS | Cygwin path-cleaning snippet
[[ "$PATH" =~ "%" ]] PATH=(for SUB in `echo $PATH | tr : '\n'`; do [[ "$SUB" =~ "%" ]] && (echo "$(printenv `echo $SUB|cut -d% -f2`)$(echo $SUB|cut -d% -f3)" | sed 's_C:_/c_g' | sed 's_\\_/_g') || echo $SUB; done) | tr '\n' : | sed 's_:$__'
You can’t perform that action at this time.