Skip to content

Instantly share code, notes, and snippets.

ip(){
hrline 36
# Gets external IP from opendns.com
print -P "%F{240}|%f %F{$colorInfo}=> External IP%f `dig +short myip.opendns.com @resolver1.opendns.com` %F{240}|%f"
# Get's local IP from ipconfig
print -P "%F{240}|%f %F{$colorSecondary}=> Local IP %f `ipconfig getifaddr en0` %F{240}|%f"
# make line, https://gist.github.com/nvk/5340820
@nvk
nvk / gspace.sh
Last active December 16, 2015 08:09
Compress git repos (git gc) recursively
# Compress git repos (git gc) recursively
# Use as at will, by @nvk
gspace(){
for gitdir in `find ./ -name .git`;
do
workdir=${gitdir%/*};
hrline 44; # see http://gist.github.com/nvk/5340820
echo $workdir;
git --git-dir=$gitdir --work-tree=$workdir gc --aggressive;
@nvk
nvk / ck-sms-curl
Created August 5, 2014 18:26
Coinkite's Bitcoin API: Sending Bitcoin by SMS with Curl
$ curl `./ck-helper.py /v1/new/send` -d amount=0.020 -d account=0 -d 'dest=+1-416-555-1212' -X PUT | grep next_step
"next_step": "/v1/update/5E0000E8AB-BB1C1D/auth_send?authcode=dWkRqUCaNIag1qNtnXr3qZ24lGnwRExI",
$ curl `./ck-helper.py /v1/update/5E0000E8AB-BB1C1D/auth_send` -d authcode=dWkRqUCaNIag1qNtnXr3qZ24lGnwRExI -X PUT
@nvk
nvk / coinkite-bitcoin-api-curl-quote
Last active August 29, 2015 14:04
Bitcoin Api: Get a bitcoin price quote with curl via Coinkite
$ curl `./ck-helper.py /v1/spot_quote/BTC/CAD`
{
"args": {
"amount": 1,
"from_cct": "CAD",
"to_cct": "BTC"
},
"result": {
"currency": "BTC",
"decimal": 0.00155765,

Keybase proof

I hereby claim:

  • I am nvk on github.
  • I am nvk (https://keybase.io/nvk) on keybase.
  • I have a public key whose fingerprint is D80E F5D7 4B3B 38CA C3F2 BBD6 1C9E 033C 6C65 8606

To claim this, I am signing this object:

Verifying that +nvk is my Bitcoin username. You can send me #bitcoin here: https://onename.io/nvk
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@nvk
nvk / Coinkite Payment Button JWT Token Encoding with PHP
Last active August 29, 2015 14:27
Unofficial JWT Token Encoding with PHP for Coinkite's Payment Button
#
# Coinkite's documentation https://docs.coinkite.com/api/buttons.html
#
# Unofficial code sent to use by a user:
# Here is php sample code you may post on your site to do this whole JWT thing without any libraries:
#
1000, 'c' => 'USD'); //YOUR BUTTON OVERRIDE OPTIONS
@nvk
nvk / mastodon-proof.md
Created August 10, 2018 16:32
nvk's mastodon ID proof

Signed ID:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

I'm https://bitcoinhackers.org/@nvk
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEE2A7110s7OMrD8rvWHJ4DPGxlhgYFAlttuLkACgkQHJ4DPGxl
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
4cae21e4fd64e3ffba6d3dd3bc245ff4bf130a9499fc64a045d47abff87e25df ChangeLog.md
486650befffd5a7256cf54fde0e65911d780c54c7c08ff534533e97d9aa520ff 2019-04-04T1323-v2.0.1-coldcard.dfu
f740d787e3daa5154f221aa463b0f3bdee93a8d3c1042b30733ae5a72faccfa9 2019-04-03T1450-v2.0.0-coldcard.dfu
5a7df5850f238e3ac5f5764f7af9b418e1a25e256409b55c45eec63c481fc581 2019-02-12T1409-v1.2.0-coldcard.dfu
76c7df67fa52fd915d0d4d7039c40e9333ed7100616797d9208ea7bc5e61d5cb 2018-11-26T1403-v1.1.0-coldcard.dfu
9656aa50766ab385e78baa2bc487319db882757dabd3bb1a4028b7c4529a1c6d 2018-09-11T1428-v1.0.2-coldcard.dfu
47e0655fb7a7b3509303eb1829a67543eeea7f1288cffa3e78ceb3207207304e 2018-09-05T1728-v1.0.1-coldcard.dfu