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 | |
for file in $( ls ); do | |
echo item: $file | |
if [[ ( $file == *.tgz ) || ( $file == *.tar.gz ) ]]; then | |
tar xzvf $file -C /usr/local/ | |
fi | |
done |
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
[program:service] | |
;directory = ~/su/ ; 程序的启动目录 | |
command = /root/miniconda3/bin/python /root/project/service/run.py ; 启动命令,可以看出与手动在命令行启动的命令是一样的,注意这里home不可用~代替 | |
autostart = true ; 在 supervisord 启动的时候也自动启动 | |
startsecs = 5 ; 启动 5 秒后没有异常退出,就当作已经正常启动了 | |
autorestart = true ; 程序异常退出后自动重启 | |
startretries = 3 ; 启动失败自动重试次数,默认是 3 | |
user = root ; 用哪个用户启动 | |
redirect_stderr = true ; 把 stderr 重定向到 stdout,默认 false | |
stdout_logfile_maxbytes = 20MB ; stdout 日志文件大小,默认 50MB |
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 -*- | |
# Created by frank at 15/07/2017 | |
""" | |
███╗ ██╗ ██████╗ ██████╗ ██╗ ██╗ ██████╗ | |
████╗ ██║██╔═══██╗██╔══██╗██║ ██║██╔════╝ | |
██╔██╗ ██║██║ ██║██████╔╝██║ ██║██║ ███╗ | |
██║╚██╗██║██║ ██║██╔══██╗██║ ██║██║ ██║ | |
██║ ╚████║╚██████╔╝██████╔╝╚██████╔╝╚██████╔╝ | |
╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ |
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 time | |
time.strftime('%Y-%m-%d %H:%M:%S', time.localtime()) | |
# >> '2017-07-15 14:39:54' |
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
// C++ includes used for precompiling -*- C++ -*- | |
// Copyright (C) 2003-2013 Free Software Foundation, Inc. | |
// | |
// This file is part of the GNU ISO C++ Library. This library is free | |
// software; you can redistribute it and/or modify it under the | |
// terms of the GNU General Public License as published by the | |
// Free Software Foundation; either version 3, or (at your option) | |
// any later version. |
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
If you want add to ignore some directories in your local repository (which already exist) after editing .gitignore you want to run this on your root dir | |
``` | |
git rm --cached -r . | |
git add . | |
``` |
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
df1 = DataFrame(np.random.randn(10, 4), columns=['a', 'b', 'c', 'd']) | |
mask = df1.applymap(lambda x: x <-0.7) | |
df1 = df1[-mask.any(axis=1)] | |
sLength = len(df1['a']) | |
e = Series(np.random.randn(sLength)) |
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/sh | |
#kill all exe proc | |
ps -A | grep exe > tmp.txt | |
i=1 | |
while read line | |
do | |
echo Killing `echo $line |awk '{printf("%s\n",$4)}'` | |
kill `echo $line |awk '{printf("%s\n",$1)}'` | |
done < tmp.txt |
NewerOlder