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 / resticheat.md
Last active March 3, 2024 12:34
Restic cheatsheet

Restic backup application - commands cheatsheet

Installation & config

  1. add Retic repo
  2. yum install restic

add a Restic credential file to root

vim /root/.restic
@perfecto25
perfecto25 / restic_cron.sh
Created February 28, 2019 23:20
Restic cron script
#!/bin/bash
# Runs Restic backup on a schedule via cron, emails with status
# 1. add a cred file with your repo logins to /etc/restic/cred
# 2.
FROM="restic@$(hostname)"
EMAIL="user@company.com"
LOG="/var/log/restic.log"
RDIR="/etc/restic"
@perfecto25
perfecto25 / netcat.sh
Last active September 13, 2023 03:18
netcat Connectivity test script
#!/bin/bash
### This script reads in a file in /etc/hosts format <ip> <hostname>, then attempts to netcat to the host using provided port
### if no port is provided, it will attempt to connect via port 22
### if no file is provided, it will use /etc/hosts to read in IPs
### Usage: ./netcat.sh <port> <file>
### Example: ./netcat.sh <- this will try scanning /etc/hosts and connect to each IP via port 22
### Example: ./netcat.sh 21500 /home/user/testfile
sshuttle:
pkg.installed: []
group.present:
- gid: 2024
user.present:
- fullname: sshuttle
- uid: 2024
- gid: 2024
- allow_uid_change: True
@perfecto25
perfecto25 / sudo.py
Last active August 31, 2023 05:45
saltstack sudo module
# Custom Execution Module - SUDO ACCESS
# tested for Centos 7
import salt
import time
import os
import logging
import re
from datetime import datetime, timedelta
import subprocess
@perfecto25
perfecto25 / default.j2
Last active July 27, 2023 19:05
Python function to send email using a Jinja HTML template
<style type="text/css">
@font-face {
font-family: 'Open Sans';
font-style: normal;
font-weight: 300;
src: local('Open Sans Light'), local('OpenSans-Light'), url(http://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTa-j2U0lmluP9RWlSytm3ho.woff2) format('woff2');
unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
.body {
width: 90%;
@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 / 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 / README.md
Last active March 27, 2023 04:30
Win 10 decrap scripts

make sure to set execution policy

C:> powershell.exe -ExecutionPolicy Unrestricted -File c:\Win_10_decrap.ps1

C:&gt; powershell.exe -ExecutionPolicy Unrestricted -File c:\remove_default_apps.ps1