最近因为电信白名单,国外的服务器只能ping通,高端口基本无法使用,一种解决办法是将翻墙服务启动在80,443等可访问端口,另一种就是本文方法,将数据包封装在ping包中。
使用 hans 这个项目结合 shadowsocks-libev 翻墙。
To change a field name in django 1.7+ | |
1. Edit the field name in the model (but remember the old field name: you need it for step 3!) | |
2. Create an empty migration | |
$ python manage.py makemigrations --empty myApp | |
3. Edit the empty migration (it's in the migrations folder in your app folder, and will be the most recent migration) by adding | |
migrations.RenameField('MyModel', 'old_field_name', 'new_field_name'), | |
to the operations list. |
from django.core.exceptions import MiddlewareNotUsed | |
from django.conf import settings | |
import cProfile | |
import pstats | |
import marshal | |
from cStringIO import StringIO | |
class ProfileMiddleware(object): | |
def __init__(self): | |
if not settings.DEBUG: |
<header> | |
<div class="title"> | |
<h1>over</h1> | |
<h1>five</h1> | |
</div> | |
</header> |
// Extract table names from SQL statement | |
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
// extractTableNames from sql statement |
最近因为电信白名单,国外的服务器只能ping通,高端口基本无法使用,一种解决办法是将翻墙服务启动在80,443等可访问端口,另一种就是本文方法,将数据包封装在ping包中。
使用 hans 这个项目结合 shadowsocks-libev 翻墙。
# ping6 ipv6.google.com
PING ipv6.google.com(nrt12s14-in-x0e.1e100.net (2404:6800:4004:81b::200e)) 56 data bytes
64 bytes from nrt12s14-in-x0e.1e100.net (2404:6800:4004:81b::200e): icmp_seq=1 ttl=53 time=1.61 ms
64 bytes from nrt12s14-in-x0e.1e100.net (2404:6800:4004:81b::200e): icmp_seq=2 ttl=53 time=1.58 ms
64 bytes from nrt12s14-in-x0e.1e100.net (2404:6800:4004:81b::200e): icmp_seq=3 ttl=53 time=1.66 ms
64 bytes from nrt12s14-in-x0e.1e100.net (2404:6800:4004:81b::200e): icmp_seq=4 ttl=53 time=1.51 ms
64 bytes from nrt12s14-in-x0e.1e100.net (2404:6800:4004:81b::200e): icmp_seq=5 ttl=53 time=1.64 ms
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
javascript: ( | |
function () { | |
var u = 'https://www.inoreader.com/?add_feed='; | |
var l = location; | |
c = l.pathname.split('/')[1]; | |
if (l.host == 'medium.com') { | |
u += l.protocol + '//' + l.host + '/feed/' + c; | |
} else if (l.host == 'zhuanlan.zhihu.com') { | |
u += l.protocol + '//' + l.host + '/' + c; | |
} else if (l.host == 'www.jianshu.com') { |
#!/usr/local/bin/python | |
# coding: utf-8 | |
import imaplib | |
import time | |
import re | |
# 拆分删除列表,一次性标记删除1000个 | |
# 参考: | |
# 1: http://www.lolizeppelin.com/2016/12/14/python-imap-delete/ |