Skip to content

Instantly share code, notes, and snippets.

View darac's full-sized avatar

Paul Saunders darac

View GitHub Profile
@n-eq
n-eq / deloldtweets.py
Last active March 21, 2021 13:06 — forked from intentionally-left-nil/deloldtweets.py
Delete old tweets based on twitter archive
#!/bin/python3
# Fork of https://gist.github.com/davej/113241
# Requirements:
# - twitter API credentials (replace the correponding variables)
# - tweet.js file you get by extracting your twitter archive zip file (located in data/)
# License : Unlicense http://unlicense.org/
import tweepy
import
@squidpickles
squidpickles / README.md
Last active June 14, 2024 13:38
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.

Steps

Follow the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/ for setting up the master node. I've been using Weave Net as the network plugin; it see

@yrousse
yrousse / update_blrules.sh
Created January 30, 2016 15:21
spamhaus and dshield drop lists to shorewall blrules simple script
#!/bin/sh
echo "#From dshield.org" > /tmp/blacklist
wget -q -O - http://feeds.dshield.org/block.txt | awk '/^[0-9]/ { print "DROP", "net:"$1"/24", "all"}' >> /tmp/blacklist
echo "#From spamhaus.org" >> /tmp/blacklist
wget -q -O - http://www.spamhaus.org/drop/drop.lasso | awk '/^[0-9]/ { print "DROP", "net:"$1, "all"}' >> /tmp/blacklist
mv /tmp/blacklist /etc/shorewall/blrules
shorewall refresh &>/dev/null
[run]
branch = True
source = __YOUR_PROJECT_FOLDER__
[report]
exclude_lines =
if self.debug:
pragma: no cover
raise NotImplementedError
if __name__ == .__main__.:
@XVilka
XVilka / TrueColour.md
Last active July 9, 2024 23:28
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!

@spikegrobstein
spikegrobstein / nginx.conf
Last active September 22, 2023 04:19
nginx config for proxying requests for plex over a hostname-based virtualhost.
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
server plex-server.example.com:32400;
}
server {
listen 80;
# server names for this server.
@eguevara2012
eguevara2012 / datepicker.html
Created May 28, 2012 20:15
Datepicker template for Django-Crispy-Forms
# Template for rendering the datepicker with Django-Crispy-Forms
# datepicker.html
{% load crispy_forms_field %}
<div id="div_{{ field.auto_id }}" class="clearfix control-group{% if field.errors %} error{% endif %}">
{% if field.label %}
<label for="id_{{ field.id_for_label }}" class="control-label {% if field.field.required %}requiredField{% endif %}">
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
</label>
{% endif %}