Skip to content

Instantly share code, notes, and snippets.

View aklinkert's full-sized avatar

Alex Klinkert aklinkert

  • Hamburg
View GitHub Profile

Keybase proof

I hereby claim:

  • I am aklinkert on github.
  • I am aklinkert (https://keybase.io/aklinkert) on keybase.
  • I have a public key ASCsxVGVdQ-8Bl_lrpLNjtCMi_P4TU5UEIBemp8x9WebXgo

To claim this, I am signing this object:

@aklinkert
aklinkert / check-git-uncommitted-changes.sh
Last active July 19, 2022 08:52
Bash script to recursively check uncommitted changes in a directory tree.
#!/usr/bin/env bash
cwd="$(pwd)"
find . -print0 -type d | while IFS= read -r -d '' file; do
if [ ! -d "${file}/.git" ]; then
continue
fi
cd "${file}"
if [[ -n $(git status -s) ]]; then
@aklinkert
aklinkert / s3_upload.json
Created November 13, 2016 22:24
s3 upload
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"s3:DeleteObject",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:PutObject",
"s3:PutObjectAcl",
@aklinkert
aklinkert / s3_public.json
Created November 13, 2016 22:07
s3_public
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Allow Public Access to All Objects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket/*"
}
@aklinkert
aklinkert / s3_redirect.xml
Created November 13, 2016 17:02
S3 redirect
<RoutingRules>
<RoutingRule>
<Redirect>
<Protocol>http</Protocol>
<HostName>www.target.example.com</HostName>
<HttpRedirectCode>301</HttpRedirectCode>
</Redirect>
</RoutingRule>
</RoutingRules>
@aklinkert
aklinkert / kubernetes_continuous.sh
Created October 14, 2016 14:03
Kubernetes continuous integration
#!/usr/bin/env bash
set -e
VERSION="${CIRCLE_SHA1}"
KUBE_CONTEXT="$(kubectl config current-context)"
# getKubeValue "${KUBE_CONTEXT}" "${KUBE_NAMESPACE}" "${deployment}" "${path}"
getKubeValue() {
kubectl --context "${1}" --namespace "${2}" get "deployment/${3}" -o "jsonpath={${4}}"
@aklinkert
aklinkert / bash_ping_loop.sh
Created June 10, 2016 22:20
Bash ping loop
#!/usr/bin/env bash
while true; do
result="$(curl -v "$1" 2>&1)"
code="$(echo "${result}" | tail -n1)"
if [ "${code}" != "ok" ]; then
echo "Failure at $(date)"
echo "code: ${code}"
echo "result: ${result}"
@aklinkert
aklinkert / certificate.sh
Last active September 24, 2015 17:02
Create self signed ssl certifgicate
#!/bin/bash
timestamp() {
date +"%s"
}
name=$(timestamp)
echo "creating key files in dir ./tmp-$name/"

Keybase proof

I hereby claim:

  • I am apinnecke on github.
  • I am apinnecke (https://keybase.io/apinnecke) on keybase.
  • I have a public key whose fingerprint is 8468 16F8 52ED F2ED 927A 8F4C 4B46 5690 25A4 15B8

To claim this, I am signing this object:

@aklinkert
aklinkert / bootstrap_tab_active
Created April 22, 2014 22:12
Marks the current active Tab by comparing urls
/*menu handler*/
$(function(){
function stripTrailingSlash(str) {
if(str.substr(-1) == '/') {
return str.substr(0, str.length - 1);
}
return str;
}
var url = window.location.pathname;