Skip to content

Instantly share code, notes, and snippets.

@fallive
fallive / wget_baidu_yun.sh
Created June 27, 2017 17:21 — forked from myfavouritekk/wget_baidu_yun.sh
Download Baidu Yun file using wget
#!/usr/bin/env bash
# referer url is public share links
# file url can be found via browser downloading
referer_url=$1
file_url=$2
save_name=$3
wget --referer=$referer_url -O $save_name "$file_url"
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@fallive
fallive / gencert.py
Created November 30, 2016 03:02 — forked from toolness/gencert.py
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private
@fallive
fallive / SimpleAuthServer.py
Created November 29, 2016 23:31 — forked from fxsjy/SimpleAuthServer.py
SimpleAuthServer: A SimpleHTTPServer with authentication
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
import sys
import base64
key = ""
class AuthHandler(SimpleHTTPRequestHandler):
''' Main class to present webpages and authentication. '''
def do_HEAD(self):
@fallive
fallive / gist:a53fa20423294584fc2e2031ccf1150d
Created November 28, 2016 21:14 — forked from philipn/gist:5274197
Running Ubuntu on a Macbook Air

Running Ubuntu on a Macbook Air

You don't have to be a slave to OS X! Here's a guide to a sane dual-booting setup with Ubuntu 12.10 on your shiny MacBook Air. This is written and tested for a MacBook Air 5,2 (Mid 2012), but likely works the same with any modern Macbook.

Install according to instructions at this URL:

@fallive
fallive / SimpleHTTPServerWithUpload.py
Created November 20, 2016 20:36 — forked from UniIsland/SimpleHTTPServerWithUpload.py
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.
"""