Skip to content

Instantly share code, notes, and snippets.

View notpushkin's full-sized avatar
🕊️

Alexander Pushkov notpushkin

🕊️
View GitHub Profile
@spaze
spaze / opera-vpn.md
Last active April 20, 2024 02:14
Opera VPN behind the curtains is just a proxy, here's how it works

2023 update

ℹ️ Please note this research is from 2016 when Opera has first added their browser "VPN", even before the "Chinese deal" was closed. They have since introduced some real VPN apps but this below is not about them.

🕵️ Some folks also like to use this article to show a proof that the Opera browser is a spyware or that Opera sells all your data to 3rd parties or something like that. This article here doesn't say anything like that.


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, also see The Oprah Proxy.

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.

// - yes, this is the entire implementation
// - no, it doesn't actually depend on preact
export class Provider {
getChildContext () {
let { children, ...context } = this.props;
return context;
}
render ({ children }) {
return children && children[0] || null
}
@bitdivine
bitdivine / decimal-number.js
Created February 26, 2016 13:03
HTML input type number with decimal precision.
(function(){
// Input field given to n decimal places. Degrades gracefully to standard numeric input.
// Usage: <input type="number" is="decimal-number" data-places="2" name="..." value="...">
try {
var proto = Object.create(HTMLInputElement.prototype);
proto.createdCallback = function() {
this.type = "number";
this.addEventListener("change", this.decimate);
this.value = parseFloat(this.value).toFixed(this.getAttribute('data-places'));
};
@CMCDragonkai
CMCDragonkai / parse_heroku_postgres_url_string.php
Created December 16, 2015 14:08
Heroku: Parsing the Database URL String for PHP
<?php
function parse_heroku_postgres_url_string($url_string) {
$parts = parse_url($url_string);
return [
'username' => $parts['user'],
'password' => $parts['pass'],
'hostname' => $parts['host'],
#!/usr/bin/sudo sh
## ruby_revealer.sh -- decrypt obfuscated GHE .rb files. 2.0.0 to 2.3.1+.
## From `strings ruby_concealer.so`:
##
## > This obfuscation is intended to discourage GitHub Enterprise customers
## > from making modifications to the VM.
##
## Well, good, as long as its not intended to discourage *me* from doing this!
@mattdesl
mattdesl / top-100-dev-dependents.txt
Last active August 23, 2020 07:30
Top 100 Dev Dependents on npmjs (as of Jul 31, 2015)
mocha 44731
chai 17944
grunt 17447
should 11882
grunt-contrib-jshint 11466
gulp 8619
istanbul 7374
tape 7313
sinon 6851
grunt-contrib-clean 6807
def correct?(users_guess,computer_number)
return computer_number == users_guess
end
@dz0ny
dz0ny / mopidy.liq
Last active May 9, 2023 12:39
Gapless streaming for mopidy
#!/usr/bin/liquidsoap
set("log.file.path", "/dev/null")
set("log.stdout", true)
set("server.telnet", false)
set("harbor.bind_addr","0.0.0.0")
# tweak these values if you have lag, skipping, buffer underrun etc
# set("frame.duration",0.04)
# set("root.max_latency",60.)
# read http://peterdowns.com/posts/first-time-with-pypi.html
# make sure to have a ~/.pypirc configured with users and passwords
# go to the package folder
# publish package to test pypi
python setup.py register -r pypitest
python setup.py sdist upload -r pypitest
# publish package to live pypi
python setup.py register -r pypi
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live