Skip to content

Instantly share code, notes, and snippets.

View nilskp's full-sized avatar

Nils Kilden-Pedersen nilskp

  • Bulletproof Consulting
  • Chicago, IL
  • X @nilskp
View GitHub Profile
@nilskp
nilskp / btc_format.coffee
Last active December 11, 2021 19:24
BTC / Sats numeric formatter
DefaultConfig =
symSpace: '\u2009'
satSym: '\u4e30'
btcSym: '\u20bf'
sepDec: '.'
sep1000: ','
btcFormat = (config = DefaultConfig) -> (btc) ->
satFormat(config)(Math.round btc * 100000000)
@nilskp
nilskp / fix.sh
Created December 21, 2019 15:16
Fix permissions for VirtualBox shared folders for Linux guest on Windows host
sudo usermod -a -G vboxsf `whoami`
sudo chown -R `whoami`:users /media/
set bell-style none
@nilskp
nilskp / .bashrc
Created May 5, 2017 18:05
Git branch prompt
#!/bin/bash
source ~/.git-prompt.sh
export PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]$(__git_ps1 " (%s)")\n\$ '
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see repository status in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).
@nilskp
nilskp / certbot-renew.sh
Created May 4, 2017 21:38
Let's Encrypt to JVM
# Refs:
# - https://certbot.eff.org/#ubuntuother-other
# - https://maximilian-boehm.com/hp2121/Create-a-Java-Keystore-JKS-from-Let-s-Encrypt-Certificates.htm
# - https://www.openssl.org/docs/man1.1.0/apps/openssl.html#Pass-Phrase-Options
CERTBOT_PATH=...
CERT_PATH=...
APP_NAME=...
JKS_PASSWORD=...
@nilskp
nilskp / run-jar.sh
Created May 4, 2017 21:28
Run .jar file, with dependencies.
$JAR=...
$CP=...
MAIN_CLASS=`unzip -p $JAR META-INF/MANIFEST.MF | grep -o -P "^Main-Class: \K([$\.\w]+)"`
java -cp $JAR:$CP $MAIN_CLASS

Keybase proof

I hereby claim:

  • I am nilskp on github.
  • I am nilskp (https://keybase.io/nilskp) on keybase.
  • I have a public key whose fingerprint is 0589 EEF2 A360 E076 027E 1B37 DD5E A588 221C 7984

To claim this, I am signing this object: