Skip to content

Instantly share code, notes, and snippets.

View doomzhou's full-sized avatar
😃

sinozhou doomzhou

😃
View GitHub Profile
@doomzhou
doomzhou / china.json
Created May 23, 2015 21:26
china.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@doomzhou
doomzhou / gist:3c1a66b79b40546dcaaa
Created November 9, 2015 11:29
mutt 的python 模块,发送邮件
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import smtplib
import sys
import re
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
msg = MIMEMultipart('alternative')
import socket
import urllib.parse
import logging
import sys
logging.basicConfig(level=logging.INFO)
def to_bytes(s):
if bytes != str:
@doomzhou
doomzhou / ip
Created August 2, 2018 13:24
osx没有iproute2, 虽然可以使用iproute2mac , 不过python3不行吧.
ip () {
ifconfig | awk '{if ($1 ~ /^[a-z]*[0-9]:/) { s=$1}; if ( $2 ~ /[0-9]*\./) {print s $2}}'
}
set -o vi