Skip to content

Instantly share code, notes, and snippets.

@AnsonYe
AnsonYe / list-all-azure-containers.py
Created August 22, 2017 07:20
List all azure containers in python
from azure.storage.blob import BlobService
blob_service=BlobService(account_name='x', account_key='x', )
marker=None
while True:
containers = blob_service.list_containers(marker=marker)
for c in containers:
print c.name
#!/usr/bin/python
import sys
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC0axxxxxxxxxxxxxxxxxxxxx296ae"
auth_token = "93exxxxxxxxxxxxxxxxxxxx263e9"
client = TwilioRestClient(account_sid, auth_token)
message = client.messages.create(body=sys.argv[2],
@AnsonYe
AnsonYe / gfwlist2domain.py
Created December 9, 2015 04:10
Generate a domain list from gfwlist.txt
#!/usr/bin/env python
#coding=utf-8
import urllib2
import re
import os
import base64
# the url of gfwlist
baseurl = 'https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt'
@AnsonYe
AnsonYe / zabbix-alert-smtp.sh
Last active September 23, 2019 18:55 — forked from superdaigo/zabbix-alert-smtp.sh
Zabbix SMTP Alert script for gmail and Amazon SES
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail and Amazon SES.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header