Skip to content

Instantly share code, notes, and snippets.

View iarp's full-sized avatar

Ian R-P iarp

  • Toronto, Ontario, Canada
View GitHub Profile
@iarp
iarp / maptimer.xml
Last active March 21, 2024 14:12
Add Guild Wars 2 Convergences to gw2taco map timer. Add the following to the end of maptimes.xml file just above </GW2MapTimer>
<Map Name="Convergence (public)" Length="180" Start="90" id="wtcon">
<Event Name="Convergence" Length="10" Color="8042C8D7"/>
<Event Name="" Length="170" Color="008AEAF4"/>
</Map>
@iarp
iarp / google crap filter.js
Created May 24, 2023 15:51
tampermonkey script that highlights geeksforgeeks, medium, and quora
// ==UserScript==
// @name Google Crap Filter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Highlight bad sites in Google search results.
// @author carcigenicate
// @match https://www.google.com/search*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@iarp
iarp / owntracks python decrypt.py
Last active November 14, 2022 13:20
OwnTracks Python decrypt function
import base64
from libnacl import crypto_secretbox_KEYBYTES as KEYLEN
from libnacl.secret import SecretBox
def decrypt_payload(payload):
key = 'abcedf'.encode('utf-8')
key = key.ljust(KEYLEN, b'\0')
ciphertext = base64.b64decode(payload)
@iarp
iarp / django-admin.py
Created July 7, 2022 01:47
django model auto register
from django.apps import apps
from django.contrib import admin
from django.contrib.admin.sites import AlreadyRegistered
app_models = apps.get_app_config("app-name-here").get_models()
for model in app_models:
try:
admin.site.register(model, admin.ModelAdmin)
except AlreadyRegistered: # pragma: no cover
pass
@iarp
iarp / userChrome.css
Created April 26, 2022 00:19
firefox Tighten up drop-down/context/popup menu spacing (8 Sep 2021)
# firefox userChrome.js changes
/*** Tighten up drop-down/context/popup menu spacing (8 Sep 2021)
toolkit.legacyUserProfileCustomizations.stylesheets = True
***/
menupopup:not(.in-menulist) > menuitem,
menupopup:not(.in-menulist) > menu {
padding-block: 2px !important;
min-height: unset !important; /* v92.0 - for padding below 4px */
}
@iarp
iarp / gitea file permision correction.sh
Last active April 27, 2022 14:38
Corrects file permission issues on gitea repos after unraid newperms accidental run
cd /mnt/user/repos/
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 755 {} \;
find objects/ -type d -exec chmod 755 {} \;
find info/ -type f -exec chmod 644 {} \;
find refs/ -type f -exec chmod 644 {} \;
find objects/ -type f -exec chmod 444 {} \;
find objects/info/ -type f -exec chmod 644 {} \;
chown -R iarp:1000 ./
chmod 644 HEAD config description
@iarp
iarp / idrac6-virtual-console.sh
Last active May 18, 2022 00:03
Connect to idrac6 virtual console in linux mint 20.3
#!/bin/bash
# {JRE_HOME}\lib\security\java.security and remove RC4 from jdk.tls.disabledAlgorithms
echo -n 'Host: '
read drachost
echo $drachost
echo -n 'Username: '
read dracuser
WIREGUARD_INTERFACE=wg1
WIREGUARD_LAN=10.253.2.0/24
MASQUERADE_INTERFACE=eth0
iptables -t nat -I POSTROUTING -o $MASQUERADE_INTERFACE -j MASQUERADE -s $WIREGUARD_LAN
iptables -N WIREGUARD_INPUT
iptables -N WIREGUARD_DROP_WG0_INPUT
iptables -A INPUT -j WIREGUARD_INPUT
#!/bin/bash
if [ $# -eq 0 ]
then
echo "Need a name for the peer"
exit 1;
fi
GEN_FILE_SAVE_LOCATION="/etc/wireguard/peer_files"
PUBLIC_IP="123.456.789.111:51820"
@iarp
iarp / copy.py
Created October 14, 2019 00:28
Mount, copy floppy, unmount. I needed to copy the contents of 100 floppies and used the following files. Insert floppy, ./copy.sh then eject when done.
import os
import shutil
floppy = '/home/linux/mounts/floppy/'
root = '/home/linux/mounts/family/Floppy_Disks/'
dirlen = len(os.listdir(floppy))
print(dirlen)
if not dirlen:
print('empty')