Skip to content

Instantly share code, notes, and snippets.

@AdamQuixote
AdamQuixote / quote.yaml
Last active April 6, 2025 12:25
Home Assistant markdown card quote of the day
# yaml - insert into home assistant configuration.yaml, then dev tab>check configuration && restart
sensor:
- platform: rest
name: Daily Quote
resource: https://zenquotes.io/api/today
method: GET
scan_interval: 86400 # Update once per day
value_template: "{{ value_json[0].q }}"
json_attributes:
- q
@AdamQuixote
AdamQuixote / rot.py
Created March 11, 2025 14:40
Simple python rotational cipher for recovery keys in the format ABCD-1234-XXXX.. (format-independent, only uses A-Z and 0-9)
import sys
import time
def get_shift(pin_char):
"""
Returns the numeric shift value for a given PIN character.
Digits are taken as their integer value.
Letters use their position in the alphabet (A=1, B=2, etc.).
"""
if pin_char.isdigit():
@AdamQuixote
AdamQuixote / 1.js
Created November 1, 2024 02:06
test
/*
* Rater: dialog interface to add, remove, or modify WikiProject banners
* Author: Evad37
* Licence: MIT / CC-BY 4.0 [https://github.com/evad37/rater/blob/master/LICENSE]
*
* Built from source code at GitHub repository [https://github.com/evad37/rater].
* All changes should be made in the repository, otherwise they will be lost.
*
* To update this script from github, you must have a local repository set up. Then
* follow the instructions at [https://github.com/evad37/rater/blob/master/README.md]
@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,|-|