Skip to content

Instantly share code, notes, and snippets.

View iLittleSheep's full-sized avatar

YANSONG YANG iLittleSheep

View GitHub Profile
@iLittleSheep
iLittleSheep / gist:4103605
Created November 18, 2012 04:44
python email
# Import smtplib for the actual sending function
import smtplib
# Import the email modules we'll need
from email.mime.text import MIMEText
# Open a plain text file for reading. For this example, assume that
# the text file contains only ASCII characters.
fp = open(textfile, 'rb')
# Create a text/plain message
@iLittleSheep
iLittleSheep / Regex:IP
Created November 18, 2012 05:23 — forked from yannisxu/Regex:IP
Regex:IP
((?:(?:25[0-5]|2[0-4]\d|[01]?\d?\d)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d?\d))
@iLittleSheep
iLittleSheep / ClientHelper.java
Created November 19, 2012 07:22 — forked from outbounder/ClientHelper.java
java : jersey client helper for trusting all certificates in SSL/TLS
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;