Skip to content

Instantly share code, notes, and snippets.

@convexset
convexset / http-server-finite-serves.py
Last active February 13, 2023 12:38
Python HTTP Server Example for Controlling the Number of "Serves" (This allows infinite GETs, and stops after the first POST)
import http.server
from pprint import pprint
done = False
def do_echo(self):
print(f'Headers:')
pprint(dict(self.headers.items()))
print()
@convexset
convexset / remove-pdf-watermark.sh
Last active September 17, 2024 15:02
Remove multiple text watermarks from a PDF file. Requires xxd and qpdf to work correctly.
#!/bin/bash
# Remove multiple text watermarks from a PDF file. Requires xxd and qpdf to work correctly.
#
# Usage:
#
# remove-pdf-watermark.sh "Your Input File.pdf" "Your Output File.pdf" [WATERMARK1] [WATERMARK2] [WATERMARK3] [...]
#
# For Example:
#

Keybase proof

I hereby claim:

  • I am convexset on github.
  • I am convexset (https://keybase.io/convexset) on keybase.
  • I have a public key ASDMnG4IfAEaA7b4LOt25Ys-Ei--YQCjAh3nvwIGtEvWQAo

To claim this, I am signing this object:

@convexset
convexset / default-public-key
Created September 11, 2017 01:51
Public Keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1hJmk++W25dI9D3z6Y9+3OjqnYpoo7/VWoXiUm3Qy63Rr295rV0jaOCbH6XYqkEt9/g8QbdC5cLnDoPZqe7TG2DhaajyGUE6VtAW2yecu1HVdLrjgRG5QzwvcbuN4zJjU7O05vv0mOUV2/d4djKy21ou8SNGuFAXoLl8P49eM4vfA7jYmXKaQ2PuV5GPYBkylc5srYid6H4JYbADnJvE1FgJB1PdKD13LW7+WcDDt3a4S/hpTcGiG/KMDdRuNCcBazNmAQu05RlJwDdHVnyPIpt8clzCYp7OMZeO4JIkYoV8SlhUNQp/xdoxJQabLmjYPyuenAFTfIeOsv8r7wy/Zw== Jeremy Chen
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
@convexset
convexset / commit-msg
Last active July 27, 2018 09:48
git hook for commit-msg to use ESLint as a soft guard of code quality (lets things pass if the committer is committed to committing)
#!/bin/bash
# Uses ESLint as a soft guard of code quality for your repo
# allows commits to go through if re-attempted within a pre-set interval
# copy to .git/hooks/commit-msg to have things work
# Based on: https://gist.github.com/wesbos/8aec9d2ff7f7cf9dd65ca2c20d5dfc23
PRESET_TIME_INTERVAL=60