Skip to content

Instantly share code, notes, and snippets.

View ctberthiaume's full-sized avatar

Chris Berthiaume ctberthiaume

  • University of Washington
  • Seattle
View GitHub Profile
@ctberthiaume
ctberthiaume / packer.log-cd_files
Created September 9, 2021 00:38
packer.log successfully using cd_files
2021/09/08 17:11:02 [INFO] Packer version: 1.7.4 [go1.16.6 darwin amd64]
2021/09/08 17:11:02 [TRACE] discovering plugins in /Users/me/bin
2021/09/08 17:11:02 [TRACE] discovering plugins in /Users/me/.packer.d/plugins
2021/09/08 17:11:02 [TRACE] discovering plugins in .
2021/09/08 17:11:02 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/09/08 17:11:02 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/me/.packerconfig
2021/09/08 17:11:02 [WARN] Config file doesn't exist: /Users/me/.packerconfig
2021/09/08 17:11:02 [INFO] Setting cache directory: /Users/me/git/theproject/packer/packer_cache
2021/09/08 17:11:02 [TRACE] Starting internal plugin packer-builder-virtualbox-iso
2021/09/08 17:11:02 Starting plugin: /Users/me/bin/packer []string{"/Users/me/bin/packer", "plugin", "packer-builder-virtualbox-iso"}
@ctberthiaume
ctberthiaume / packer.log-cd_content
Created September 9, 2021 00:36
packer.log that doesn't use cd_content
2021/09/08 17:06:26 [INFO] Packer version: 1.7.4 [go1.16.6 darwin amd64]
2021/09/08 17:06:26 [TRACE] discovering plugins in /Users/me/bin
2021/09/08 17:06:26 [TRACE] discovering plugins in /Users/me/.packer.d/plugins
2021/09/08 17:06:26 [TRACE] discovering plugins in .
2021/09/08 17:06:26 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2021/09/08 17:06:26 [INFO] PACKER_CONFIG env var set; attempting to open config file: /Users/me/.packerconfig
2021/09/08 17:06:26 [WARN] Config file doesn't exist: /Users/me/.packerconfig
2021/09/08 17:06:26 [INFO] Setting cache directory: /Users/me/git/theproject/packer/packer_cache
2021/09/08 17:06:26 [TRACE] Starting internal plugin packer-builder-virtualbox-iso
2021/09/08 17:06:26 Starting plugin: /Users/me/bin/packer []string{"/Users/me/bin/packer", "plugin", "packer-builder-virtualbox-iso"}
@ctberthiaume
ctberthiaume / Python3-setup.md
Last active March 2, 2021 01:27
MacOS Python 3 setup with pyenv and poetry, no shims

Install pyenv, but don't use shims and pyenv init to prevent pyenv from intercepting common executables with its shim. e.g. if you have tox installed as a pex standalone executable, but also in a pyenv-managed virtual environment, pyenv will intercept a call to tox.

Install pyenv

Use the pyenv installer with curl https://pyenv.run | bash.

Remove any eval of pyenv init or pyenv virtualenv-init that the installer added to ~/.bash_profile. Keep or add export PATH="$HOME/.pyenv/bin:$PATH"

@ctberthiaume
ctberthiaume / md5gz
Last active October 4, 2023 00:13
Script to calculate MD5 checksums for file paths read on stdin, optionally handling .gz files
#!/bin/bash
# Script to calculate MD5 checksums for file paths read on stdin, optionally
# handling .gz files
#
# Dependencies:
# Just basic Linux/BSD programs: bash, xargs, openssl, gzip.
#
# The skeleton for the option parsing section of this script was pulled from
# https://mywiki.wooledge.org/BashFAQ/035.
die() {
@ctberthiaume
ctberthiaume / .tmux.conf
Created September 5, 2020 00:17
Tmux config
# Sane scrolling
set -g terminal-overrides 'xterm*:smcup@:rmcup@'
# Set command key as control n
set-option -g prefix C-n
@ctberthiaume
ctberthiaume / findenvobjects.R
Last active September 5, 2020 00:35
Find all object in basic RStudio search path
recursive_ls <- function(envir=NULL, use_names=FALSE) {
# Base case
if (identical(envir, emptyenv())) {
return(list())
}
if (is.null(envir)) {
envir <- parent.env(environment())
}
if (!use_names) {
objs <- ls(envir)
@ctberthiaume
ctberthiaume / trackmem.sh
Last active September 4, 2020 01:09
Create a timeseries TSV of physical memory usage by command name
#!/bin/sh
if [ $# -ne 2 ]; then
exit;
fi
search=$1
delay=$2
header=0
os=$(uname)
if [ "$os" = "Darwin" ]; then
@ctberthiaume
ctberthiaume / hello.go
Created November 17, 2017 00:13
Go hello world web server
package main
import (
"io"
"log"
"net/http"
)
// hello world, the web server
func HelloServer(w http.ResponseWriter, req *http.Request) {