Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Niklas Gurkengewuerz

🎯
Focusing
View GitHub Profile
@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active Sep 16, 2021
Build and run minimal Linux / Busybox systems in Qemu
View gist:02e165a0004be33734ac2334f215380e

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@jampekka
jampekka / activity.py
Created Apr 2, 2017
/r/place activity animated heatmap
View activity.py
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats
import pyximport; pyximport.install()
from pixcount import pixcount
import scipy.ndimage
data = np.load('diffs.npy')
ts = data[:,0]
frames = 1000
@LindaLawton
LindaLawton / GoogleAuthenticationCurl.sh
Last active Sep 17, 2021
Curl bash script for getting a Google Oauth2 Access token
View GoogleAuthenticationCurl.sh
# Tutorial https://www.daimto.com/how-to-get-a-google-access-token-with-curl/
# YouTube video https://youtu.be/hBC_tVJIx5w
# Client id from Google Developer console
# Client Secret from Google Developer console
# Scope this is a space seprated list of the scopes of access you are requesting.
# Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes.
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=[Scopes]&response_type=code
# Exchange Authorization code for an access token and a refresh token.
@MartinEnders
MartinEnders / spamfilter-setup-postfix-dovecot.md
Last active Apr 26, 2017
Setup of spamfilter and sieve for postfix and dovecot
View spamfilter-setup-postfix-dovecot.md

Packetinstallation

aptitude install spamassassin razor pyzor rsyslog
aptitude install amavisd-new
aptitude install dovecot-sieve dovecot-lmtpd
aptitude install clamav clamav-daemon
# restart freshclam and clamav-daemon when error messages occour:
# [FAIL] Clamav signatures not found in /var/lib/clamav ... failed!
@benkulbertis
benkulbertis / cloudflare-update-record.sh
Last active Sep 19, 2021
Cloudflare API v4 Dynamic DNS Update in Bash
View cloudflare-update-record.sh
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
View twitch_live_url.py
import requests
import json
import re
import argparse
import random
import m3u8
USHER_API = 'http://usher.twitch.tv/api/channel/hls/{channel}.m3u8?player=twitchweb' +\
'&token={token}&sig={sig}&$allow_audio_only=true&allow_source=true' + \
'&type=any&p={random}'
@fumiyas
fumiyas / dovecot-ldap.conf.ext
Created Oct 15, 2012
Dovecot: Example config for maildir++ quota and so on
View dovecot-ldap.conf.ext
uris = ldap://a.ldap.example.jp/ ldap://b.ldap.example.jp/
ldap_version = 3
base = ou=%d,dc=example,dc=jp
scope = subtree
auth_bind = yes
pass_filter = (uid=%n)
pass_attrs = mailQuota=userdb_quota_rule=*:bytes=%$
user_filter = (uid=%n)