This file contains 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 | |
# Set the default policies to allow everything while we set up new rules. | |
# Prevents cutting yourself off when running from remote SSH. | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT | |
iptables -P OUTPUT ACCEPT | |
# Flush any existing rules, leaving just the defaults | |
iptables -F |
This file contains 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
# coding:utf8 | |
u"""偶尔会用到这样的一个功能,给定两个日期和休息日计算之间的工作日天数.""" | |
import datetime | |
def workday(start_date, end_date, weekends=None): | |
"""根据给定的起止日期和周末来计算之间的工作日天数""" |
This file contains 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
Show hidden characters
"settings": | |
{ | |
"anaconda_linting": true, | |
"anaconda_linting_behaviour": "always", | |
"python_interpreter": "/usr/local/bin/python3", | |
"test_command": "python3 -m unittest discover", | |
"use_pylint": false, | |
"validate_imports": true | |
} |
This file contains 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
import sys | |
print('Python %s on %s' % (sys.version, sys.platform)) | |
import django | |
print('Django %s' % django.get_version()) | |
sys.path.extend([WORKING_DIR_AND_PYTHON_PATHS]) | |
import os | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "your_project_.settings") | |
if 'setup' in dir(django): | |
django.setup() | |
# import django_manage_shell |
This file contains 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
# Bind F11 and F12 (NOT F1 and F2) to previous and next screen window | |
bindkey -k F1 prev | |
bindkey -k F2 next | |
startup_message off | |
# Window list at the bottom. | |
hardstatus alwayslastline | |
hardstatus string "%-w%{= BW}%50>%n %t%{-}%+w%<" |
This file contains 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
TRANSACTION(事务隔离级别) | |
1. ISOLATION_DEFAULT:这是一个PlatfromTransactionManager默认的隔离级别,使用数据库默认的事务隔离级别。 | |
每种数据库的默认隔离级别是不同的,例如SQL Server、Oracle默认Read Commited,MySQL默认Repeatable Read。 | |
另外四个与JDBC的隔离级别相对应,不同的隔离级别采用不同的锁类型来实现,在四种隔离级别中,Serializable的 | |
隔离级别最高,Read Uncommited的隔离级别最低。 | |
2. ISOLATION_READ_UNCOMMITTED:读未提交数据,这是事务最低的隔离级别,在并发的事务中,它充许一个事务可以 | |
读到另一个事务未提交的更新数据。(会出现脏读,不可重复读和幻读) | |
3. ISOLATION_READ_COMMITTED:读已提交数据,保证在并发的事务中,一个事务修改的数据提交后才能被另外一个事 |
This file contains 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
set -g default-terminal "tmux-256color" | |
# 重新读取加载配置文件 | |
bind R source-file ~/.tmux.conf \; display-message "Config reloaded..." | |
set -g history-limit 10000 | |
setw -g monitor-activity on | |
set -g visual-activity on |
This file contains 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
function enable_proxy(){ | |
export http_proxy=http://127.0.0.1:8118 | |
export https_proxy=http://127.0.0.1:8118 | |
} | |
function disable_proxy(){ | |
unset http_proxy https_proxy | |
} |
This file contains 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
# Video | |
display-fps=60 | |
autofit=100%x100% | |
# Volume | |
volume=100 | |
# Subtitles | |
sub-auto=fuzzy | |
sub-text-font-size=48 |
This file contains 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
# 你可以从该 URL 下载这个配置文件: http://surge.run/config-example/ios.conf | |
# 用编辑器编辑后,再通过 iTunes, URL, AirDrop 或者 iCloud Drive 复制回 iOS 设备 | |
# Version 2.0 | |
[General] | |
# 日志等级: warning, notify, info, verbose (默认值: notify) | |
loglevel = notify | |
# 跳过某个域名或者 IP 段,这些目标主机将不会由 Surge Proxy 处理。(在 macOS | |
# 版本中,如果启用了 Set as System Proxy, 那么这些值会被写入到系统网络代理 | |
# 设置中.) |
OlderNewer