Skip to content

Instantly share code, notes, and snippets.

View ivodvb's full-sized avatar
🛠️
Building things

Ivo van Beek ivodvb

🛠️
Building things
View GitHub Profile
@ivodvb
ivodvb / ivodvb.asc
Created October 8, 2020 10:00
GPG key
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF9+wRoBEAC7wAovrbYaOlOVCypYJPZwdtL4dWx2tvfygujoma5hUKhwF76q
IAVfLZvUJ0atVnydl9YMQz0jmjjGV4gjzwIikUS9zTki9ipVsIukpspTvrzYp1xv
xuA3YYEmlnAjB37j3EQupSozaqxuAJzTZXBMbJzhQiTOMFMIyqiNwH0kv7sXnSO2
FYBntiiXWmduI/bTTxNbEz2H0fq2VpkIP6Uc45e0jBjmCuhc/kTT8YvCRJAaPfU6
9htPI5kwgl0JV9S3bEijZ0GRRiRMfxKbWlYre8bIBPrbNZ4g9x0k0gcT5A3m/tUY
j4iWziYjbNibQFO7V3EJTFfuWhl6WwXclPPis2k3sOous2wkl5NzPzG8ggVAmCOT
rloWNQOrwn4C41HI/QcOYKql/3cBtMVV25UJKKlbYmk9yyGY5ouQN++yTF3MRpuX
NexXAJyL2LwKwyeGp5pmqtREBS00tOQKOsjelBgpvl3TjErd0y1Nmlmi0r568wAl
@ivodvb
ivodvb / keybase.md
Created August 8, 2019 11:10
keybase.md

Keybase proof

I hereby claim:

  • I am ivodvb on github.
  • I am ivodvb (https://keybase.io/ivodvb) on keybase.
  • I have a public key whose fingerprint is 1739 911F CE04 65D9 DE42 D848 970B 9C54 1729 E708

To claim this, I am signing this object:

@ivodvb
ivodvb / verify_apple_receipt.py
Last active May 31, 2018 09:29 — forked from jeiting/verify_apple_receipt.py
Verify an Apple receipt locally by decrypting it, verifying the signatures and pprinting the receipt contents
# Tested with Python 3.6
# receipt_data.bin is assumed to be a base64 encoded receipt
# pip install asn1crypto cryptography cryptography pprint
from pprint import pprint
import base64
import urllib.request
from asn1crypto.cms import ContentInfo
from OpenSSL.crypto import load_certificate, FILETYPE_ASN1, FILETYPE_PEM, X509Store, X509StoreContext, X509StoreContextError, verify
from asn1crypto.core import Any, Integer, ObjectIdentifier, OctetString, Sequence, SetOf, UTF8String, IA5String
@ivodvb
ivodvb / setup.sh
Last active May 4, 2018 07:18
Default server setup
#!/bin/bash
cat > /etc/default/locale <<EOL
LANG=en_US.UTF-8
LC_ALL=C
LANGUAGE=en_US.UTF-8EOL
cat > /etc/environment <<EOL
LC_CTYPE=UTF-8
EOL
@ivodvb
ivodvb / install.sh
Created April 22, 2018 12:03
goaccess setup (tested on Ubuntu 16.04 and Debian 7)
apt update && apt upgrade -y && \
apt install -y libncursesw5-dev libglib2.0-dev libgeoip-dev libtokyocabinet-dev build-essential && \
wget http://tar.goaccess.io/goaccess-1.2.tar.gz && \
tar -xzvf goaccess-1.2.tar.gz && \
cd goaccess-1.2/ && \
./configure --enable-utf8 --enable-geoip=legacy && \
make && \
make install && \
sed -i 's/\#time-format %H:%M:%S/time-format %H:%M:%S/g' /usr/local/etc/goaccess.conf && \
sed -i 's/\#date-format %d\/%b\/%Y/date-format %d\/%b\/%Y/g' /usr/local/etc/goaccess.conf && \
@ivodvb
ivodvb / Ubuntu_16.04.1.txt
Created September 20, 2017 09:05 — forked from mjmacleod/Ubuntu_16.04.4.txt
Build GuldenD on Ubuntu 16.04.1
sudo apt-get install libssl-dev libevent-dev build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python-dev libxml2-dev libxslt-dev libbz2-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
git clone https://github.com/Gulden/gulden-official.git
cd gulden-official/
git checkout old_autotools
sudo mkdir /boost166 && sudo chmod -R a+rwx /boost166 && wget https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2 && tar -xvf boost_1_61_0.tar.bz2 && cd boost_1_61_0/ && ./bootstrap.sh && ./b2 --prefix=/boost166 cxxflags=-fPIC cflags=-fPIC link=static install
@ivodvb
ivodvb / memcached_dump.sh
Last active September 5, 2017 15:34
Memcached key dump, use export MEMCACHED_HOST=localhost to set the host (see https://stackoverflow.com/questions/19560150/get-all-keys-set-in-memcached#comment73667943_35892919)
#!/bin/bash
echo -e "stats items\nquit" | nc $MEMCACHED_HOST 11211 | grep -oe ':[0-9]*:' | grep -oe '[0-9]*' | sort | uniq | xargs -L1 -I{} bash -c 'echo -e "stats cachedump {} 1000\nquit" | nc $MEMCACHED_HOST 11211'
@ivodvb
ivodvb / private_ip.sh
Last active August 20, 2017 13:13
Vultr private IP addr grabber on boot (assuming private IP is in key 0 or 1 during boot, not very failsafe, but it works for now)
#!/bin/bash
vultrPrivateNetworkConfiguration() {
VULTR_METADATA_LOCATION='/tmp/vultr_metadata.json'
if [ ! -f /tmp/vultr_metadata.json ]; then
curl "http://169.254.169.254/v1.json" > $VULTR_METADATA_LOCATION
else
echo "VULTR metadata already present, using it"
fi
@ivodvb
ivodvb / do-agent.sh
Last active January 26, 2017 14:51
DigitalOcean do agent vivid fix
#!/bin/sh
set -e
#
# This script is meant for quick & easy install via:
# 'curl -sSL https://do-agent.sh | sh'
# or:
# 'wget -qO- https://do-agent.sh | sh'
supported_distros="Ubuntu 14 or higher, Debian 8, or Centos 6 higher"
@ivodvb
ivodvb / github_issue_export.php
Created May 23, 2015 13:35
Github issue export to CSV (Github API V3)
<?php
#usage php github_issue_export ivodvb/repo1 ivodvb/repo2
function msg($msg) {
echo $msg . PHP_EOL;
}
function kill($msg, $success = true) {
msg($msg);