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
# 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 |
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
#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; |