Skip to content

Instantly share code, notes, and snippets.

View ducalpha's full-sized avatar

Duc Bui ducalpha

View GitHub Profile
@KartikTalwar
KartikTalwar / Documentation.md
Last active June 25, 2024 10:55
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@willurd
willurd / web-servers.md
Last active July 5, 2024 18:32
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@lopes
lopes / aes-cbc.py
Last active March 21, 2024 04:22
Simple Python example of AES in CBC mode.
#!/usr/bin/env python3
#
# This is a simple script to encrypt a message using AES
# with CBC mode in Python 3.
# Before running it, you must install pycryptodome:
#
# $ python -m pip install PyCryptodome
#
# Author.: José Lopes
# Date...: 2019-06-14
@arciisine
arciisine / parser.py
Created September 28, 2016 22:42
Python HTML Parser
#!/usr/bin/python
import sys
class Node(object):
def __init__(self):
pass
class TextNode(Node):
def __init__(self, text = ''):
Node.__init__(self)
@havron
havron / MITM_to_csv.py
Last active September 15, 2021 01:44
MITMProxy's default dump script is *not* Pandas friendly! Run `mitmdump -s MITM_to_csv.py -q` with this gist to get CSV for requests and responses. The 'id' is what uniquely links requests with their response pair -- I might eventually move to HAR style dump to join reqs and resps.
from mitmproxy import http
from mitmproxy.net.http import cookies
from mitmproxy.utils import strutils
from datetime import datetime
import csv
import base64
import json
REQUESTS_LOG = 'requests.mitm.csv'
RESPONSES_LOG = 'responses.mitm.csv'