Skip to content

Instantly share code, notes, and snippets.

View xunil154's full-sized avatar

Chris Campbell xunil154

View GitHub Profile
@xunil154
xunil154 / thingiverse_download.py
Created February 24, 2022 17:30
Thingiverse direct download (AD Block Bypass)
#!/usr/bin/env python3
"""
====== DESCRIPTION ========
Early Feburary 2022 Thingiverse requires ad-blockers to be disabled to
download their files.
This is very very annoying so I wrote this script to pull them directly
Side note: I am blocking ads a network level, so even "Disabling" my local
ad-blocker still causes their checks to fail.
@xunil154
xunil154 / ArchLinux_ZFS_LUKS_Setup.sh
Created August 20, 2019 19:10
ArchLinux install script with ZFS as the root, all sitting on LUKS encryption, using systemd-boot for UEFI (ArchLinux with ZFS Root on LUKS with UEFI)
#!/bin/sh
SWAPSIZE=3 # IN GB
SYSTEM_NAME=aerozine # Hostname and used in ZFS structure (zroot/sys/${SYSTEM_NAME}/ROOT/default)
USER=xunil # Initial admin user for the system
# Archlinux on ZFS Root on LUKS setup script (v1.0)
#
# USAGE: ./ArchLinux_ZFS_LUKS_Setup.sh /dev/sda
#
@xunil154
xunil154 / ip2int.txt
Created November 21, 2018 06:50
Excel IP to Integer formula: Assumes I2 is the IP address
=BITLSHIFT(INT(MID($I2,1,FIND(".",$I2,1)-1)),24)+BITLSHIFT(INT(MID($I2,FIND(".",$I2)+1,FIND(".",$I2,FIND(".",$I2)+1)-FIND(".",$I2)-1)),16)+BITLSHIFT(INT(MID($I2,FIND(".",$I2,FIND(".",$I2)+1)+1,FIND(".",$I2,FIND(".",$I2,FIND(".",$I2)+1)+1)-FIND(".",$I2,FIND(".",$I2)+1)-1)),8)+INT(MID($I2,FIND(".",$I2,FIND(".",$I2,FIND(".",$I2)+1)+1)+1,LEN($I2)-FIND(".",$I2,FIND(".",$I2,FIND(".",$I2)+1)+1)-1))
@xunil154
xunil154 / wp_chooser.py
Last active September 20, 2018 06:55
Wallpaper chooser script. Looks for wallpapers that match your current X11 aspect ratio
#!/usr/bin/env python2.7
"""
Dependencies:
* Python Image Library (PIL)
* Xlib
* feh (system command)
This script crawls recursivly through the directory provided as the first
argument and looks for any files matching the extensions: jpg, png, jpeg, tiff
@xunil154
xunil154 / gram-parser.py
Created November 19, 2013 19:46
Basic python text analysis, it looks through text files and counts, single words, bigrams and trigrams
#!/usr/bin/env python2.7
import sys
import re
single_gram = {}
bigram = {}
trigram = {}
def filter_line(line):