Skip to content

Instantly share code, notes, and snippets.

View loitho's full-sized avatar

loitho

View GitHub Profile
$counters = @("\Network Interface(*)\Bytes Total/sec","\Network Interface(*)\Packets/sec","\Network Interface(*)\Packets Received Discarded","\Network Interface(*)\Packets Received Errors","\Network Interface(*)\Packets Outbound Discarded","\Network Interface(*)\Packets Outbound Errors")
$timeout = new-timespan -Seconds 10
$sw = [diagnostics.stopwatch]::StartNew()
while ($sw.elapsed -lt $timeout)
{
get-counter -counter $counters | select -expand countersamples | select timestamp,path,instancename,cookedvalue | export-csv -append -notypeinformation "c:\misc\counters.txt"
start-sleep -seconds 2
}
write-host "Finished"
@loitho
loitho / server.py
Created January 20, 2020 10:26
Simple python server listener to test port
#!/usr/bin/env python2
## Run with ./program.py <port number>
import socket
import sys
HOST = '' # Symbolic name, meaning all available interfaces
PORT = int(sys.argv[1]) # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Socket created'
#Bind socket to local host and port
@loitho
loitho / SteamUpdateMods.py
Created May 3, 2019 20:21 — forked from firefly2442/SteamUpdateMods.py
AlphaSquad Arma3 Server Update via Steam Workshop
#!/usr/bin/env python
import subprocess, sys, os
STEAM_USERNAME = "steamusername"
STEAM_PASSWORD = "steampassword"
WORKSHOP_IDS = [["843425103", "@rhsafrf"],
["843593391", "@rhsgref"],
2018-10-18T13:52:00Z D! [input.vsphere]: Collecting metrics for 267 objects of type vm for vcenter3.cpte.local
2018-10-18T13:52:00Z D! [input.vsphere]: Querying 203 objects, 20495 metrics (0 remaining) of type vm for vcenter3.cpte.local. Processed objects: 258. Total objects 267
2018-10-18T13:52:02Z D! [input.vsphere]: Query returned 20397 metrics
2018-10-18T13:52:02Z D! [input.vsphere]: Query returned 845 metrics
2018-10-18T13:53:00Z D! [input.vsphere]: Collecting metrics for 8 objects of type host for vcenter3.cpte.local
2018-10-18T13:53:00Z D! [input.vsphere]: Query returned 860 metrics
2018-10-18T13:53:00Z D! [input.vsphere]: Collecting metrics for 267 objects of type vm for vcenter3.cpte.local
2018-10-18T13:53:00Z D! [input.vsphere]: Querying 208 objects, 20923 metrics (0 remaining) of type vm for vcenter3.cpte.local. Processed objects: 257. Total objects 267
2018-10-18T13:53:02Z D! [input.vsphere]: Query returned 20825 metrics
2018-10-18T13:53:02Z D! [input.vsphere]: Query returned 417 metrics