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 -u | |
WGIF="winnie" | |
STEP=3600 | |
PSTART=5500 | |
PEND=5999 | |
CONFFILE="/etc/wireguard/$WGIF.conf" | |
PLEN=$((PEND-PSTART+1)) |
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/env python3 | |
# filter disinct connections by 4-tuples from tcpdump output | |
pairs = set() | |
while (line := input()): | |
time, family, orig, _, dest, remaining = line.split(maxsplit=5) | |
dest = dest[:-1] | |
if (orig, dest) not in pairs: | |
print(f"{orig} > {dest}, {time}, {remaining}") | |
pairs.add((orig, dest)) |
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
# -*- coding: utf8 -*- | |
# To be deployed to Tecent SCF | |
# https://console.cloud.tencent.com/scf/ | |
import json | |
def main_handler(event, context): | |
srcip = event['requestContext']['sourceIp'] | |
dest_url = "https://water-meter.bamboo.workers.dev/callback?ip=" + srcip | |
resp = { | |
"isBase64Encoded": False, |
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/bash | |
# Maintainer: Gowe Wang<i@gowe.wang> | |
# Reference: https://tools.ietf.org/html/rfc5280#section-4.2.2.1 | |
# Notice: Just available in most cases. | |
curl -s $(openssl x509 -in $1 -noout -text | grep -Po "((?<=CA Issuers - URI:)http://.*)$") | openssl x509 -inform DER -outform PEM |
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
# Maintained by: Hung-I WANG <whygowe@gmail.com> | |
~version: "2.1" | |
# e.g. `/1234`, `/1234/zh-tw` | |
?path: /\d+/(\w+/)? | |
# # The Telegram IV parser treats the webpage incorrectly, which results in mal-structured HTML/XML. Here try to fix it by rewrapping <meta> into <head> and moving them to the front of <body>. | |
# @prepend("<head>"): /html | |
# @prepend_to($@): //meta |
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 | |
# The script is simply adapted from: | |
# https://codeinsecurity.wordpress.com/2020/03/08/setting-a-custom-https-certificate-in-tomato-or-advancedtomato/ | |
# The script is expected to work with uacme with a hook script: | |
# https://gist.github.com/Gowee/e756f925cfcbd5ab32d564ee3c795786 | |
set -eu | |
FQDN="foobar.example.org" # TO BE FILLED | |
UACME_HOOK=/path/to/uacme-hook.sh # TO BE FILLED |
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 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); |
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
async function run() { | |
const contest = 169; | |
const pages = [...Array(25).keys()].map(v => v + 1); | |
const question_id = 1429; | |
const is_cheating = function(code) { | |
const words = [/*"MONEY", "POINT",*/ "HOPE", "SATURN", "SEIS", "GEMINI", "ELM", "YOUVE", "PLANETS", "PEOPLE", "EHGEEE", "CANCER", "FBCDE", "TWENTY", "TREES", "EUROPE", "ABCDE", "NOVENTA", "EAII", "FUNNY", "ADICG", "FALSE", "TRUE", "EEIE", "THREE", "DHCF", "DHBADI", "INDEED"]; | |
let score = 0; | |
for (const word of words) { | |
if (code.indexOf(word) != -1) { | |
score += 1; |
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/dev python3 | |
# -*- coding: utf-8 -*- | |
import requests | |
import json | |
from ics import Calendar, Event | |
import arrow | |
from uuid import uuid4 | |
# Below are your credentials for log-in. |
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/env python3 | |
import asyncio | |
import aiohttp | |
import re | |
import sys | |
import time | |
from collections import namedtuple | |
from functools import wraps | |