Skip to content

Instantly share code, notes, and snippets.

View jsteenb2's full-sized avatar

Johnny Steenbergen jsteenb2

  • CrowdStrike
  • Thousand Oaks, CA
View GitHub Profile
@jsteenb2
jsteenb2 / distance_away_report.rb
Created August 26, 2016 04:35 — forked from matthutchinson/distance_away_report.rb
Ruby script for the find distance between two points using haversine formula
MAX_DISTANCE_AWAY_IN_KM = 100.0
RAD_PER_DEG = 0.017453293
Rmiles = 3956 # radius of the great circle in miles
Rkm = 6371 # radius in kilometers, some algorithms use 6367
Rfeet = Rmiles * 5282 # radius in feet
Rmeters = Rkm * 1000 # radius in meters
def haversine_distance( lat1, lon1, lat2, lon2 )
dlon = lon2 - lon1
@jsteenb2
jsteenb2 / golang-tls.md
Created January 11, 2018 19:41 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@jsteenb2
jsteenb2 / service_metrics_middleware.go
Last active January 31, 2019 04:12
service metrics middleware
package main
import (
"context"
"github.com/graymeta/mf2/services/data_api/metrics"
)
func main() {
var svc SVC
@jsteenb2
jsteenb2 / .gitconfig
Last active September 18, 2019 01:58
[alias]
co = checkout
cob = co cob = co -b
br = branch
ci = commit
cim = ci -m
st = status
fap = fetch --all --prune
unstage = reset HEAD --
last = log -1 HEAD
@jsteenb2
jsteenb2 / .zshrc
Last active September 23, 2019 23:54
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
# ZSH_THEME="powerlevel9k/powerlevel9k"
ZSH_THEME="agnoster"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
alias srcz='source ~/.zshrc'
alias vimz='vim ~/.zshrc'
whoseport () {
lsof -i ":$1" | grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn} LISTEN
}
@jsteenb2
jsteenb2 / macattack.sh
Last active September 13, 2019 00:19
new mac setup
#!/bin/bash
# Fix up the key repeat issues on MacOS Sierra. Need the key repeats for VIM!
defaults write NSGlobalDomain KeyRepeat -int 2
defaults write NSGlobalDomain InitialKeyRepeat -int 15
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
# Finder should show all .files
defaults write com.apple.finder AppleShowAllFiles YES
@jsteenb2
jsteenb2 / bucket_pkg.yaml
Last active January 23, 2020 20:44
bucket package yaml
apiVersion: influxdata.com/v2alpha1
kind: Bucket
metadata:
name: rucket_11
spec:
description: bucket 1 description
retentionRules:
- type: expire
everySeconds: 3600
@jsteenb2
jsteenb2 / bucket_pkg.json
Last active January 14, 2020 05:43
bucket pkg json
[
{
"apiVersion": "influxdata.com/v2alpha1",
"kind": "Bucket",
"metadata": {
"name": "rucket_11"
},
"spec": {
"description": "bucket 1 description"
}
@jsteenb2
jsteenb2 / bucket_pkg.jsonnet
Last active May 7, 2020 19:51
bucket uses jsonnet
local Label(name, desc, color) = {
apiVersion: 'influxdata.com/v2alpha1',
kind: 'Label',
metadata: {
name: name
},
spec: {
description: desc,
color: color
}