Skip to content

Instantly share code, notes, and snippets.

View thomd's full-sized avatar

Thomas Dürr thomd

  • Hamburg, Germany
View GitHub Profile
@thomd
thomd / software.md
Created February 28, 2023 16:53
software I like #list #software
@thomd
thomd / test.sql
Last active December 13, 2022 14:35
create a test database for learning sql #sql
CREATE DATABASE IF NOT EXISTS test;
USE test;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
c1 BIGINT(20) NOT NULL,
c2 tinytext NOT NULL,
c3 tinytext NOT NULL,
c4 DATE NOT NULL,
@thomd
thomd / Makefile
Last active March 13, 2022 15:07
Backup all Github Repositories to AWS S3 (tested on maxOS)
NOW := $(shell date +"%Y%m%d%H%M%S")
BUCKET := thomd/github/
N_REPOS := $(shell gh repo list --source -L 200 | wc -l | sed 's/ //g')
N_GISTS := $(shell gh gist list -L 400 | wc -l | sed 's/ //g')
.PHONY: backup
backup:
@n=1; for repo in $$(gh repo list --source -L 200 --json name | jq -r '.[].name'); do echo "\033[0;90mcloning repository $${n}/$(N_REPOS):\033[0m $${repo}"; n=$$((n+1)); gh repo clone $${repo} thomd/$${repo} -- -q; done
@n=1; for gist in $$(gh gist list -L 400 | awk '{print $$1}'); do echo "\033[0;90mcloning gist $${n}/$(N_GISTS):\033[0m $${gist}"; n=$$((n+1)); gh gist clone $${gist} thomd/$${gist} -- -q; done
@tar -czf thomd_$(NOW).tar.gz thomd/
@thomd
thomd / azure-pipeline-ssl-check.yml
Last active September 6, 2023 11:59
Shell script for checking if a ssl-certificate expires within some next days. To be triggered by a cron job or a pipeline.
#
# Notify on an upcoming expiration of a SSL ceritficate
#
# SETUP
#
# Create an Variable Group 'SSL-Cert-Check' within the Pipeline Library with the variables
# SSL_HOSTNAME
# SSL_THRESHOLD_DAYS
# TEAMS_WEBHOOK_URL
#
@thomd
thomd / keyboard-shortcuts.ipynb
Last active December 17, 2021 23:55
Jupyter Notebooks Introduction #jupyter #python #markdown
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomd
thomd / commit-message.js
Last active December 16, 2021 17:27
simple husky hook for ammending a commit message with a JIRA ID. #husky #git #jira
const fs = require('fs')
const path = require('path')
const chalk = require('chalk')
const { spawnSync } = require('child_process')
const cwd = process.cwd()
const messagePath = path.join(cwd, '.git', 'COMMIT_EDITMSG')
const JIRA_ID = new RegExp(/ABCD-\d+/)
@thomd
thomd / Course-Kubernetes-Commands-and-YAML.txt
Created August 1, 2021 21:33 — forked from bugcy013/Course-Kubernetes-Commands-and-YAML.txt
Course-Kubernetes-Commands-and-YAML.txt
1.a- kubectl run
kubectl get pods
kubectl run first-deployment --image=nginx
kubectl get pods
(maybe one more time to show the state changed from container creation to Running)
(copy the pod name from get pods)
kubectl exec -it pod-name -- /bin/bash
echo Hello nginx! > /usr/share/nginx/html/index.html
apt-get update