Skip to content

Instantly share code, notes, and snippets.

View aweijnitz's full-sized avatar

Anders Weijnitz aweijnitz

View GitHub Profile
@aweijnitz
aweijnitz / buildNDeplyDockerImage
Created January 9, 2024 20:26
Deploy docker image to remote Docker Server via ssh
set -e
REMOTE_USERNAME="<REMOTE_USER_NAME>"
SSHKEY="<PATH_TO_SSH_KEY_HERE>"
REMOTE_HOST="<HOSTNAME_HERE>"
IMAGE_NAME="$1" # The name of the image including tag. Example: dockertest:1.0.0
TAG_NAME="$2"
CONTAINER_NAME=$IMAGE_NAME
# Check if an argument is provided
@aweijnitz
aweijnitz / audioCaptureOnRPi
Last active June 27, 2023 20:25
Useful one-libers for working with USB audio on Rasberry Pi
# Setup an RTMP streaming server running in Docker
docker run -d -p 1935:1935 --name nginx-rtmp tiangolo/nginx-rtmp
# Alsa tools needed for convenient sound interfacing
sudo apt-get -y install alsa-tools
sudo apt-get -y install alsa-utils
sudo apt install ffmpeg
# Start an RTMP stream to a remote streaming server
@aweijnitz
aweijnitz / installDockerOnPi.sh
Last active June 27, 2023 20:38
install docker on raspberry pi
#!/bin/bash
# from https://pimylifeup.com/raspberry-pi-docker/
# Step 1 - Update and upgrade
sudo apt update && sudo apt upgrade -y
# Step 2 - Install docker
curl -sSL https://get.docker.com | sh
@aweijnitz
aweijnitz / munich-tips.md
Last active July 12, 2023 08:37
Tips to do when in Munich
@aweijnitz
aweijnitz / readingLists.md
Last active March 9, 2020 08:40
Reading List

Reading List

This is my attempt at collecting links and notes to myself to check. My current system is mailing links to myself, which is not really working well.

Virtualization, Deployment, DevOps

Firecracker - Secure and fast microVMs for serverless computing

Firecracker enables you to deploy workloads in lightweight virtual machines, called microVMs, which provide enhanced security and workload isolation over traditional VMs, while enabling the speed and resource efficiency of containers. Firecracker was developed at Amazon Web Services to improve the customer experience of services like AWS Lambda and AWS Fargate.

@aweijnitz
aweijnitz / installOpenWhisk.sh
Last active June 28, 2021 18:27
Install OpenWhisk on Minikube using Helm
# Assuming the following is installed and available
# - minikube installed and started
# - helm installed
# - OpenWhisk CLI, wsk, installed (not configured)
# - git clone https://github.com/apache/openwhisk-deploy-kube.git
#
# Clean up: In case you have a previously failed install, remove it from the cluster with the following line
# kubectl delete namespace openwhisk
# Create a namespace to deploy into
@aweijnitz
aweijnitz / runDocker.sh
Created February 24, 2020 14:45
Start docker with latest node for local development
docker run -it --rm -p 5000:5000 -v $(pwd):/api -w="/api" node bash
@aweijnitz
aweijnitz / kubernetes-basics
Last active February 19, 2020 21:02
kubernetes basics with minikube
# Installation (Mac)
brew update; brew install minikube
minikube version
minikube start
# kubectl
kubectl version
@aweijnitz
aweijnitz / partitionSpaceMonitor.sh
Created November 3, 2019 10:12
Shell script to run as a cron job and "run command" to prevent motionEyeOS from filling up the /data partition
#!/bin/bash
CURRENT=$(df /data/output | grep /dev | awk '{ print $5}' | sed 's/%//g')
THRESHOLD_CLEAN=60
THRESHOLD_FULL=85
if [ "$CURRENT" -gt "$THRESHOLD_CLEAN" ] ; then
find /data/output -type f -mtime +3 -exec rm -f {} \;
fi
if [ "$CURRENT" -gt "$THRESHOLD_FULL" ] ; then
@aweijnitz
aweijnitz / .bash_profile
Created November 10, 2017 22:03 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management