Skip to content

Instantly share code, notes, and snippets.

View Chaz6's full-sized avatar

Chris Hills Chaz6

View GitHub Profile
@oogali
oogali / gen-iface-names.sh
Created January 13, 2011 23:24
Generate interface DNS names for your rooters.
#!/bin/sh
# router name generator
# [ omachonu ogali / oogali at blip dot tv / @oogali ]
#
# README:
# 1. point at your router with a community
# 2. finesse names as needed into your DNS zones
# 3. have a cold beverage of your choosing.
#

Get a list of probes tagged with system-ipv6-works and save it on v6probes.clean:

$ ripe-atlas probes --status 1 --tag system-ipv6-works --limit 3000 > v6probes
$ cat v6probes | grep Connected > v6probes.clean

The --tag argument is part of a PR that has been merged into Magellan but that's not released yet.

Run the parse_probes.py script (you can find it within this gist) to filter probes and to consider only max 5 probes for each source ASN among those whose ASN_v4 and ASN_v6 match [1]. The script prints a list of RIPE Atlas Tools (Magellan) commands to execute in order to start measurements (you need an API key in ~/.atlas/create).

@robinsmidsrod
robinsmidsrod / sshd_autoblock
Created October 7, 2011 15:34
Temporarily block IPs that try to brute force attack sshd automatically with ipset and rsyslog
#!/usr/bin/perl
#
# Filename: /usr/local/sbin/sshd_autoblock
# Copyright: Robin Smidsrød <robin@smidsrod.no>
# License: Same as Perl 5
#
# Temporarily block IPs that try to brute force attack sshd
# automatically with ipset and rsyslog.
#
import itertools
import os
import adaptive
import holoviews.plotting.mpl
import matplotlib
import matplotlib.cm
import matplotlib.tri as mtri
import numpy as np
from matplotlib import animation
@davidbeauchamp
davidbeauchamp / emrk-reinstall-custom.sh
Created December 20, 2015 16:36
EdgeMax Recovery Kit Customized Script
#!/bin/sh
#
# emrk-reinstall: EdgeOS installer
#
# Maintainer: Daniil Baturin <daniil at baturin dot org>
#
# Copyright (C) 2013 SO3Group
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
/*
* sshpubkeys (C)2012 by Jan-Piet Mens
*/
#define FUSE_USE_VERSION 25
#include <fuse.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
@Vivelin
Vivelin / CourierNewPrime.user.css
Last active November 21, 2020 17:38
Courier -> Courier Prime
/* ==UserStyle==
@name Courier font replacement
@namespace vivelin.net
@version 1.0.2
@description Replace Courier and similar fonts with Courier Prime. Requires Courier Prime to be installed locally. Available from <https://quoteunquoteapps.com/courierprime/>.
@author Vivelin
@updateURL https://gist.githubusercontent.com/Vivelin/7b73bde9d62fb99741eab4e16de38eb6/raw/CourierNewPrime.user.css
@license unlicense
==/UserStyle== */
@Vivelin
Vivelin / ArialRoboto.user.css
Last active November 21, 2020 17:49
Arial -> Roboto
/* ==UserStyle==
@name Arial font replacement
@namespace vivelin.net
@version 1.0.4
@description Replace Arial, Helvetica and similar fonts with Roboto. Requires Roboto to be installed locally. Available from <https://github.com/google/roboto/releases>.
@author Vivelin
@updateURL https://gist.github.com/Vivelin/cd37bbcee8caa00bd8eb5383f07667d6/raw/ArialRoboto.user.css
@license unlicense
==/UserStyle== */
@taskie
taskie / genwebfonts.py
Created March 28, 2016 09:28
fontforge script to generate subsets of fonts
#!/usr/bin/env fontforge -lang=py -script
# -*- coding: utf-8 -*-
import fontforge
import sys
import os
def _select_codepoint(codepoint, selection, more=True):
more_str = 'more' if more else 'less'
if isinstance(codepoint, tuple) and len(codepoint) == 2:
@achimnol
achimnol / sqlite_backup.py
Created June 30, 2012 03:13
A simple and safe SQLite3 backup script written in Python using ctypes + sqlite3 online backup API
#! /usr/bin/env python
# Of course, the author does not guarantee safety.
# I did my best by using SQLite's online backup API.
from __future__ import print_function
import sys, ctypes
from ctypes.util import find_library
SQLITE_OK = 0
SQLITE_ERROR = 1
SQLITE_BUSY = 5