This file contains hidden or 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
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt |
This file contains hidden or 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
# cuda version | |
$ cat /usr/local/cuda/version.txt |
This file contains hidden or 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
.tar | |
解包:tar xvf FileName.tar | |
打包:tar cvf FileName.tar DirName | |
(注:tar是打包,不是压缩!) | |
——————————————— | |
.gz | |
解压1:gunzip FileName.gz | |
解压2:gzip -d FileName.gz | |
压缩:gzip FileName |
This file contains hidden or 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
pip install <package> -t <directory> | |
python setup.py install --home=HOME # HOME/lib/python shoud be in PYTHONPATH | |
The installation directory you specified (via --install-dir, --prefix, or | |
the distutils default setting) was: | |
/usr/local/lib/python3.6/site-packages/ | |
This directory does not currently exist. Please create it and try again, or | |
choose a different installation directory (using the -d or --install-dir |
This file contains hidden or 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
# Nohup | |
nohup command >filename 2>&1 | |
# Screen | |
使用 screen 很方便,有以下几个常用选项: | |
用screen -dmS session name来建立一个处于断开模式下的会话(并指定其会话名)。 | |
用screen -list 来列出所有会话。 | |
用screen -r session name来重新连接指定会话。 |
This file contains hidden or 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
*~ | |
.DS_Store | |
*.DS_Store | |
*.zip | |
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
*$py.class |
This file contains hidden or 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 new repository | |
$ mkdir helloworld | |
$ cd helloworld | |
$ git init | |
$ git add README.md | |
$ git commit -m "README for this project." | |
# git remote rm origin | |
$ git remote add origin url | |
$ git push -u origin master |
This file contains hidden or 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
# Working example for my blog post at: | |
# https://danijar.github.io/structuring-your-tensorflow-models | |
import functools | |
import tensorflow as tf | |
from tensorflow.examples.tutorials.mnist import input_data | |
def doublewrap(function): | |
""" | |
A decorator decorator, allowing to use the decorator to be used without |
This file contains hidden or 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
" To use it, copy it to | |
" for Unix and OS/2: ~/.vimrc | |
" for Amiga: s:.vimrc | |
" for MS-DOS and Win32: $VIM\_vimrc | |
" for OpenVMS: sys$login:.vimrc | |
"========================== | |
" set encoding=utf-8 | |
set fileencodings=utf-8,chinese,latin-1,gbk,gb18030,gk2312 | |
if has("win32") | |
set fileencoding=chinese |