Skip to content

Instantly share code, notes, and snippets.

View i8degrees's full-sized avatar

Jeffrey Carpenter i8degrees

View GitHub Profile
@i8degrees
i8degrees / serve_http.py
Last active May 25, 2024 22:35
Simple Python HTTP Server with multi-threading, partial-content and basic authentication support
#!/usr/bin/env python2
#
# 1. https://web.archive.org/web/20210123000445/https://gist.github.com/devgianlu/018b299f8817bf92350bf7bf70214e4d
# 2. https://github.com/devgianlu/Aria2App/wiki/Setup-HTTP-DirectDownload
#
# devgianlu/serve_http.py
# Forked from pankajp/serve_http.py
#
# Standard library imports.
@i8degrees
i8degrees / zfs_replicate.v2.sh
Created April 14, 2024 16:05
My completed ZFS pool replication script
#!/bin/sh
#
# zfs snapshot -r offsite2_fs1/boot-pool@migrate
# zfs snapshot -r offsite2_fs1/npool0@migrate
#
datasets=(`zfs list -r offsite2_fs1/boot-pool -o name -H`);
existing_pool="offsite2_fs1"
new_pool="offsite2_fs1.tmp"
buffer=() # inbound scratch
@i8degrees
i8degrees / zfs_replicate.sh
Last active April 14, 2024 15:42
ZFS pool replication
#!/bin/bash
#
# Replicate source pool target with a destination pool target
#
# SOURCE[(https://www.truenas.com/community/threads/how-to-move-a-dataset-from-one-zfs-pool-to-another-zfs-pool.75912/#post-714236)
#
MY_POOL_DEVICE="offsite2_fs1"
ZFS_DEST_POOL="offsite2_fs1.tmp"
@i8degrees
i8degrees / notify.py
Created May 1, 2023 08:55
Modern 'wall' command
# Sourced from https://gist.githubusercontent.com/badp/672546/raw/4c6bc7dee6d547d8a7f002ce95c9a66363108f6e/spam.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Licensed under MIT license: http://www.opensource.org/licenses/mit-license.php
import os, subprocess, sys
# thanks: Martin-Éric Racine, Roger Pate
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=433960
# http://chat.askubuntu.com/rooms/3/conversation/spam-py
@i8degrees
i8degrees / LICENSE.md
Created March 16, 2022 07:20
rclone client, a Google web application

Simplified BSD License

Copyright (c) 2022 Jeffrey Carpenter [email protected] Some rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice,
@i8degrees
i8degrees / demo.html
Last active July 24, 2019 05:51
A snippet from my nom-video module from Naughty Girl to demonstrate the "Page Visibility" API (browser implement)
<!DOCTYPE html>
<html>
<head>
<title>nom-video: demo</title>
</head>
<body>
<!-- hero video cover -->
<!-- ...and so on and so forth and what have you! -->
@i8degrees
i8degrees / gas-receipt-generator.markdown
Created November 20, 2018 05:53
Gas Receipt Generator
@i8degrees
i8degrees / how-to-set-up-stress-free-ssl-on-os-x.md
Created August 13, 2017 22:17 — forked from jed/how-to-set-up-stress-free-ssl-on-os-x.md
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

#!/usr/bin/env bash
#
# fix-imessage.sh:jeff
#
# http://www.tonymacx86.com/threads/how-to-fix-imessage.110471/#TOP3.3
# Execute a command
#
# This function supports "dry-run" execution; set the variable NOM_DRY_RUN
# before execution of this function to enable it.