Skip to content

Instantly share code, notes, and snippets.

@dgjustice
dgjustice / script-template.sh
Created December 15, 2020 12:57 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
cat <<EOF
@dgjustice
dgjustice / junos.py
Last active May 21, 2020 20:28 — forked from jobec/junos.py
Junos config parsing with pyparsing
import textwrap
from collections import OrderedDict
import pyparsing as pp
class Statement(str):
def __str__(self):
return super().__str__() + ";"