Skip to content

Instantly share code, notes, and snippets.

View starkers's full-sized avatar

David Stark starkers

  • London, UK
  • 07:35 (UTC +01:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am starkers on github.
  • I am starkers (https://keybase.io/starkers) on keybase.
  • I have a public key ASC_Ud4t4I5_0Y_89PVC3yX9Ax8Hqr5BhOHYJIVcorsC9Qo

To claim this, I am signing this object:

@starkers
starkers / wait-for
Created August 10, 2019 01:50
wait for http status code on an endpoint
#!/usr/bin/env python3
import logging
import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
import argparse
import time
import sys
#!/usr/bin/env python3
import click
import requests
from datetime import datetime, timedelta
import sys
# current_time = dt.datetime.utcnow().isoformat() + 'Z'
# expire_time = "2020-12-12T12:00:00Z"
@starkers
starkers / new-wireguard.sh
Created February 1, 2019 14:13
simple script for wireguard
#!/usr/bin/env bash
## we know generating the client private here is bad.. but its quick n easy
FILE_MAIN=/etc/wireguard/wg0.conf
function list_existing_ips(){
grep ^AllowedIPs ${FILE_MAIN} | sed 's+\/32++g' | awk '{print $3}' | sort
}
@starkers
starkers / .vimrc
Last active May 11, 2019 20:51
minimal vimrc
"""" TLDR
" I use this for when I need to do some quick hacking/testing on an instance or whatever
""""
" install with:
"""""
" curl -L https://gist.github.com/starkers/53c4cec182dd55bc42ba9b0572cfe162/raw/cdba66ede29df6be6e7cd3371ea9596d7e09d94a/.vimrc > ~/.vimrc
""""
set nocompatible
filetype off
@starkers
starkers / docker-compose.yml
Created October 24, 2018 12:46
production worthy gitlab, just snapshot the host daily..
---
version: '2'
services:
traefik:
image: traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/traefik.toml:/etc/traefik/traefik.toml:ro
@starkers
starkers / docker-compose.yml
Created October 9, 2018 15:39
sample traefik
---
version: '2'
services:
elasticsearch:
# slightly modified official image with data volume chmod fix
build:
context: ./elasticsearch_build
environment:
@starkers
starkers / starkers.zsh-theme
Last active July 22, 2018 19:05
starkers zsh theme
# heavily modified from sonicradish and other bits and bobs
#local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
#RTFM: https://www-s.acm.illinois.edu/workshops/zsh/prompt/escapes.html
setopt promptsubst
autoload -U add-zsh-hook
ROOT_ICON_COLOR=$FG[111]
@starkers
starkers / keybase.md
Created March 7, 2018 13:22
keybase.md

Keybase proof

I hereby claim:

  • I am starkers on github.
  • I am starkers (https://keybase.io/starkers) on keybase.
  • I have a public key ASDRpj6GhzbDf4L60R90iPKOTYpcvcdgeNTdvB-DuM5F4wo

To claim this, I am signing this object:

## tips on coming to "pacman" or "yaourt" from "apt" world..
#
# pacman does official standard "arch" packages..
# yaourt will do that AND anything installed from the "Arch User Repo"
#
# run pacman with sudo (I alias "pacman" -> "sudo pacman" )
# run yaourt as yourself (it installs stuff locally to your profile and uses sudo if needed)
#
# apt-get update == pacman -Sy or yaourt -Sy
# apt-get search foo == pacman -Ss foo or yaourt -Ss foo