Skip to content

Instantly share code, notes, and snippets.

@JeffreyVdb
JeffreyVdb / keybase.md
Created October 8, 2018 06:38
keybase.md

Keybase proof

I hereby claim:

  • I am JeffreyVdb on github.
  • I am jeffreyvdb (https://keybase.io/jeffreyvdb) on keybase.
  • I have a public key whose fingerprint is 389A 3305 D823 729D 7FF8 A8C0 53D4 B3FF B09B 6422

To claim this, I am signing this object:

@JeffreyVdb
JeffreyVdb / github-to-s3.ps1
Created August 6, 2018 11:11
Backup github repositories to AWS S3
#!/usr/bin/pwsh
Param (
[Parameter(Mandatory=$True, Position=1)]
[string]$RepositoryName,
[Parameter(Mandatory=$True)]
[string]$BucketName,
[Parameter(Mandatory=$True)]
[string]$Organization = "",
#!/usr/bin/env zsh
if (( $+commands[kubectl] )); then
source <(kubectl completion zsh)
fi
function env_to_secret() {
perl -MMIME::Base64 -ne '/^(.*?)=(.*)$/ && printf("$1: %s\n", encode_base64($2, ""))'
}
@JeffreyVdb
JeffreyVdb / install-kubectl-multiplatform.ps1
Created May 29, 2018 09:23
Install kubectl mutli platform
#!/usr/bin/pwsh
function Get-KubectlUnix {
param (
[string]$Version,
[string]$Platform
)
$tempPath = [System.IO.Path]::GetTempFileName()
$kubectlURL = "https://storage.googleapis.com/kubernetes-release/release/$($Version.Trim("`n"))/bin/$Platform/amd64/kubectl"
@JeffreyVdb
JeffreyVdb / Kube-cron-extract-job.sh
Last active May 17, 2018 12:41
Extract a job from a kubernetes cronjob
function kcrongetjob() {
local cronjob_name="$1"
local namespace="${2:-default}"
local _json
_json=$(kubectl -n $namespace get cronjob $cronjob_name -o json --export 2>&1)
if [ $? -eq 0 ]; then
echo "{
\"apiVersion\": \"batch/v1\",
\"kind\": \"Job\",
@JeffreyVdb
JeffreyVdb / ansible-role-test.sh
Created December 31, 2017 10:19 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
# - test_idempotence: whether to test playbook's idempotence (default = true)
@JeffreyVdb
JeffreyVdb / consul.service
Created June 13, 2017 13:24 — forked from yunano/consul.service
/etc/systemd/system/consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d

Keybase proof

I hereby claim:

  • I am JeffreyVdb on github.
  • I am jeffreyvdb (https://keybase.io/jeffreyvdb) on keybase.
  • I have a public key whose fingerprint is 389A 3305 D823 729D 7FF8 A8C0 53D4 B3FF B09B 6422

To claim this, I am signing this object:

@JeffreyVdb
JeffreyVdb / keybase.md
Created June 16, 2016 12:59
keybase.md

Keybase proof

I hereby claim:

  • I am jeffreyvdb on github.
  • I am jeffreyvdb (https://keybase.io/jeffreyvdb) on keybase.
  • I have a public key ASDV3QZS1nS2RCx5Nh-9cmBk19l6kxgi6-sABKgmhyh5BAo

To claim this, I am signing this object:

@JeffreyVdb
JeffreyVdb / logrotate
Last active February 8, 2016 08:59
Relaxing logrotate compression
/var/log/*.log {
weekly
rotate 26
compress
compresscmd "/usr/local/bin/xzuwsgi"
uncompresscmd "/usr/local/bin/unxzuwsgi"
compressext .xz
missingok
notifempty
copytruncate