Skip to content

Instantly share code, notes, and snippets.

@Waester
Waester / vpnstatus.php
Last active June 10, 2022 09:50
Simple PHP based OpenVPN monitor
<?php
// http://subinsb.com/convert-bytes-kb-mb-gb-php
function convertToReadableSize($size) {
$unit = 1000;
$base = log($size) / log($unit);
$suffix = array("", "KB", "MB", "GB", "TB");
$f_base = floor($base);
return round(pow($unit, $base - floor($base)), 1) . " " . $suffix[$f_base];
}
// Add OpenVPN server status logs here. Only version 2 logs supported.
@Waester
Waester / check.sh
Created December 16, 2017 21:55
VPN leak check in CLI
#!/bin/sh
echo ""
echo "##### IP #####"
dig +short myip.opendns.com @resolver1.opendns.com
echo ""
echo "##### DNS ####"
ping whoami.akamai.net -c 1
echo ""
# https://blogs.msdn.microsoft.com/santhoshonline/2011/11/24/how-to-launch-a-process-with-cpu-affinity-set/
Set-StrictMode -Version Latest
while ($true) {
Start-Sleep -Seconds 10
$ApplicationList = Import-Csv affinity.csv
$ProcessList = Get-Process
foreach ($Process in $ProcessList) {
@Waester
Waester / kmskeys10.txt
Created December 14, 2020 07:44 — forked from azhe403/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
#!/bin/bash
# https://turecki.net/content/getting-most-out-ssh-hardware-acceleration-tuning-aes-ni
# Usage: cipherbench.sh <hostname>
size=1000
for i in $(ssh -Q cipher); do
dd if=/dev/zero bs=1MB count=$size 2> /dev/null | \
ssh -c $i $1 "(time -p cat) > /dev/null" 2>&1 | \
grep real | \
In my understanding, the "tcp meltdown" problem is not difficult to solve:
you only need to set a large retransmission timeout for the inner tcp connection.
By greatly increasing the minimum retransmission timeout of the inner TCP connection,
we have effectively disabled the timeout retransmission mechanism of the inner TCP.
Therefore, the TCP meltdown problem is avoided.
For example, in linux, you can use ip route replace 192.168.168.1/24 via 192.168.168.2 rto_min 12s
to increase the minimum retransmission timeout of all internal connections established through OpenVPN
from 0.2 seconds to 12 seconds (It is assumed that 192.168.168.1/24 is your OpenVPN network segment).
set -g mouse on
set -g history-limit 100000
set -s escape-time 0
set -g default-command $SHELL
unbind -T copy-mode MouseDrag1Pane
unbind -T copy-mode MouseDragEnd1Pane
unbind -T copy-mode DoubleClick1Pane
unbind -T copy-mode TripleClick1Pane
@Waester
Waester / config.py
Last active September 1, 2024 07:27
RSS = (
{ 'url': 'https://example.com' },
{ 'url': 'https://example.com', 'regex': '^.+720p.*$' },
)
PROXIES = {
'http': 'http://example.com:8080',
'https': 'https://example.com:8443',
}
log.info("[Rise Voucher Manager] started loading")
local config = {
enable = false,
desiredVoucherUseCount = 0
}
local DlcManager = nil
local config_file = "RiseVoucherManager.json"
local _config = json.load_file(config_file)
#!/usr/bin/python3
import sys
import os
import re
args = sys.argv
layout = {
"stereo": "2",
"5.1": "6"