Skip to content

Instantly share code, notes, and snippets.


mrx perfecto25

  • NYC
View GitHub Profile
View addition
from functools import reduce
import time
numbers = list(range(51000000))
def add(numbers):
total = 0
for n in numbers:
total += n
return total
perfecto25 / qemu setup
Last active Oct 5, 2022
QEMU virtual machine manager
View qemu setup
Make sure no other VM softrware is running (Virtualbox, etc)
create new win 10 VM on ubuntu host
1. create pool
2. create volume within the pool
3. install win10 iso (select Browse local files)
4. once win10 is up, install Spice windows guest tools on win10,, this will enable full screen display
5. install openssh server on win guest, Settings > Apps > optional features, install new feature (openssh server) - open up port 22 on win defender
perfecto25 /
Last active Sep 20, 2022
Iperf chart generator (Salt Runner)
### PyPerf Diagram Generator
## Salt Runner,
## gets bandwidth results from each minion and generates a diagram
import ast
import pygraphviz as pgv
import logging
import time
from dictor import dictor
import salt.client
perfecto25 /
Last active Sep 20, 2022
iperf3 bandwidth snapshot generator
## This runs on each agent, generates bandwidth snapshot
from datetime import datetime
import socket
import json
import os
import sys
import iperf3
from dictor import dictor
perfecto25 /
Last active Nov 3, 2021
checks netcat and ssh connectivity to all hosts in /etc/hosts file, outputs Errors
# Run as root
# /home/sshuttle/
## replace 'sshuttle' user with any user that has global SSH access to servers
NC='\033[0m' # no color
perfecto25 / pipeline
Created Oct 7, 2021
sample Jenkins pipeline with slack notifications (slack plugin)
View pipeline
pipeline {
agent any
stages {
stage("Deploy Config"){
steps {
slackSend color: "#15FFE9", message: """Jenkins is deploying Config to:
perfecto25 / file_integrity.yaml
Created Jul 21, 2021
ElastAlert Rule Examples
View file_integrity.yaml
# alerts if system file is changed or modified
name: File Integrity Changed
# Alert on x events in y seconds
type: frequency
# Alert when this many documents matching the query occur within a timeframe
num_events: 1
perfecto25 /
Last active May 20, 2021
Bash arg parser
while (( "$#" )); do
case "$1" in
## RESET - boolean
perfecto25 /
Last active Apr 23, 2021
Bash examples - shows use of key=val parameter passing, error checking, functions, etc
#set -x
# source common function and variables
source "$(readlink -f $0 | xargs dirname)/shared"
REPO_DIR="${HOME}/NewDeploy/Repositories/Config_$(date +%Y%m%d%H%M%S)"
# check if another instance of this deployment is in progress
check_another_instance $(basename -- "$0")
View init.sls
pkg.installed: []
- gid: 2024
- fullname: sshuttle
- uid: 2024
- gid: 2024
- allow_uid_change: True