Skip to content

Instantly share code, notes, and snippets.

@asksven
asksven / backup-cronjob-config.yaml
Created April 2, 2023 14:49
Backup / Restore and error handling
View backup-cronjob-config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: backupcronjob-config
data:
backup.sh: |
#!/bin/bash
# Handler will be called if something fails
handler()
@asksven
asksven / deployment.yaml
Created March 19, 2023 16:22
simple statuspage for kubernetes
View deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx-deployment
spec:
progressDeadlineSeconds: 600
replicas: 2
revisionHistoryLimit: 2
View test.py
from os import environ
from jira import JIRA
# using jira : pip install jira==3.1.1
# Following env vars must be SET
# JIRA_URL
# JIRA_ACCESS_TOKEN
# JIRA_PROJECT
@asksven
asksven / deployment-final.yaml
Last active April 13, 2020 14:28
securing-kubernetes-configuration-result
View deployment-final.yaml
kind: List
apiVersion: v1
items:
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: traefik
name: status
spec:
@asksven
asksven / deployment-start.yaml
Last active April 13, 2020 14:27
securing-kubernetes-configuration-starting-point
View deployment-start.yaml
kind: List
apiVersion: v1
items:
- apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: traefik
name: status
spec:
View cloud-config.yml
hostname: k8s-rancher-vm
rancher:
network:
interfaces:
eth0:
dhcp: true
gateway: 192.168.178.1
docker:
engine: docker-18.09.6
View README.md

Tips for faster feedback loops

lint your Dockerfile

  1. Install the hadolint binary: https://github.com/hadolint/hadolint/releases
  2. In VSCode install the hadolint extension
  3. Open a Dockerfile in VSCode and enjoy
  4. Add a lint job to your pipeline
lint_dockerfile:
@asksven
asksven / unison.md
Last active October 16, 2023 20:45
Configure unison for continuous sync
View unison.md

Configure unison for bi-directional sync

1. On client

  1. Create a profile (~/.unison/bidirsync.prf):
# Unison preferences
label = bi-directonal sync with server
root = /home/<user>/git
root = ssh://<user>@<server-name>//home/<user>/sync/git
sshargs = -oIdentityFile=/home/<user>/.ssh/<privkey-name>
View gist:c408fe37b688b5fa4be280add313adea
# Extensions to install
AutoImport
PowerShell
# Bash as terminal
File -> Preferences -> Settings
and add
```
{
"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\bash.exe"
@asksven
asksven / gist:8a00af6201a52436c4f2d91083aca1fc
Last active February 27, 2017 11:37
Setup Windows 10 ubuntu subsystem
View gist:8a00af6201a52436c4f2d91083aca1fc
sudo apt-get update && sudo apt-get upgrade
# we want to use nodejs 6
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y git nodejs-legacy npm
npm config set unsafe-perm true
sudo npm install -g @angular/cli # note: the angular-cli crashes at creating projects with "ng new" so you will have to manually run "npm install" after the project has been created
#add docker client (to be run against e.g. Docker for windows)
sudo apt-get install -y docker.io