Skip to content

Instantly share code, notes, and snippets.

@fauberso
fauberso / sendreject.sh
Last active October 1, 2021 10:43
Send File Details (including HEX dump) as MIME Mail, useful for automated workflows where files sometimes cannot be processed.
#!/bin/bash
shopt -s extglob
filename=$1
tmpfile=$(mktemp)
tolist=$2
shift 2
mailsubject=$@
echo -e "From: Administrator <[email protected]>" >> $tmpfile
@fauberso
fauberso / gist:b4f7e632dd32262ce604c28fc67ec591
Last active October 1, 2021 10:46
SageMaker: Auto Stop instance, and add Conda packages from conda-forge
#!/bin/bash
set -e
# PARAMETERS
IDLE_TIME=7200
echo "Fetching the autostop script"
wget https://raw.githubusercontent.com/aws-samples/amazon-sagemaker-notebook-instance-lifecycle-config-samples/master/scripts/auto-stop-idle/autostop.py
@fauberso
fauberso / kubernetes-gencerts.sh
Created May 11, 2020 16:09
Generates self-signed tls secrets for kubernetes. Run this with e.g. 'kubernetes-gencerts microk8s.local', then install the secrets with 'kubectl apply -f microk8s.local.yaml'
#!/bin/bash
HOSTNAME=${1:-localhost}
openssl req -newkey rsa:2048 -nodes -keyout $HOSTNAME.key -x509 -days 3650 -out $HOSTNAME.crt
echo "apiVersion: v1
kind: Secret
metadata:
name: $HOSTNAME.tls
namespace: default
type: kubernetes.io/tls
data:
@fauberso
fauberso / RaspberryPi-IgnitionKey.ino
Last active September 28, 2019 11:19
RaspberryPi-IgnitionKey
#include "DigiKeyboard.h"
// This sketch is used to do the initial setup on
// a freshly installed Raspberry Pi: Upload it to a
// Digispark board, and connect it to your Arduino.
// It will log in using 'pi'/'raspberry' and execute
// 'sudo systemctl enable ssh' and '...start ssh'
const int def_delay = 125;
void setup() {
@fauberso
fauberso / riot-cla.txt
Last active September 24, 2019 16:37
RIoT CLA
RIoT Individual Contributor License Agreement
(Adapted from http://www.apache.org/licenses/icla.txt, © The Apache Software Foundation)
Thank you for your interest in the RIoT Project (the "Organization"). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Organization must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Organization and its users; it does not change your rights to use your own Contributions for any other purpose.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Organization. In return, the Organization shall not use Your Contributions in a way that is contrary to the public benefit or inconsistent with its bylaws in effect at the time of the Contribution. Except for the license grante
@fauberso
fauberso / .bashrc
Created December 26, 2018 18:10
Run Screen at login
...
if [ -z "$STY" ]; then screen -R; fi