Skip to content

Instantly share code, notes, and snippets.

@k0rnpisey
k0rnpisey / http_streaming.md
Created February 22, 2024 05:29 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@k0rnpisey
k0rnpisey / s3-upload-aws4.sh
Created August 4, 2022 04:21 — forked from vszakats/s3-upload-aws4.sh
AWS S3 upload using signature v4
#!/bin/sh -u
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# Upload a file to Amazon AWS S3 using Signature Version 4
#
# docs:
@k0rnpisey
k0rnpisey / neckbeard-push.sh
Created May 17, 2022 12:32 — forked from kennwhite/neckbeard-push.sh
Minimalist, bash-only utility script to push a file to S3 bucket. AWS ID & Key can be passed via environment or on command line. Only dependency is openssl tools (usually default). Name is an homage to Joe Stump.
#!/usr/bin/env bash
#
# Upload a file to the Amazon S3 service
# Usage:
# neckbeard-push FILE S3_BUCKET [-a ACL_POLICY] [-i AWS_ACCESS_ID] [-k AWS_SECRET_KEY] [-d debug] [-l write verbose session log]
# Note: If option -l is requested, curl_session.log contains SSL handshake *and* plaintext AWS keys
#
# Ex 1: neckbeard-push foo.log my-bucket -a public-read (with env vars: $AWS_ACCESS_ID & $AWS_SECRET_KEY)
# Ex 2: neckbeard-push foo.log my-bucket -a private -i AKIXXXXX -k aBcDeFgHxxx -d
#
@k0rnpisey
k0rnpisey / backup-github.sh
Created March 22, 2022 16:33 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
#-------------------------------------------------------------------------------
# NOTES:
#-------------------------------------------------------------------------------
# * Under the heading "CONFIG" below you'll find a number of configuration
# parameters that must be personalized for your GitHub account and org.
# Replace the `<CHANGE-ME>` strings with the value described in the comments
# (or overwrite those values at run-time by providing environment variables).
import os
import sys
import requests
from git import Repo
from string import Template
# Get the command-line arguments
user_type = sys.argv[1]
user_id = sys.argv[2]