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
echo off | |
set /p VAR=Do you recursively delete all.user files:[Y, N]? | |
rem echo %VAR% | |
if /i '%VAR%' == 'y' goto s1 | |
if /i '%VAR%' == 'n' goto end | |
:s1 |
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
@ECHO OFF | |
FOR /f "tokens=*" %%i in ('DIR /a:d /b') DO ( | |
ECHO %%i | |
CD %%i | |
git checkout develop | |
git pull | |
CD .. | |
) |
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
# 分组信息 | |
group_data = [ | |
{ | |
"name": "group1", | |
"users": [ "user1", "user2" ] | |
}, | |
{ | |
"name": "group2", | |
"users": [ "user3", "user4" ] | |
} |
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
def vs_env_dict(): | |
vsvar32 = '{vscomntools}vsvars32.bat'.format(vscomntools=os.environ['VS140COMNTOOLS']) | |
cmd = [vsvar32, '&&', 'set'] | |
popen = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
stdout, stderr = popen.communicate() | |
if popen.wait() != 0: | |
raise ValueError(stderr.decode("mbcs")) | |
output = stdout.decode("mbcs").split("\r\n") | |
return dict((e[0].upper(), e[1]) for e in [p.rstrip().split("=", 1) for p in output] if len(e) == 2) | |
os.environ.update(vs_env_dict()) |
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
from dateutil.relativedelta import relativedelta | |
from datetime import date | |
today = date.today() | |
temp = today - relativedelta(months=1) | |
start_date = date(temp.year, temp.month, 1) | |
end_date = date(today.year, today.month, 1) - relativedelta(days=1) | |
print(start_date) | |
print(end_date) |
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
:::删除服务 | |
sc delete WanNengWuBiServiceV1 | |
:::检查端口是否被占用 | |
netstat -aon | findstr "4007" | |
:::拷贝当前目录下的所有文件夹到另一目录 | |
for /f "delims=" %%D in ('dir /a:d /b') do xcopy %%D ..\..\..\..\tool-cli\topsin\script\ieb-ec-iqs\%%D\ /S /E /Y |
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
# CentOS 7 添加信任端口 | |
firewall-cmd --zone=public --add-port=5432/tcp --permanent | |
firewall-cmd --reload | |
# SMTP端口转发 | |
firewall-cmd --add-masquerade --permanent | |
firewall-cmd --permanent --add-forward-port=port=9281:proto=tcp:toport=25:toaddr=10.3.1.251 | |
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.3.1.251/24" masquerade' | |
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.28.10.53/24" masquerade' | |
firewall-cmd --reload |
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
- 创建用户 | |
CREATE USER 'toplinker'@'%' IDENTIFIED BY 'TopLinker0510'; | |
- 分配SELECT权限给toplinker用户 | |
GRANT SELECT ON *.* TO 'toplinker'@'%'; | |
- 让权限立即生效 | |
FLUSH PRIVILEGES; |
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
:: 执行下面的批处理脚本 | |
:: 系统右键菜单中将增加Removing .SVN Folders | |
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN] | |
@="Removing .SVN Folders" | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\DeleteSVN\command] | |
@="cmd.exe /c \"TITLE Removing .SVN Folders in %1 && COLOR 9A && FOR /r \"%1\" %%f IN (.svn) DO RD /s /q \"%%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
sqlite3.exe -header -csv sqlite.db "select * from tablename;" > tablename.csv |