Skip to content

Instantly share code, notes, and snippets.


Hung-I Wang Gowee

View GitHub Profile
Gowee /
Last active Oct 11, 2020
// import com.coloros.mcssdk.c.a;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
//import org.json.JSONObject;
public class Main {
public static void main(String[] args) throws Exception {
System.out.println("Hello world!");
String key1 = key.substring(16, 32);
View leetcode-contest-cheating-filter.js
async function run() {
const contest = 169;
const pages = [...Array(25).keys()].map(v => v + 1);
const question_id = 1429;
const is_cheating = function(code) {
let score = 0;
for (const word of words) {
if (code.indexOf(word) != -1) {
score += 1;
Gowee / cfapi-ddns-worker.js
Last active Sep 27, 2021
A DDNS-friendly wrapper/proxy for Cloudflare API with fine-grained permission control, deployed on Cloudflare Workers
View cfapi-ddns-worker.js
// CloudFlare API token
// for zone: (Edit)
// Currently, there seems not to be a way to get zone ids with tokens. So hardcode it here.
// Trailing dots CANNOT BE OMITTED.
const ZONES = {
"": {
Gowee /
Created Sep 25, 2019
A python script to validate HTTP proxies with aiohttp, a side project of
#!/usr/bin/env python3
import asyncio
import aiohttp
import re
import sys
import time
from collections import namedtuple
from functools import wraps
Gowee / WSExport-zh.js
Created Aug 22, 2019
適用于中文維基文庫的 WSExport 小工具(以 common.js 導入)
View WSExport-zh.js
// WSExport [[mul:Wikisource:WSexport]]
// > WSexport is a tool for exporting Wikisource's texts in EPUB, PDF and other file formats. It was created by user Tpt for French Wikisource, but it's also available for the other Wikisource subdomains.
// Copied from
// and modified slightly to adapt to Chinese WikiSource by Gowee@Github.
if ($.inArray(mw.config.get('wgNamespaceNumber'), [0, 114]) !== -1) {
$(function() {
mw.util.addPortletLink('p-electronpdfservice-sidebar-portlet-heading', '//' + $.param({
lang: 'zh',
format: 'epub-3',
page: mw.config.get('wgPageName')
Gowee /
Last active Jul 26, 2019
tinc split-tunnel with ipset

left emtpy

Gowee /
Created Mar 1, 2019
Get video links from
#!/usr/bin/env python3
from time import sleep
from collections import namedtuple
import json, re, os, csv
from urllib.parse import parse_qsl, urljoin, urlparse, urlencode
from requests import Session
from requests.cookies import create_cookie
parse_qs = lambda *args, **kwargs: dict(parse_qsl(*args, **kwargs))
Info = namedtuple("CourseInfo", ["name", "teacher"])
Gowee / relayd.patch
Created Jan 19, 2019
openwrt /etc/init.d/relayd
View relayd.patch
> . $IPKG_INSTROOT/lib/functions/
> local dhcp_ipaddr
> config_get proto "$net" proto
> [ "$proto" = "dhcp" ] && {
> local addrs
> network_get_ipaddr addrs "$net"
Gowee /
Created Dec 24, 2018
"Reborn" in groups on Telegram (
#!/usr/bin/env python3
import sys
import json
from functools import partial
from pyrogram import Client, Error
from pyrogram.client.types.user_and_chats.dialog import Dialog
from import Chat
from pyrogram.api.functions.channels import InviteToChannel
eprint = partial(print, file=sys.stderr)
Gowee /
Last active Sep 20, 2018
To help detect being added into unknown groups on Telegram.

A script to help detect being added to new groups on Telegram. When detected, logs are sent to Saved Message with a corresponding tag to facilitate locating.


Setup Pyrogram (MTProto) at first:

chmod +x