Skip to content

Instantly share code, notes, and snippets.

View Menci's full-sized avatar
💖
qwq

Menci Menci

💖
qwq
View GitHub Profile
@Menci
Menci / wg_keep_alive.sh
Last active February 20, 2023 06:44
wg_keep_alive, A bash script to workaround NAT bugs
# When there's a upstream NAT bug, WireGuard will never succeed senting packets
# and will never receive any packets then. Detect sent increase while receive not change
# Change a random port for it.
function wg_keep_alive() {
# Wait init
sleep 10
# Configuration
CHECK_INTERVAL=3
MAX_FAILED_CHECKS=3
@Menci
Menci / lowest-world-connect.c
Created February 3, 2021 13:58
The algorithm of Arcaea's lowest.world/connect
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <openssl/md5.h>
int main() {
time_t time_val = time(NULL);
struct tm *t = gmtime(&time_val);
size_t year = t->tm_year + 1900;