Skip to content

Instantly share code, notes, and snippets.

View xtex404's full-sized avatar
😷
Working from home

Justin M xtex404

😷
Working from home
  • 18:39 (UTC -05:00)
View GitHub Profile
@xtex404
xtex404 / renewal.sh
Created July 26, 2022 18:36
generic letsencrypt deploy renewal-hook script
#!/bin/bash
SRCDIR=/etc/letsencrypt/live/protected.site.domain.com
DSTDIR=/etc/service/ssl
SERVICE=theservice.service
###
function chksum {
sha1sum "$1" | awk '{ print $1 }' || echo ""
@xtex404
xtex404 / bs_favorites_playlist.py
Created April 20, 2022 23:53
garbage python script that creates playlist files from my beatsaber favorites, previous full combos, and previously finished songs. don't use this.
#!venv/Scripts/python
#
# super janky quickly thrown together python script that'll create playlists from beatsaber favorites. it'll also
# create playlists from songs i've passed before and got fullcombos on.
#
# it also creates text files of the bsr request keys for the songs, so I can use them as source lists for my streamer.bot
# that fills my request queue if i need some suggestions. whatever.
#
# this code is terrible. it's not optimized. you shouldn't use it. one day i'll rewrite this to not suck, but i'm lazy
@xtex404
xtex404 / xsplit-date-timestamp-simple.js
Last active August 3, 2020 04:50
XSplit Text Script - simplified clock with date and time
/* a short xsplit custom text script that will provide a simple time/date display,
in YYYY-MM-DD HH:MM:SS ZZZZ format... you can use different locales if you want
it to display the time/date differently.
this is pretty much my first time attempting to write anything in javascript since 1998, so... be gentle. :)
v1.0.0 - 2020-08-03 - https://gist.github.com/xtex404/de5e35cddc4edce582e03f9de28f97ad
*/
/**
@xtex404
xtex404 / bad_word_list.py
Last active July 26, 2020 19:57
python list of bad/banned words - NSFW obviously
# python list of words that should be blocked from captcha/automated systems or content systems
#
# this could be better; your code should handle underscores and dashes better and not have them in this list
badlist = ('2g1c', '2girls1cup', '4r5e', '5h1t', '5hit', 'a2m', 'a55hole', 'a_s_s', 'acrotomophilia', 'aeolus', 'ahole',
'alabamahotpocket', 'alaskanpipeline', 'anal', 'analimpaler', 'analleakage', 'analprobe', 'anilingus', 'anus',
'apeshit', 'ar5e', 'areola', 'areole', 'arian', 'arrse', 'arse', 'arsehole', 'aryan', 'ass', 'ass-fucker', 'ass-hat',
'ass-jabber', 'ass-pirate', 'assbag', 'assbandit', 'assbang', 'assbanged', 'assbanger', 'assbangs', 'assbite',
'assclown', 'asscock', 'asscracker', 'asses', 'assface', 'assfaces', 'assfuck', 'assfucker', 'assfukka', 'assgoblin',
'assh0le', 'asshat', 'asshead', 'assho1e', 'asshole', 'assholes', 'asshopper', 'assjacker', 'asslick', 'asslicker',
@xtex404
xtex404 / etckeeper.cron
Last active September 6, 2019 20:47
cron script to scan for and auto-commit all on-disk etckeeper repo; make sure updatedb is installed and run daily. put in /etc/cron.hourly.d .. and remember to null out /etc/cron.daily.d/etckeeper
#!/bin/bash
##
## etckeeper hourly snapshot cron script
## justin matlock (https://github.com/xtex404/)
## 2015-02-15, updated 2019-09-06
##
## this script will use mlocate's database to find all .etckeeper directories
## on your server, then check to see if it should perform an etckeeper commit
## automatically. it will also run the gc/prune process on each etckeeper git
@xtex404
xtex404 / python-virtualenv.zsh
Last active August 5, 2018 20:13
zsh script to auto activate python virtual environments created by python2 virtualenv, virtualenvwrapper, and python3 venv
#
# this script checks for a .venv file or directory in your project path/root, and
# activates it automatically.. and deactivates it when you leave the path
#
# this may not work for you. it works for me.
#
# based on the virtualenvwrapper plugin from oh-my-zsh
#
function python_virtualenv_activate {
@xtex404
xtex404 / gist:80a384cb64cb2d53e6d682279427a746
Last active July 9, 2017 00:15 — forked from mnordhoff/gist:2213179
Python regular expressions for IPv4 and IPv6 addresses and URI-references, based on RFC 3986's ABNF.The URI-reference regular expression includes IPv6 address zone ID support (RFC 6874).
# Python regular expressions for IPv4 and IPv6 addresses and URI-references,
# based on RFC 3986's ABNF.
#
# ipv4_address and ipv6_address are self-explanatory.
# ipv6_addrz requires a zone ID (RFC 6874) follow the IPv6 address.
# ipv6_address_or_addrz allows an IPv6 address with optional zone ID.
# uri_reference is what you think of as a URI. (It uses ipv6_address_or_addrz.)
import re
@xtex404
xtex404 / gist:e4b70ec53c88a38d9f15
Last active June 3, 2016 06:18
randomize_mac_address.sh
#!/bin/sh
#
# randomize the WAN mac address on a DD-WRT based router, save it to nvram
# then restart. this was a bit of a challenge since $RANDOM doesn't exist,
# and none of the standard GNU random utilities are installed by default.
#
# this isn't bash. it's like going back to 1978. ;)
#
# i'm sure this could be written to be more efficient. not really a huge
@xtex404
xtex404 / ssh-config
Last active March 24, 2023 15:28
SSH configuration snippet for github via SSH
#
# SSH configuration snippet to enable SSH tunneling to github.com via
# port 443. Turns off all unnecessary SSH protocols extensions that slow
# things down or break things. In order to prevent SSH key leakage (which
# isn't dangerous, since it's just your public key, but it's still better
# if it didn't leave the network), this configuration will only use the
# SSH key specified on the "Identity" line.
#
# To use this gist: modify the "Identity" line to point to your SSH
# private key. In order to keep ssh from making git very angry, you should
// Photoshop Script to Create Mac OS X Icons from 1024x1024+ PSD Document
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete permanently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected folder is empty!
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com
// Modified for hires Mac OS X icons Copyright (c) 2014 by Justin Matlock http://jdmatlock.com/