Skip to content

Instantly share code, notes, and snippets.

@gdvalle
gdvalle / netflix-skip-intro.user.js
Last active March 29, 2019 03:38
Skip intros in Netflix videos.
// ==UserScript==
// @name Netflix Skip Intro
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Automatically skip intros with Netflix.
// @author goobyndolan
// @match https://www.netflix.com/*
// @grant none
// ==/UserScript==
@gdvalle
gdvalle / list_gcp_network_blocks.py
Created June 17, 2019 16:05
List all GCP IPv4 network blocks using the cloud-netblocks TXT records.
import json
from dns.resolver import Resolver
dns_resolver = Resolver()
def _parse_netblock_includes(txt):
includes = set()
ip4_blocks = set()
@gdvalle
gdvalle / extract_cleanup.py
Created June 23, 2019 16:14
Delete extracted mkv files alongside rar parts.
#!/usr/bin/env python3
import os
import sys
assert sys.version_info[:2] >= (3, 6), "Requires Python 3.6+"
def walk_dir(directory):
for root, dirs, files in os.walk(directory):
@gdvalle
gdvalle / nginx_stub_status.lua
Created June 24, 2019 15:14
Record Prometheus metrics from nginx stub_status module using https://github.com/knyar/nginx-lua-prometheus
-- A module to export Prometheus metrics from nginx stub_status module.
local ngx = ngx
local ngx_var = ngx.var
local prometheus = prometheus
local select = select
local tonumber = tonumber
local find = string.find
local capture = ngx.location.capture
local log = ngx.log
local ERR = ngx.ERR