Skip to content

Instantly share code, notes, and snippets.

@AdamQuixote
AdamQuixote / mister_backup_saves.sh
Last active December 14, 2022 15:47
Mister save backup script
# Backs up MisTer saves to an external host using SCP, as well as locally for good measure
# Create a special user on the host w/ the specific perms, and use ssh-keygen to generate a key,
# then ssh-copy-id -p <port> -i <key.pub> <user>@<host>
# don't forget to disable the password on the host after copying
# PLEASE NOTE that the mister has an insecure default password which may be re-enabled on update, so be sure to limit perms appropriately
cp -rv /media/fat/saves/* /media/fat/backups/
echo "Files copied to /media/fat/backups"
echo "Now, trying to upload to the backup host with SCP. You may need to accept the host key if this is the first run or anything has changed."
scp -rv -C -i /root/<PRIVATE_SSH_KEY> -P <PORT> /media/fat/saves/* mister@<HOST_IP>:/mnt/shared/media/mister/
@AdamQuixote
AdamQuixote / password-auth.sh
Created December 4, 2022 19:25
Linux ssh password authentication toggle script
#!/bin/bash
# make a backup copy of the sshd_config file
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
# check if the first argument is "enable" or "disable"
if [ "$1" == "enable" ]; then
# enable password authentication
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/; s/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
echo "Password authentication has been enabled"
@AdamQuixote
AdamQuixote / fgdownloader.py
Created November 30, 2022 02:45
fgdownloader
import requests
import re
import webbrowser
import datetime
now = datetime.datetime.now()
year = now.year
month = now.month
months = 12
years = 1
@AdamQuixote
AdamQuixote / serialtypist.py
Created October 12, 2022 05:33
Creates fun ransom notes
"""
Serialtypist.py - Break a string into words, generate an image using a random font for each word, and output
an image with the words in the correct order, but slightly misaligned.
Usage: serialtypist.py [options] string
Options:
-h, --help show this help message and exit
-v, --verbose print extra information
@AdamQuixote
AdamQuixote / music-archiver.py
Last active September 7, 2022 04:15
Music archiver
"""
music-archiver
This script is used to archive music albums from a source directory to a flexible number of destination directories.
"""
import os, shutil
# make a list of folders to archive from the current directory
@AdamQuixote
AdamQuixote / addfwrs.bat
Last active March 4, 2020 11:30
I found this script on a web forum, when I was looking for an easy way to add every executable in a folder to a firewall rule. This is tested for Windows 7 and Windows 8, and running the script inside a folder will automatically block outgoing Internet access for every program inside the folder. The script creates a separate rule for every progr…
@echo off
REM BATCH FILE CREATED BY CHARLES DE HAVILLAND 20/02/2012
cls
If "%1"=="" GOTO :norulename
SET RULENAME=%1
ECHO Create in/out firewall rules for all *.exe files with the rulename of "%RULENAME%" ?
ECHO.
pause
Echo.
@AdamQuixote
AdamQuixote / rep
Last active January 2, 2016 01:39
Autohotkey l33tspeak prank. Pretty simple really. Compile as an executable and run. If you're feeling really evil, make it run on startup.
#NoTrayIcon
*A::Send,4
*B::Send,|3
*C::Send,`{
*D::Send,|)
*E::Send,3
*F::Send,f
*G::Send,6
*H::Send,|-|