Skip to content

Instantly share code, notes, and snippets.

@kylefmohr
kylefmohr / test.sh
Created December 7, 2022 07:46
CrystalDiskMark but for Linux Command Line (NOT MY SCRIPT, found here: https://unix.stackexchange.com/a/480191/516248)
#!/bin/bash
#############################################################################################################
#Changelog #
#############################################################################################################
#Added prompts for user input to configure script instead of relying on hardcoded settings.
#Added a lot of errorchecking
#The script is now optionally compatible with dash (this is the reason for there being a sed command at the end of every echo -e instance, dash liked to print the -e part when I was testing.)
#Vastly improved compatibility across distributions
#Special thanks to everyone who contributed here: https://gist.github.com/i3v/99f8ef6c757a5b8e9046b8a47f3a9d5b
#Also extra special thanks to BAGELreflex on github for this: https://gist.github.com/BAGELreflex/c04e7a25d64e989cbd9376a9134b8f6d it made a huge difference to this improved version.
@kylefmohr
kylefmohr / InstallAndUpgradeKaliWSL2.md
Last active October 12, 2022 22:02
This script will work around the issues present in Kali's Windows Subsystem for Linux version, which currently errors when you try to `apt update`, and if you get around that, errors during an `apt upgrade`. This was last tested as working on 10/12/2022

In Powershell, before you've installed Kali:

wsl --set-default-version 2
wsl --install -d kali-linux

Now create your Kali username and password. Then...

sudo su
@kylefmohr
kylefmohr / prox7.sh
Created May 3, 2022 20:49
This script will install the latest compatible version of Proxmox on top of an existing Debian 11 Bullseye installation. It also installs fail2ban and includes the fail2ban configs sourced from the official Proxmox wiki
#!/bin/bash
#This script assumes that you have a domain name with a DNS record pointed to Proxmox's public IP
echo "Enter the domain name that will resolve to this servers IP address"
read hostname
sudo apt update && sudo apt full-upgrade -y
hostnamectl set-hostname $hostname
myip=$(curl --silent ifconfig.me)
echo "127.0.0.1 localhost" > hosts
@kylefmohr
kylefmohr / install.ps1
Last active January 23, 2022 21:51
Choco Install
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
@kylefmohr
kylefmohr / code-server.sh
Last active January 5, 2025 12:35
Script to install cdr/code-server v4.19.1, point it do a domain, and install LetsEncrypt
#!/bin/bash
#Tested working on Ubuntu 20.04 and 22.04!
VERSION='4.22.1'
echo "This script will install code-server v$VERSION, enable it as a service, and expose it to the internet with a LetEncrypt Certificate."
echo ""
echo "By this point, you should already have a domain name pointed to the IP address of this server!"
read -p "Press ENTER to continue or CTRL+C to quit"
echo "Which domain name do you want to use? Including subdomain if applicable: "
read domainname
@kylefmohr
kylefmohr / prox.sh
Created June 26, 2021 01:35
Script to turn a standard Debian 10 Buster installation into a Proxmox host
#!/bin/bash
#pre-requisite: hostname must resolve to the public IP of the server!
#if you receive errors regarding being unable to configure proxmox packages, this is why!
#you can change the hostname with "hostnamectl set-hostname <new hostname>" and reboot
sudo apt update && sudo apt upgrade -y
myip=$(curl --silent ifconfig.me)
echo $myip
hosts=hosts
echo "localhost 127.0.0.1" > hosts