Skip to content

Instantly share code, notes, and snippets.

View aweijnitz's full-sized avatar

Anders Weijnitz aweijnitz

View GitHub Profile
@aweijnitz
aweijnitz / Vagrantfile
Last active March 25, 2024 13:54
This is a Vagrant file and a provisioning script to create a Debian-based Jenkins server, including Java, Ant and Tomcat. Also see "provision.sh" below
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
# Named boxes, like this one, don't need a URL, since the are looked up
@aweijnitz
aweijnitz / urandom_music.sh
Last active January 14, 2024 04:21
Music from /dev/urandom on Mac OSX
# I really enjoyed "Bash One Liner - Compose Music From Entropy in /dev/urandom"
# From http://blog.robertelder.org/bash-one-liner-compose-music/
#
# This is a collection of one liners that work on Mac OSX
# You need sox
brew install sox
# Major scale
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | xxd -r -p | sox -v 0.25 -traw -r16000 -b32 -e signed-integer - -tcoreaudio
@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 / install_CUPS_all_defaults.sh
Last active November 12, 2023 19:55
Installing CUPS printer on Debian and add PDF printer
#!/bin/bash
sudo apt-get -y install cups
sudo apt-get -y install cups-pdf
# add pdf printer to cups
# - named files end up in ~/PDF/
# - unnamed files are stored in /var/spool/cups-pdf/ANONYMOUS/, such as PDF:s created by streaming bytes over an API
sudo lpadmin -p cups-pdf -v cups-pdf:/ -E -P /usr/share/ppd/cups-pdf/CUPS-PDF.ppd
@aweijnitz
aweijnitz / munich-tips.md
Last active July 12, 2023 08:37
Tips to do when in Munich
@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 / 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 / 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 / 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 / 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