Skip to content

Instantly share code, notes, and snippets.

View lyda's full-sized avatar

Kevin Lyda lyda

View GitHub Profile
@jamesmacwhite
jamesmacwhite / Workarounds for Netflix and the blocking of IPv6 tunnels.md
Last active March 25, 2024 20:26
Prevent proxy/VPN streaming error messages from Netflix when using a Hurricane Electric IPv6 tunnel.

Workarounds for Netflix and the blocking of Hurricane Electric IPv6 tunnels

The dreaded "You seem to be using an unblocker or proxy." error message. Cool story bro.

This gist was essentially created out of my own rant about Netflix being hostile to IPv6 tunnel services since June 2016. You are welcome to read my opinion on the matter, this is the more technical side to the issue and how to combat it within your own network.

Since I wrote this, various GitHub users have contributed their thoughts and ideas which has been incorporated into this gist. Thank you to everyone who have contributed their own methods and implementations.

The problem

Netflix now treats IPv6 tunnel brokers (such as Hurricane Electric) as proxy servers. A while ago it became apparent to users and Netflix that somewhat by accident, IPv6 tunnel users were being served content outside of their geolocation because of the way Netflix was identifyi

@lyda
lyda / metrics.lua
Last active September 21, 2022 04:16
Prometheus node-exporter in lua for openwrt
#!/usr/bin/lua
-- Metrics web server (0.1)
-- Copyright (c) 2015 Kevin Lyda
-- Apache 2.0 License
socket = require("socket")
netsubstat = {"IcmpMsg", "Icmp", "IpExt", "Ip", "TcpExt", "Tcp", "UdpLite", "Udp"}
cpu_mode = {"user", "nice", "system", "idle", "iowait", "irq",
"softirq", "steal", "guest", "guest_nice"}
netdevsubstat = {"receive_bytes", "receive_packets", "receive_errs",
@moderation
moderation / mesos_arm.md
Last active March 21, 2016 11:25
Compile Apache Mesos 0.22 for Raspberry Pi 2

How to compile Mesos on your new Raspberry Pi 2 (which is amazing with 4 cores and 6x performance). Follows on from experiments in compiling for OS X

sudo apt-get install maven libsasl2-dev libapr1-dev libsvn-dev libcurl4-openssl-dev python-dev python-boto

export JAVA_HOME="/usr/lib/jvm/jdk-8-oracle-arm-vfp-hflt"
export PATH=$JAVA_HOME/bin:$PATH

http://likemagicappears.com/projects/raspberry-pi-cluster/mesos-on-raspbian/

@temoto
temoto / helpers_data.py
Last active March 22, 2022 05:19
Part of py-helpers. Gzip compression shortcuts. Encoding. Database helpers. Retry decorator.
def namedlist(typename, field_names):
"""Returns a new subclass of list with named fields.
>>> Point = namedlist('Point', ('x', 'y'))
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain list
33
>>> x, y = p # unpack like a regular list
import pygame, time, random, sys, copy, os
from pygame.locals import *
t2 = 0
nor = 0
pc = [[[1, 1], [1, 1]], [[1, 0], [1, 0], [1, 1]], [[0, 1], [0, 1], [1, 1]], [[1], [1], [1], [1]], [[0, 1, 1], [1, 1, 0]], [[1, 1, 0], [0, 1, 1]], [[1, 1, 1], [0, 1, 0]]]
cols = [(0, 0, 0), (100, 100, 100), (10, 100, 225), (0, 150, 220), (0, 220, 150), (60, 200, 10), (180, 210, 5), (210, 180, 10), (100, 200, 170)]
pygame.init()
pygame.display.set_mode((320, 240))
sk = pygame.display.get_surface()
f = [[1] + [0 for x in range(8)] + [1] for x in range(19)] + [[1 for x in range(10)]]
@hrldcpr
hrldcpr / tree.md
Last active April 26, 2024 08:53
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@pklaus
pklaus / StatusIcon.py
Created February 15, 2010 20:36
StatusIcon – A Simple Tray Icon Application Using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."