Skip to content

Instantly share code, notes, and snippets.

View dpedu's full-sized avatar

Dave Pedu dpedu

View GitHub Profile
class S3WriteProxy(object):
def __init__(self, storage, key):
"""
A file-like class that accepts writes (until the writer closes me) and accepts reads (until closed)
"""
self.storage = storage
self.key = key
self.q = Queue(maxsize=16) # 16 # number of 4 byte buffers (OS enforced ... )
self.leftovers = None
self.eof = False
@dpedu
dpedu / mirccloud.meme.user.js
Created January 4, 2019 15:42
Meme text userscript for IRCCloud
// ==UserScript==
// @name mirccloud.meme.user.js
// @namespace https://github.com/dpedu/mirccloud
// @description Meme Text for IRCCloud
// @downloadURL https://raw.githubusercontent.com/dpedu/mirccloud/master/mirccloud.meme.user.js
// @version 0.1
// @match https://www.irccloud.com/*
// @noframes
// @grant none
// ==/UserScript==
@dpedu
dpedu / mirccloud.hueg.user.js
Created December 21, 2018 22:32
Irccloud hueg.js
// ==UserScript==
// @name mirccloud.hueg.user.js
// @namespace https://github.com/erm/mirccloud
// @description Hueg colorful text for IRCCloud
// @downloadURL https://raw.githubusercontent.com/erm/mirccloud/master/mirccloud.hueg.user.js
// @version 0.1
// @match https://www.irccloud.com/*
// @match https://irccloud.mozilla.com/*
// @noframes
// @grant none
print("deez nuts LOL")
print("lol")
@dpedu
dpedu / gist:6920a29fc4da2e9372ef4c71a6739719
Created April 25, 2017 04:17
parallel wget open directory mirroring
#!/bin/bash -ex
URL="http://example.com/open/directory/"
WGETCMD="wget -nv -e robots=off --recursive -nc -np --recursive --level inf --limit-rate=1m $URL"
PARALLELS=7
time ( seq $PARALLELS | parallel -j$PARALLELS -n1 bash -c "\"sleep \$(shuf -i 1-30 -n 1) ; $WGETCMD --append-output=logs/wget-{}.log\"" )
@dpedu
dpedu / cleanreg.py
Created June 5, 2016 20:15
docker registry v2 cleanup script
#!/usr/bin/env python3
from requests import get
import sys
from json import dumps
from os import listdir,remove,rmdir
from shutil import rmtree
REGISTRY_URL = "http://127.0.0.1:5000/v2/"
REGISTRY_DATA_PATH = "/data/registry/"