Skip to content

Instantly share code, notes, and snippets.

@fanjinfei
fanjinfei / debug_requests.py
Created November 9, 2018 18:58 — forked from Daenyth/debug_requests.py
Enable debug logging for python requests
import requests
import logging
import httplib
# Debug logging
httplib.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
req_log = logging.getLogger('requests.packages.urllib3')
req_log.setLevel(logging.DEBUG)
@fanjinfei
fanjinfei / Python Copy Blob
Created June 22, 2017 18:39 — forked from RobBlackwell/Python Copy Blob
Python code to copy blobs between Windows Azure Storage accounts
#!/usr/bin/env python
import sys
import datetime
import time
from datetime import timedelta
sys.path.append('/home/reb/local/azure-sdk-for-python/')
from azure.storage import *
@fanjinfei
fanjinfei / custom-tinycore.sh
Created May 30, 2017 19:10 — forked from dankrause/custom-tinycore.sh
Create a custom tinycore linux iso. Adjust the config at the beginning of the script, or supply a conf as the first arg. Requires xorriso.
#!/bin/bash
set -e
function cleanup() {
# clean up our temp folder
rm -rf "${TMPDIR}"
}
trap cleanup EXIT