Skip to content

Instantly share code, notes, and snippets.

View tresni's full-sized avatar

Brian Hartvigsen tresni

View GitHub Profile
@tresni
tresni / gist:bff44200a3afec4d3696724b1d22d636
Last active August 6, 2026 16:16
So you are leaving your company...

🎉 Congratulations on the next chapter 🎉

Leaving a company is a massive milestone. Whether it was a personal choice, a mutual decision, or a sudden layoff, the decision has been made and it is time to look at the next chapter in your life. Starting that new chapter always deserves acknowledgement and support.

In this gist you'll find resources that people have found useful to know about when transitioning companies.

Stock and Equity

Most companies give you a limited time to exercise your options after you leave the company (usually somewhere in the 90 day range.)

@tresni
tresni / maximal.zsh-theme
Created September 12, 2020 21:07
My custom ZSH theme, hacked up minimal theme.
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$reset_color%}%{$fg[white]%}["
ZSH_THEME_GIT_PROMPT_SUFFIX="]%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}●%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_CLEAN=""
ZSH_THEME_SCM_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_SCM_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_SVN_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
ZSH_THEME_SVN_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
ZSH_THEME_SVN_PROMPT_DIRTY=$ZSH_THEME_GIT_PROMPT_DIRTY
ZSH_THEME_SVN_PROMPT_CLEAN=$ZSH_THEME_GIT_PROMPT_CLEAN
@tresni
tresni / README.md
Created September 8, 2020 17:49
Enabling Yubikey for sudo on OSX

Intro

Primarily, I use TouchID for sudo authentication on OSX, but I also tend to be connected to a CalDigit TS3 Plus dock and external monitors with my laptop lid closed. TouchID does not work in that situation.

In my quest to have another solution I found the instructions from Yubikey[1][2]. Unfortunately, the instructions are not well laid out, with formatting issues and some necessary information just missing. I hope to rectify that with this document.

Prerequisites

This has been tested on MacOS 10.14.6 and should work on MacOS 10.15. This README assumes you are using Homebrew; it should be possible to configure everything w

@tresni
tresni / add_route.sh
Last active April 27, 2020 22:32
openconnect utilities
#! /bin/bash
INTERFACE=$(route -n get wwwin.cisco.com | awk ' /interface: / { print $2 } ')
DEFAULT=$(route -n get default | awk ' /interface: / { print $2 } ')
add_route () {
sudo route add -net $1 $2
}
if [ $DEFAULT != $INTERFACE ]; then
@tresni
tresni / 1.Start.gcode
Last active April 21, 2020 02:21
Ender 3 Startup Code
; Ender 3 Custom Start G-code
M117 Heating bed...
M190 S{material_bed_temperature_layer_0} ; Want bed hot before level
M117 Reset extruder
G92 E0 ; Reset Extruder
M117 Homing all...
G28 ; Home all axes
;M117 Homing Z Probe...
#!/bin/sh
reset_host() {
all="$1 $(dig +short $1) $(dig +short aaaa $1)"
for ident in $all
do
ssh-keygen -f ~/.ssh/known_hosts -R $ident
ssh-keyscan $ident >>~/.ssh/known_hosts
done
#! /bin/bash
GIT_REPO=${GIT_REPO:-git@github.com:tresni/dotfiles.git}
DOTFILES_PATH=${DOTFILES_PATH:-$HOME/.dotfiles}
git clone --bare "${GIT_REPO}" "${DOTFILES_PATH}"
function dotfiles {
/usr/bin/git --git-dir="${DOTFILES_PATH}" --work-tree="$HOME" $@
}
mkdir -p "${DOTFILES_PATH}-backup"
@tresni
tresni / csd-wrapper.sh
Created September 14, 2017 23:56 — forked from l0ki000/csd-wrapper.sh
Cisco Anyconnect CSD wrapper for OpenConnect (exhanced to autodownload and autoupdate hostscan)
#!/bin/bash
# Cisco Anyconnect CSD wrapper for OpenConnect
# Enter your vpn host here
if [[ -z ${CSD_HOSTNAME} ]]
then
echo "Define CSD_HOSTNAME with vpn-host in script text. Exiting."
exit 1
fi
import re
import os
import sys
for root, dirs, files in os.walk("."):
for f in files:
if f == "README.md" or f == "test.py":
continue
if f.startswith("."):
continue
@tresni
tresni / superspark.rb
Created May 19, 2015 22:35
Personal superspark Formula
class Superspark < Formula
homepage "https://github.com/tresni/superspark"
head "https://github.com/tresni/superspark.git"
sha256 ""
def install
bin.install "superspark"
end
test do