Skip to content

Instantly share code, notes, and snippets.

View chrismooredev's full-sized avatar
:shipit:

Chris Moore chrismooredev

:shipit:
View GitHub Profile
import os
import time
import signal
import socket
import argparse
from multiprocessing import Process
def send_loop(tid, target, port, plen):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@chrismooredev
chrismooredev / update_mtu.sh
Last active November 12, 2024 00:53
Script to set WSL eth0 MTU to the same as a (lower) Pulse Secure Juniper Networks adapter MTU
#!/bin/bash
# Sets the WSL eth0 adapter to the same MTU as a Juniper Networks Virtual Adapter, from the Windows side.
# This can help make certain connections (SSH/HTTPS specifically) more stable/reliable, as they can use
# larger packets when initiating connections or sending large chunks of data.
# Recommended to run in ~/.profile to persist across reboots. Remember to make this script executable.
# Add to sudoers file if running in ~/.profile
# %sudo ALL=(ALL) NOPASSWD: /usr/sbin/ip link set mtu * dev *
@chrismooredev
chrismooredev / process-scanned-pdf.sh
Last active September 23, 2020 16:43
Separates pages from a scanned book (in PDF format), straightens the pages, and OCRs the whole thing.
#!/bin/bash
if [ $# -eq 0 ] ; then
echo "Usage: $0 <input PDF> [output filename] [custom temp dir]"
echo "\tSlices, Straightens, and OCRs scanned PDFs from books"
echo ""
echo "\tIf [output filename] is not provided, then outputs to <input>.normalized.pdf
echo "\tIf [custom temp dir] is not provided, then uses a directory from 'mktemp' which is automatically deleted"
echo
echo "\tUses commands from packages poppler-utils, imagemagick, img2pdf, ghostscript, ocrmypdf"
@chrismooredev
chrismooredev / d2l-improver.user.js
Last active May 30, 2021 20:13
Adds a few QOL updates to Valence's Desire2Learn (D2L) website.
// ==UserScript==
// @name Make D2L a bit better
// @namespace https://gist.github.com/chrismooredev/4bd7605a47ca89d65699bbbaef474c38
// @version 0.5.5
// @description Add QoL changes to D2L's user interface
// @author https://github.com/csm123199
// @include https://d2l.*.edu/d2l/le/content/*/viewContent/*/View
// @grant none
// @updateUrl https://raw.githubusercontent.com/chrismooredev/d2l-tweaks/master/d2l-tweaks.user.js
// ==/UserScript==
@chrismooredev
chrismooredev / test.txt
Created October 30, 2018 21:00
Test Gist
hjaksdhjakdhsjak