Skip to content

Instantly share code, notes, and snippets.

@indigo6alpha
indigo6alpha / get-edid.py
Last active January 26, 2018 17:31 — forked from mvollrath/get-edid.py
Using xrandr CLI to write EDID from a connected monitor to stdout
#!/usr/bin/env python
import binascii
import re
import subprocess
import sys
from os.path import basename
XRANDR_BIN = 'xrandr'
@indigo6alpha
indigo6alpha / base64-decode-entered.js
Last active January 17, 2018 09:35
Decode entered Base64 string
try {
var sText = prompt("Enter base64 encoded string: ");
if(sText !== null)
{
var decodedText = atob(sText);
console.log(prompt("Base64 decoded string:", decodedText));
}
} catch(e) {
alert(e.message);
}
@indigo6alpha
indigo6alpha / base64-decode-selected.js
Created January 10, 2018 04:34
Base64 decode selected text
var SelectedText = function() {};
SelectedText.prototype.get = function() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
return text;
@indigo6alpha
indigo6alpha / check_megalinks.py
Last active March 3, 2017 08:13
Check MEGA link status
function FindProxyForURL(url, host) {
return 'PROXY 987607.biz:8080';
}
function FindProxyForURL(url, host) {
if (isPlainHostName(host) || isInNet(dnsResolve(host), "127.0.0.0", "127.0.0.255") || isInNet(dnsResolve(host), "10.0.0.0", "10.0.0.255") || isInNet(dnsResolve(host), "172.16.0.0", "172.16.255.255") || isInNet(dnsResolve(host), "192.168.0.0", "192.168.255.255") || shExpMatch(url, "https://s3-us-west-1.amazonaws.com/bn-configs/extension_ping/direct") || shExpMatch(url, "https://s3.amazonaws.com/*") || shExpMatch(url, "https://betternet-backend.herokuapp.com/*")) {
return 'DIRECT';
}
return 'PROXY 987607.biz:8080';
}