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
python -m pip install -U pip | |
python -m pip install --upgrade pip |
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
mac下安装非常简单,只要在命令行执行 | |
brew install ssdb | |
就帮你装好了,安装成功只需要 输入如下命令就可以启动ssdb服务器: | |
ssdb-server /usr/local/etc/ssdb.conf | |
当然前提是你先得安装好brew,brew安装也很简单只需要在命令行输入: |
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
# 查看要通过brew卸载的旧版本软件,可以使用下面命令 | |
brew cleanup -n | |
# 删除erlang | |
brew uninstall erlang --force | |
使用 brew 查询软件 | |
brew search /wge*/ |
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
# 当res 是 json格式的str时,loads会将其转为dict | |
# 通常用于,从json文件中读入数据,并使用 | |
res = json.loads(res) | |
# 当 res 是 dict时,使用dumps将其转为json | |
res = json.dumps(res) |
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
#删除文件 | |
os.remove(my_file) | |
# 删除目录 path,要求path必须是个空目录,否则抛出OSError错误 | |
os.rmdir(path) | |
# 删除目录 path, path不需要为空目录,该方法不能删除文件 | |
import shutil | |
shutil.rmtree(path) |
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
9377deMac-mini:~ a9377$ brew list jenkins | |
/usr/local/Cellar/jenkins/2.166/bin/jenkins | |
/usr/local/Cellar/jenkins/2.166/bin/jenkins-cli | |
/usr/local/Cellar/jenkins/2.166/homebrew.mxcl.jenkins.plist | |
/usr/local/Cellar/jenkins/2.166/libexec/ (2 files) |
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
# 查看自己全局安装过的包 | |
-g:全局的安装包 | |
list:已安装的node包 | |
npm list -g --depth 0 |
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 pandas as pd | |
import traceback | |
excel_path = 'toy_execl.xlsx' | |
sheet = pd.read_excel(excel_path, sheet_name='余额表-对账表汇总 (2)') | |
shdict = {} | |
for index, row in sheet.iterrows(): |
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
实例1:从远处复制文件到本地目录¶ | |
$scp [email protected]:/opt/soft/demo.tar /opt/soft/ | |
说明: 从10.6.159.147机器上的/opt/soft/的目录中下载demo.tar 文件到本地/opt/soft/目录中 | |
实例2:从远处复制到本地¶ | |
$scp -r [email protected]:/opt/soft/test /opt/soft/ | |
实例3:上传本地文件到远程机器指定目录¶ | |
$scp /opt/soft/demo.tar [email protected]:/opt/soft/scptest | |
说明: 复制本地opt/soft/目录下的文件demo.tar 到远程机器10.6.159.147的opt/soft/scptest目录 |
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
df -h 命令查看整个硬盘的大小 ,-h表示人可读的 | |
du -d 1 -h 命令查看当前目录下所有文件夹的大小 -d 指深度,后面加一个数值 |