Skip to content

Instantly share code, notes, and snippets.

View kremalicious's full-sized avatar

Matthias Kretschmann kremalicious

View GitHub Profile
did:3:bafyreigzkidaif5xqbvl2l5mxzsy53scja2oiyw4a5c6rengi4fxrnkdzm
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreihz4ydxfeys45tvtxxnjcl3miwqfy767nprq3mn2gj4okupka64bi ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@kremalicious
kremalicious / gatsby-s3-deployment.sh
Created February 26, 2020 22:32
Deploying a Gatsby.js site to S3 with correct caching headers
#!/usr/bin/env bash
#
# required environment variables:
# AWS_ACCESS_KEY_ID
# AWS_SECRET_ACCESS_KEY
# AWS_DEFAULT_REGION
AWS_S3_BUCKET="bucket-name"
function s3sync {
@kremalicious
kremalicious / sshkey.sh
Created September 27, 2017 18:40
Add local public ssh key to server
cat ~/.ssh/id_rsa.pub | ssh user@hostname -i ~/.ssh/key.key 'cat >> .ssh/authorized_keys'
@kremalicious
kremalicious / openvpn-server.sh
Last active August 20, 2019 15:38
Hardened OpenVPN server on Ubuntu including client configuration script
#
# Hardened OpenVPN server on Ubuntu 16.04
# repeatable config generation script at end
#
# TOC
# ----
# 1. SERVER
# 2. NETWORKING
# 3. CLIENTS
# 3.1. REPEAT FOR EACH CLIENT
@kremalicious
kremalicious / tor-hidden-service-host.sh
Last active October 31, 2023 20:48
Install and run Tor hidden service on pretty much anything
##
# for Ubuntu 16.04 Xenial Xerus
##
######################################
# INITIAL SERVER SETUP & HARDENING
######################################
# most VPS providers give you root user from the start
ssh root@1.2.3.4
@kremalicious
kremalicious / coinsbank-wallets.js
Last active June 11, 2017 21:51
Get wallets in CoinsBank with Node.js
const crypto = require('crypto')
const fetch = require('node-fetch')
const key = process.env.COINSBANK_API_KEY
const secret = process.env.COINSBANK_API_SECRET
const type = 'GET'
const method = 'wallet'
// Create signature
const hmac = crypto.createHmac('sha512', secret)
@kremalicious
kremalicious / create-gpg-key.sh
Created May 20, 2017 22:19
Create & publish new GPG key incl. revocation certs
# Generate key pair and revocation certificate.
gpg --gen-key
gpg --output revoke.asc --gen-revoke <key-id>
# Export ASCII copy of the public key
gpg --export --armor <key-id> > pubkey.asc
# Publish the public key
gpg --send-keys <key-id>
@kremalicious
kremalicious / gpg2-macos.md
Last active August 18, 2019 18:23
gpg 2.1 on macOS with keychain integration

Super simple installation, none of that manual gpg-agent starting and setting sockets anymore.

Just install with Homebrew:

brew install gpg pinentry-mac

and add this to ~/.gnupg/gpg-agent.conf:

@kremalicious
kremalicious / 3scale-username.js
Last active May 11, 2017 12:00
Removes the need for username input upon signup for 3scale-based developer portals
// Tactic: highjack form submission, then make value of username field the same as email field, then submit the form
document.addEventListener('DOMContentLoaded', function() {
// First, hide the whole username form row
var style = document.createElement('style'),
css = '#signup_form fieldset:nth-of-type(2) .form-group:nth-child(2) { display: none; }';
style.type = 'text/css';
if (style.styleSheet){