Skip to content

Instantly share code, notes, and snippets.

View jwhonce's full-sized avatar
🏠
Working from home

Jhon Honce jwhonce

🏠
Working from home
View GitHub Profile
import socket, argparse
import select, sys, os, tty, atexit, termios, signal, shutil
import fcntl, termios, struct
# Create the socket
sock = socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET)
# parsing args for using this as a cli .... dwalsh hates the idea so you can
# nuke this when folding into the mix
@obskyr
obskyr / stream_response.py
Last active April 2, 2024 09:53
How to stream a requests response as a file-like object.
# -*- coding: utf-8 -*-
import requests
from io import BytesIO, SEEK_SET, SEEK_END
class ResponseStream(object):
def __init__(self, request_iterator):
self._bytes = BytesIO()
self._iterator = request_iterator
@gwpl
gwpl / clean.sh
Last active March 15, 2024 15:56
`openssl pkeyutl` how to: -sign -verify -encrypt -decrypt , using openssh keys snippets/examples
rm -v pub.pkcs8 test.sign test.txt.decrypted test.txt.encrypted
@micktwomey
micktwomey / export_gists_to_markdown.py
Last active March 10, 2024 20:55
Python script to export your gists (public or private) to a single Markdown file. This is useful for backing up or exporting. Doesn't preserve full revision history.
"""Noddy to dump out all your gists to Markdown
https://developer.github.com/v3/gists/
Requires the requests library.
"""
import argparse
import hashlib