Skip to content

Instantly share code, notes, and snippets.

View UniIsland's full-sized avatar

Huang, Tao UniIsland

View GitHub Profile
@UniIsland
UniIsland / files.txt
Last active February 17, 2023 23:04
find and remove large file from git history
135207 columns/static/img/ggj/c1.png
122010 columns/static/img/ggj/c2.png
144015 columns/static/img/ggj/c3.png
121790 sites/management/commands/invitation_code.txt
121795 sites/management/commands/invitation_code.txt
121800 sites/management/commands/invitation_code.txt
121805 sites/management/commands/invitation_code.txt
210125 sites/static/img/1.jpg
131079 sites/static/img/2.jpg
109902 sites/static/img/2011-ggj/daminghu.png
@UniIsland
UniIsland / simple-cors-http-server.py
Created February 10, 2018 14:30
Simple Python HTTP server with CORS (or other custom) header.
#!/usr/bin/env python
# Attribution: https://stackoverflow.com/questions/21956683/enable-access-control-on-simple-http-server
try:
# Python 3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test as test_orig
import sys
def test (*args):
test_orig(*args, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)
@UniIsland
UniIsland / xargs_with_function.sh
Last active October 10, 2023 11:05
use xargs with bash function
#!/bin/bash
parse_and_echo() {
echo "\$1:$1 \$2:$2 \$3:$3 \$4:$4"
echo newline
}
export -f parse_and_echo
# `_' is placeholder for $0
@UniIsland
UniIsland / list-manually-installed-packages.sh
Created February 8, 2014 08:20
List all manually installed packages on a debian/ubuntu system
#!/bin/bash
## List all manually installed packages on a debian/ubuntu system
## manually installed means:
## 1. not pre-installed with the system
## 2. not marked auto-installed by apt (not dependencies of other
## packages)
## Note: pre-installed packages that got updated still needs to be
## filtered out.
@UniIsland
UniIsland / SimpleHTTPServerWithUpload.py
Created August 14, 2012 04:01
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""