Skip to content

Instantly share code, notes, and snippets.

View habbis's full-sized avatar

Eirik Habbestad Helleve habbis

View GitHub Profile
#!/usr/bin/env bash
# Personal script to setup Linux Mint
# and install bunch of tools.
set -euo pipefail
echoerr() { echo "$@" 1>&2; }
ensure_sudo() {
@habbis
habbis / script-template.sh
Created March 11, 2021 10: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
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@habbis
habbis / skeleton.py
Created February 9, 2021 15:47 — forked from GuyAllard/skeleton.py
A python script skeleton
#! /usr/bin/env python
"""
A skeleton python script which reads from an input file,
writes to an output file and parses command line arguments
"""
from __future__ import print_function
import sys
import argparse
def main():