Skip to content

Instantly share code, notes, and snippets.

View mtibben's full-sized avatar

Michael Tibben mtibben

View GitHub Profile
@mtibben
mtibben / gist:ba5f96aae45d4f9b7ca6e5114200e9af
Created August 16, 2020 06:17
poll for aws vault process
func isProcessUp(pid int) bool {
process, err := os.FindProcess(pid)
if err != nil {
return false
} else {
return process.Signal(syscall.Signal(0)) == nil
}
}
func pollAwsVaultProcessAndExitWhenGone() {
# https://github.com/nodesource/distributions/issues/33
NODE_VERSION 8.11.2
RUN set -eax \
; curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
; . /etc/lsb-release \
; export NODE_MAJOR_VERSION="$(echo ${NODE_VERSION} | cut -d . -f1)" \
; echo "deb https://deb.nodesource.com/node_$NODE_MAJOR_VERSION.x $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/nodesource.list \
; apt-get update \
; apt-get install -y nodejs=$NODE_VERSION
@mtibben
mtibben / main.go
Last active February 6, 2018 19:59
Tibbo's go workshop
package main
import (
"bytes"
"encoding/json"
"fmt"
"html"
"html/template"
"io/ioutil"
"log"
@mtibben
mtibben / bug-report.md
Last active April 30, 2018 20:52
Apple bug report 35065812: macOS High Sierra curl does not use certs in the keychain

In High Sierra, curl has switched from linking against SecureTransport, to use LibreSSL. However with this change, it seems that curl no longer recognises trusted certificates stored in the keychain.

# note that safari does not trust the site (expected)
$ open -a Safari https://self-signed.badssl.com/

# note that curl does not trust the site (expected)
$ curl https://self-signed.badssl.com
curl: (60) SSL certificate problem: self signed certificate

# trust the self-signed certificate by adding it to the keychain
git remote prune origin
git branch -r --merged origin/master \
| grep -v '>' \
| grep -v master \
| sed -E "s|^ *origin/||g"
@mtibben
mtibben / 2017-07-03T02_04_20_906Z-debug.log
Last active July 3, 2017 02:21
NPM with docker NFS volume testcase
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '--save',
1 verbose cli 'mkdirp' ]
2 info using npm@5.0.3
3 info using node@v8.1.2
4 verbose npm-session c1a2de0a777de9e3
5 silly install loadCurrentTree
My traceroute [v0.87]
Tibbo.local (0.0.0.0) Mon Feb 6 11:31:00 2017
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. my.meraki.net 0.0% 264 3.1 4.8 1.5 129.4 8.3
220.101.87.161
2. 220.101.87.161 99.6% 264 3.1 3.1 3.1 3.1 0.0
3. ???
4. ???
@mtibben
mtibben / todo.bash
Last active February 1, 2017 04:40
My super lightweight todo (based on a GTD-ish workflow)
# add to your ~/.bash_profile
export TODO_EDITOR=subl
export TODO_FILE=~/Dropbox/todo.md
alias init_todo="printf '## Next actions:\n\n## Scheduled:\n\n## Waiting on:\n\n## Projects:\n\n## Tickler:\n\n## Archive:\n\n' >> $TODO_FILE"
alias todo='$TODO_EDITOR $TODO_FILE'
alias next='sed -e '"'"'/^$/,$d'"'"' $TODO_FILE'
next

Keybase proof

I hereby claim:

  • I am mtibben on github.
  • I am tibbo (https://keybase.io/tibbo) on keybase.
  • I have a public key ASC4j6CjcUy7foS0zPVP78IQ8zsa7_wmvGCRCDJR7_XhtAo

To claim this, I am signing this object:

Translation tool

Problems with phreepio

  • Syncing with Smartling needs two commands - phreepio upload and phreepio download - which means the tool needs to do some operations twice. Leads to longer than necessary CI build times, could be more effiencent
  • Uploading overwrites files. This is problematic for a tool that needs to be shared between users and branches. Also problematic because Smartling now deletes untranslated strings if a file is overwritten, even if the string has been approved.
  • caching implementation has edge cases
  • dependency on php makes it hard to use in other projects

Feature wishlist