Skip to content

Instantly share code, notes, and snippets.

View sbrodehl's full-sized avatar
💭
I may be slow to respond.

S. Brodehl sbrodehl

💭
I may be slow to respond.
View GitHub Profile
@sbrodehl
sbrodehl / flnidupdate.py
Created May 25, 2023 10:41
Update FlarmID from United FlarmNet data.
from pathlib import Path
import urllib.request
import flarmnet
UNITED_FLARMNET_URL = "https://turbo87.github.io/united-flarmnet/united.fln"
if __name__ == '__main__':
import argparse
@sbrodehl
sbrodehl / gist:13f852b776b8b2b03d4695f14d2e8622
Last active August 27, 2022 10:01
TouchID to Authenticate sudo
# See https://news.ycombinator.com/item?id=32611340
# /etc/pam.d/sudo
# ...
auth sufficient pam_smartcard.so
auth sufficient pam_tid.so
# ...
@sbrodehl
sbrodehl / script-template.sh
Created January 2, 2021 22:59 — 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...]
@sbrodehl
sbrodehl / RELEASE.md
Created December 19, 2020 21:23
Release Note Template

tag: Name vMAJOR.MINOR.PATCH

Release MAJOR.MINOR.PATCH

Highlights

Major Features and Improvements

Breaking Changes

@sbrodehl
sbrodehl / README-Template.md
Created February 23, 2018 09:28 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@sbrodehl
sbrodehl / read_xvg
Last active February 5, 2017 21:16 — forked from richardjgowers/read_xvg
Read xvg file
import numpy as np
import sys
def read_xvg(fname):
"""Read first two columns of data from xvg file fname
Returns numpy array of data
"""
skip = 0
with open(fname, 'r') as f:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sbrodehl
sbrodehl / node_debian_init.sh
Last active February 24, 2016 17:48 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#!/bin/bash
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
#!/usr/bin/python
# The idea behind this script is if plugging a RaspberryPi into a foreign network whilst running it headless
# (i.e. without a monitor/TV), you need to know what the IP address is to SSH into it.
#
# This script emails you the IP address if it detects an ethernet address other than it's usual address
# that it normally has, i.e. on your home network.
import smtp, string
################################################