Skip to content

Instantly share code, notes, and snippets.

View perfecto25's full-sized avatar

mrx perfecto25

  • NYC
View GitHub Profile
@perfecto25
perfecto25 / README.md
Created December 8, 2023 17:01
RustDesk self hosted server

RustDesk self hosted Relay server (cloud)

tested on Redhat 9 using Rustdesk v 1.2.3 (installed on AWS ec2 instance t3.micro)

installs Signal + Relay server

on the cloud instance where this is installed, configure iptables

### RustDesk relay
@perfecto25
perfecto25 / dellbios.sh
Created May 23, 2023 21:42
Dell BIOS automation
#!/bin/bash
# reset firmware to optimized settings
# usage:
# ./dellbios.sh - prints current settings
# ./dellbios.sh configure - configures optimized BIOS settings (will require reboot to pick up changes)
export PATH=$PATH:/opt/dell/srvadmin/sbin/
red="\e[0;91m"
@perfecto25
perfecto25 / addition
Created October 13, 2022 19:41
Py benchmarks
from functools import reduce
import time
numbers = list(range(51000000))
def add(numbers):
total = 0
for n in numbers:
total += n
return total
@perfecto25
perfecto25 / qemu setup
Last active March 24, 2023 14:12
QEMU virtual machine manager
Make sure no other VM softrware is running (Virtualbox, etc)
create new win 10 VM on ubuntu host
0. Turn off/kill any VirtualBox process, this will interfere with QEMU
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, www.spice-space.org/download.html, this will enable full screen display
@perfecto25
perfecto25 / pyperf_diagram.py
Last active September 20, 2022 03:40
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
perfecto25 / snapshot.py
Last active September 20, 2022 03:34
iperf3 bandwidth snapshot generator
#!/opt/pyperf/venv/bin/python3
## 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
perfecto25 / conncheck.sh
Last active July 2, 2023 09:52
checks netcat and ssh connectivity to all hosts in /etc/hosts file, outputs Errors
#!/bin/bash
# Run as root
# /home/sshuttle/conncheck.sh
## replace 'sshuttle' user with any user that has global SSH access to servers
file=${1:-"/etc/hosts"}
ncat_port=22
RED='\033[1;31m'
GREEN='\033[1;32m'
NC='\033[0m' # no color
@perfecto25
perfecto25 / pipeline
Created October 7, 2021 20:54
sample Jenkins pipeline with slack notifications (slack plugin)
pipeline {
agent any
stages {
stage("Deploy Config"){
steps {
slackSend color: "#15FFE9", message: """Jenkins is deploying Config to:
@perfecto25
perfecto25 / file_integrity.yaml
Created July 21, 2021 17:53
ElastAlert Rule Examples
# 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
perfecto25 / parser.sh
Last active May 20, 2021 19:04
Bash arg parser
get_params(){
PARAMS=""
while (( "$#" )); do
case "$1" in
## RESET - boolean
-r|--reset)
RESET=true
shift