Skip to content

Instantly share code, notes, and snippets.

View jsteenb2's full-sized avatar

Johnny Steenbergen jsteenb2

  • CrowdStrike
  • USA
View GitHub Profile
@jsteenb2
jsteenb2 / shrink.sh
Created February 16, 2020 04:49
shell script to run ffmpeg on screencast vids macos
shrink () {
FILE=$(basename -- "$1")
local mp4="${FILE%%.*}.mp4"
docker run -v $HOME/Desktop:/import jrottenberg/ffmpeg:3.3-alpine -i /import/$FILE /import/mp4ed/$mp4
}
@jsteenb2
jsteenb2 / rate.flux
Created February 12, 2020 20:14
reusable rate func for flux
v1Measurement = (tables=<-, measurement) =>
tables
|> filter(fn: (r) => r._measurement == measurement)
v1Fields = (tables=<-, fields=[]) =>
if length(arr: fields) == 0 then
tables
else
@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
}
@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.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 / 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
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 / .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/*)
@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 / 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