Skip to content

Instantly share code, notes, and snippets.

@gnuton
gnuton / gist:3ba6dca3ce27d13833da
Created December 3, 2015 23:09
Python script which switch Huawey hilink e3372 to debug mode, then sends some command to its serial console.
import urllib2
# retrieve token
url="http://192.168.8.1/api/webserver/token"
response = urllib2.urlopen(url)
xml=response.read()
token=xml[59:-23]
print "Got token %s" % token
@gansbrest
gansbrest / gist:6983561
Last active March 13, 2023 21:49
Internal redirect to another domain with proxy_pass and Nginx
server
{
listen 80;
server_name a.com b.com c.com;
location ~* ^/comment/(.*) {
proxy_set_header HOST shared.com;
# $1 - stores capture from the location on top
# $is_args will return ? if there are query params
# $args stores query params