Skip to content

Instantly share code, notes, and snippets.

View kremalicious's full-sized avatar

Matthias Kretschmann kremalicious

View GitHub Profile
@kremalicious
kremalicious / nginx.conf
Created April 14, 2016 12:35
nginx config
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@kremalicious
kremalicious / tor-relay-setup.sh
Last active November 26, 2023 02:59
Set up new server as Tor relay
##
# Ubuntu 16.04 Xenial Xerus
##
######################################
# INITIAL SERVER SETUP & HARDENING
######################################
ssh [email protected]

CSS Style Guide

This is the start of a CSS style guide for ChartMogul’s web properties.

Methodology: BEM

use for all new components, refactor old components as wished

As a web project grows it’s important for any developer to quickly see what a piece of code does. Using the so called Block, Element, Modifier methodology in particular helps with that. By just looking at the classes in HTML, a developer can immediately see what a class does in CSS.

@kremalicious
kremalicious / unattended-upgrades.sh
Last active March 13, 2026 06:32
Setup Unattended Upgrades on Ubuntu server
# Install required packages
# update-notifier-common provides a mechanism for other packages to register a reboot request.
# Without update-notifier-common, automatic reboots will not work.
sudo apt install unattended-upgrades update-notifier-common
# configure it
sudo vi /etc/apt/apt.conf.d/50unattended-upgrades
# set allowed origins
Unattended-Upgrade::Allowed-Origins {
# http://stackoverflow.com/a/27850727/733677
require 'open-uri'
require 'rss'
module Jekyll
# Runs during jekyll build
class RssFeedCollector < Generator
safe true
@kremalicious
kremalicious / tor-openvpn.sh
Last active December 9, 2025 18:37
Install and configure Tor as proxy for all OpenVPN server traffic
# what we want:
# client -> OpenVPN -> Tor -> Internet
# Install & configure OpenVPN
# https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-16-04
# assumed OpenVPN configuration
# 10.8.0.1/24-Subnet
# tun0-Interface
@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){
@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 / 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 / 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)