Skip to content

Instantly share code, notes, and snippets.

Avatar

毕勤 lifetyper

View GitHub Profile
View gist:e0936e4634aa2bc838839edc48551f4d
import hashlib
password = 'mypassword'
salt = 'mysalt'
m = hashlib.md5()
m.update((password + salt).encode('utf-8'))
print(m.hexdigest())
print(m.digest())
@lifetyper
lifetyper / netflix_aws_ipset_create.py
Created Dec 7, 2018
build a bash script to gather ip range for netflix and aws and route them through redsocks port 12345
View netflix_aws_ipset_create.py
import requests
import json
netflix_url = 'https://api.bgpview.io/asn/2906/prefixes'
aws_url = 'https://ip-ranges.amazonaws.com/ip-ranges.json'
netflix_data = json.loads(requests.get(netflix_url).content)
aws_data = json.loads(requests.get(aws_url).content)
@lifetyper
lifetyper / gist:135ebd2090d9bdb643255866f5303899
Last active Apr 27, 2017
dns over https without system dns depend
View gist:135ebd2090d9bdb643255866f5303899
# coding=utf-8
import aiohttp
import asyncio
from dns.resolver import Resolver
resolver = Resolver()
resolver.nameservers = ['114.114.114.114', '119.29.29.29']
ip = resolver.query('dns.google.com').rrset.items[0]
domain = 'dns.google.com'
loop = asyncio.get_event_loop()
You can’t perform that action at this time.