Skip to content

Instantly share code, notes, and snippets.

# 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 / 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 ""
@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.