Skip to content

Instantly share code, notes, and snippets.

@colby
colby / nfsn.api.sh
Created April 17, 2020 03:10 — forked from nmschulte/nfsn.api.sh
NearlyFreeSpeech.NET API request "library", in pure shell (requires sha1sum and curl)
#!/usr/bin/env sh
# Copyright (c) 2015 Nathan Schulte
# set LOGIN and API_KEY below --
# see bottom for example use, in this case, checking and updating the default DNS A RR for a domain
# 0: request URI, e.g. '/dns/example.com/listRRs'
# 1..n: parameters
make_request () {
LOGIN=''
@colby
colby / prometheus-rules.yml
Created March 28, 2020 06:37 — forked from mjf/prometheus-rules.yml
Prometheus Recoding and Alert Rules Collection
# Prometheus Recoding and Alert Rules Collection
# Copyright (C) 2017 Matous Jan Fialka, <http://mjf.cz/>
# Released under the terms of The MIT License
groups:
- name: node_common
interval: 30s
rules:
@colby
colby / gist:1985164959593763280c8eb3d91b4feb
Created May 19, 2016 19:59 — forked from wkrsz/gist:3d5ff7f908a180b87498
Stop Safari hanging when selecting the address bar or opening a new tab
This shit has been bugging me for too long, so I went on a hunt and found a workaround.
The Symptoms are as follows:
* Clicking the address bar results in a 1-4 second delay
* Opening links in new tabs results in a 1-4 second delay
* +T results in a 1-4 second delay
* `PressAndHold[<pid>]: IMKServer Stall detected` is present in `/var/log/system.log` at the time of the hang.
It appears to be to do with the PressAndHold helper - the thing that shows an IOS style selection of accents when you hold a key down.
The fix may have some unwanted effects, I haven't really noticed any.
@colby
colby / opera-vpn.md
Created April 24, 2016 06:25 — forked from spaze/opera-vpn.md
Opera VPN behind the curtains is just a proxy, here's how it works

When setting up (that's immediately when user enables it in settings) Opera VPN sends few API requests to https://api.surfeasy.com to obtain credentials and proxy IPs, see below.

The browser then talks to a proxy de0.opera-proxy.net (when VPN location is set to Germany), it's IP address can only be resolved from within Opera when VPN is on, it's 185.108.219.42 (or similar, see below). It's an HTTP/S proxy which requires auth.

When loading a page with Opera VPN enabled, the browser sends a lot of requests to de0.opera-proxy.net with Proxy-Authorization request header.

The Proxy-Authorization header decoded: CC68FE24C34B5B2414FB1DC116342EADA7D5C46B:9B9BE3FAE674A33D1820315F4CC94372926C8210B6AEC0B662EC7CAD611D86A3 (that's sha1(device_id):device_password, where device_id and device_password come from the POST /v2/register_device API call, please note that this decoded header is from another Opera installation and thus contains different device_id and device_password than what is shown be

# Start of entries inserted by Spybot - Search & Destroy
127.0.0.1 www.007guard.com
127.0.0.1 007guard.com
127.0.0.1 008i.com
127.0.0.1 www.008k.com
127.0.0.1 008k.com
127.0.0.1 www.00hq.com
127.0.0.1 00hq.com
127.0.0.1 010402.com
127.0.0.1 www.032439.com