This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Copyright (c)2022 https://bookfere.com | |
:: This is a batch script for fixing Google Translate and making it available | |
:: in the Chinese mainland. If you experience any problem, visit the page below: | |
:: https://bookfere.com/post/1020.html | |
@echo off | |
setlocal enabledelayedexpansion | |
chcp 437 >NUL | |
set "ips[0]=74.125.137.90" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c)2022 https://bookfere.com | |
# This is a batch script for fixing Google Translate and making it available | |
# in the Chinese mainland. If you experience any problem, visit the page below: | |
# https://bookfere.com/post/1020.html | |
set -e | |
IPS=( | |
74.125.137.90 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# generate server.xml with the following command: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
# run as follows: | |
# python simple-https-server.py | |
# then in your browser, visit: | |
# https://localhost:4443 | |
import BaseHTTPServer, SimpleHTTPServer | |
import ssl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim: fileencoding=utf-8 | |
import time, signal | |
from tornado import web, ioloop, options, httpserver | |
_SHUTDOWN_TIMEOUT = 30 | |
def make_safely_shutdown(server): | |
io_loop = server.io_loop or ioloop.IOLoop.instance() | |
def stop_handler(*args, **keywords): | |
def shutdown(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:$i:1}" | |
case $c in |