This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#TODO: test each square if it's actually a screen shot | |
import numpy as np | |
#from scipy.ndimage import gaussian_filter | |
from scipy.signal import convolve2d | |
from PIL import Image, ImageDraw | |
import matplotlib.pyplot as plt | |
import cv2 | |
import logging | |
log = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from asyncio.streams import start_server | |
import socket | |
import aiosocks | |
import logging | |
logging.basicConfig(level = logging.WARNING) | |
log = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
import time | |
import os | |
import math | |
os.chdir('/sys/class/drm/card0/device/hwmon/hwmon2/') | |
temp = 'temp1' | |
fan = 'fan1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var ProtoBuf = require("protobufjs") | |
// to and from URL-safe variant of base64 encoding | |
function base64ToUrl(s) { | |
return s.replace(/\+/g, '-').replace(/\//g, '_').replace(/\=+$/, ''); | |
} | |
function base64FromUrl(s) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
from pocket import Pocket | |
consumer_key = "123-2343-4234-32-4-3-4" | |
''' | |
redirect_uri = "http://example.com/" | |
request_token = Pocket.get_request_token(consumer_key=consumer_key, redirect_uri=redirect_uri) | |
# URL to redirect user to, to authorize your app | |
auth_url = Pocket.get_auth_url(code=request_token, redirect_uri=redirect_uri) | |
input(auth_url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.sql.*; | |
import com.google.gson.*; | |
import com.google.gson.stream.*; | |
public class ResultSetAdapter extends TypeAdapter<ResultSet> { | |
public static class NotImplemented extends RuntimeException {} | |
private static final Gson gson = new Gson(); | |
public ResultSet read(JsonReader reader) | |
throws IOException { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
BEGIN { | |
FS="|"; | |
print "create china_new hash:net" | "ipset restore" | |
} | |
$2 == "CN" && $3 == "ipv4" { | |
prefix=32; | |
while ($5 > 1) { | |
--prefix; | |
$5 = $5/2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
IFACE=venet0 | |
IFCONFIG=" | |
127.0.0.2/32 | |
192.157.208.187/32 | |
2605:f700:40:400::c248:30c1/128 | |
2605:f700:40:400::b363:5edb/128 | |
2605:f700:40:400::340f:4e34/128 |