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
<?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. |
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 | |
echo "" | |
echo "##### IP #####" | |
dig +short myip.opendns.com @resolver1.opendns.com | |
echo "" | |
echo "##### DNS ####" | |
ping whoami.akamai.net -c 1 | |
echo "" |
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
# 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) { |
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
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” |
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 | |
# 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 | \ |
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
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). |
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
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 |
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
RSS = ( | |
{ 'url': 'https://example.com' }, | |
{ 'url': 'https://example.com', 'regex': '^.+720p.*$' }, | |
) | |
PROXIES = { | |
'http': 'http://example.com:8080', | |
'https': 'https://example.com:8443', | |
} |
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
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) |
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/python3 | |
import sys | |
import os | |
import re | |
args = sys.argv | |
layout = { | |
"stereo": "2", | |
"5.1": "6" |
OlderNewer