Skip to content

Instantly share code, notes, and snippets.

View SyntheticDream's full-sized avatar

Andrii Kepko SyntheticDream

  • Kyiv, Ukraine
View GitHub Profile
param ($version)
$ErrorActionPreference = "Stop"
$prev_location = $pwd
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process PowerShell -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$prev_location'; & '$PSCommandPath' $version;`"";
exit;
}
# setup done
from openpyxl import Workbook
from pathlib import Path
import csv, sys
expdir = Path(sys.argv[1])
datfile = expdir / 'Component.dat'
__datalen__ = 103
wb = Workbook()
ws = wb.active
#! /usr/bin/env python3
def round_volts(num, precision=4):
return round(to_float(num), precision) # -- too slow
# cut = precision+2
# if num[0] == '-':
# cut += 1
# return num[:cut]
from scapy.all import *
paks = rdpcap('sample.pcap')
db = {}
def check_ttl(packet):
new_ttl = packet.ttl
src = packet.src
#! /usr/local/bin/bash
if [[ -z "$1" || -z "$2" ]]; then
exit 1
fi
##### PARAMETERS #####
METRIC="$1"
URL="$2"
STATSURL="${URL}?auto"
#
CACHE_TTL="55"