Skip to content

Instantly share code, notes, and snippets.

View davosian's full-sized avatar

Dennis Staiger davosian

  • Ennovations.net
View GitHub Profile
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@davosian
davosian / cert.yml
Created October 23, 2020 12:21 — forked from Johannestegner/cert.yml
CertManagerExample
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: eu.jite.wildcard.crt
namespace: default
spec:
secretName: eu.jite.wildcard.tls
dnsNames:
- "jite.eu"
- "*.jite.eu"
@davosian
davosian / fix_onedrive.sh
Created December 1, 2020 09:14 — forked from drblue/fix_onedrive.sh
Fix OneDrive for Mac CPU usage
#!/bin/bash
## Fix OneDrive for Mac CPU usage
##
## Seems this is still a problem 5 years later after I created this little gist.
## I have long since stopped using OneDrive (luckily), but according to
## comments below, I have added the new path for OfficeFileCache for macOS
## Mojave (10.14) and Catalina (10.15).
## Run this on macOS Mojave (10.14) and Catalina (10.15)
find ~/Library/Containers/ -type d -name OfficeFileCache -exec rm -r {} +
@davosian
davosian / remove-gpg-user.sh
Created February 18, 2021 22:13 — forked from glogiotatidis/remove-gpg-user.sh
Git-crypt remove user.
#!/bin/bash
#
# Script to remove GPG key from git-crypt
#
# It will re-initialize git-crypt for the repository and re-add all keys except
# the one requested for removal.
#
# Note: You still need to change all your secrets to fully protect yourself.
# Removing a user will prevent them from reading future changes but they will
# still have a copy of the data up to the point of their removal.
@davosian
davosian / docker-compose-backup.sh
Created March 2, 2021 07:15 — forked from pirate/docker-compose-backup.sh
Backup a docker-compose project, including all images, named and unnamed volumes, container filesystems, config, logs, and databases.
#!/usr/bin/env bash
### Bash Environment Setup
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
# https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
# set -o xtrace
set -o errexit
set -o errtrace
set -o nounset
set -o pipefail
@davosian
davosian / HowTo
Created May 2, 2021 11:35 — forked from s3rj1k/HowTo
Ubuntu 20.04.2 AutoInstall
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
wget https://ubuntu.volia.net/ubuntu-releases/20.04.2/ubuntu-20.04.2-live-server-amd64.iso
# Create ISO distribution dirrectory:
@davosian
davosian / groceries_wiktionary
Created July 19, 2021 14:57 — forked from ahue/groceries_wiktionary
rhasspy slot program to get german groceries from wiktionary into rhasspy
#! /usr/bin/python3
try:
# For Python 3.0 and later
from urllib.request import urlopen
from urllib.parse import quote
except ImportError:
# Fall back to Python 2's urllib2
from urllib2 import urlopen
from urllib2 import quote
@davosian
davosian / groceries_bring
Created July 19, 2021 14:57 — forked from ahue/groceries_bring
A slot-program for retrieve German grocery terms for Rhasspy
#!/usr/bin/env bash
set -e
url="https://web.getbring.com/locale/articles.de-DE.json"
echo "GET ${url}" >&2
curl -X GET \
-H 'Content-Type: application/json' \
"${url}" | \
jq --raw-output 'to_entries[] as $e | "\($e.value)"' | \
@davosian
davosian / web-servers.md
Created September 14, 2021 13:52 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@davosian
davosian / export-kubeconfig-from-aks
Created September 20, 2021 07:11 — forked from dcasati/export-kubeconfig-from-aks
Export KUBECONFIG from AKS
az aks get-credentials --resource-group k8s-demo-ss --name k8s-demo-cluster-ss --file kubeconfig-ss