I hereby claim:
- I am sunliwen on github.
- I am sunliwen (https://keybase.io/sunliwen) on keybase.
- I have a public key ASABIfKL8I_F9v4CepwlSJS9Fo8No_qdVEuOx9tQxEIt6wo
To claim this, I am signing this object:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDN0sO2/S6Q19vOz2ZO7Y+TAFzHQb1LCtlbcGNFACq0M3PXFVQ1rTyayiNcrnfz+ckfCZe38IUZLoAJXiqg2A7Ww8vazuG8exdR1+GXWYSAFsAkJkqptQ2B/fl0ZelJZLEVJVDJw4Y0d/oYlhpL8FKuvrHQJLscPfuxB/VxJBxsaWDQvrNb862R/A5A28VpE1/pZRWp1e/6qtDwxhYhJPoPsdur9l8TOWz/AzBpqxpSB3zKGIK07hHBSYtfZXBO8gcOaGU4s+btAodJ5L0U0E3hXlUGc0e+ZYFU6f6Sz2tzYiwPfS9sYVjBN14vzZh4Bz5cZZQurjcgwaPhyxCzh9ql [email protected] |
# http://lxml.de/installation.html#using-lxml-with-python-libxml2 | |
STATIC_DEPS=true pip install lxml |
import json | |
import decimal | |
import pprint | |
# refs: https://djangosnippets.org/snippets/2410/ | |
# refs: http://stackoverflow.com/questions/1960516/python-json-serialize-a-decimal-object | |
class DecimalEncoder(json.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, decimal.Decimal): | |
return float(obj) |
# Install pip install cryptography, path issue with openssl/aes.h will occur. The reason is Apple deprecated openssl and the compiler can't find the one installed by homebrew. | |
# So the following line will help. | |
env LDFLAGS="-L$(brew --prefix openssl)/lib" CFLAGS="-I$(brew --prefix openssl)/include" pip install cryptography |
import os, sys | |
import smtplib | |
from smtplib import SMTP_SSL | |
from email.header import Header | |
from email.mime.text import MIMEText | |
mailInfo = { | |
"from":"[email protected]", | |
"to":"[email protected]", | |
"hostname":"smtp.exmail.qq.com", |
I hereby claim:
To claim this, I am signing this object:
# refs: https://stackoverflow.com/questions/51125013/how-can-i-install-a-previous-version-of-python-3-in-macos-using-homebrew/51125014#51125014 | |
brew uninstall --ignore-dependencies python3 | |
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/f2a764ef944b1080be64bd88dca9a1d80130c558/Formula/python.rb | |
brew switch python 3.6.5_1 | |
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --unsafely-treat-insecure-origin-as-secure=http://0.0.0.0:8000 |
#!/usr/bin/env python3 | |
# Ported to Python 3 by Telmo "Trooper" ([email protected]) | |
# | |
# Original code from: | |
# http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# https://gist.github.com/dergachev/7028596 | |
# | |
# To generate a certificate use: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes |