Skip to content

Instantly share code, notes, and snippets.

View alanwang93's full-sized avatar

Yifan WANG alanwang93

  • Tencent
  • Shanghai
View GitHub Profile
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
# cuda version
$ cat /usr/local/cuda/version.txt
@alanwang93
alanwang93 / unzip
Last active January 22, 2018 00:06
解压
.tar
解包:tar xvf FileName.tar
打包:tar cvf FileName.tar DirName
(注:tar是打包,不是压缩!)
———————————————
.gz
解压1:gunzip FileName.gz
解压2:gzip -d FileName.gz
压缩:gzip FileName
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
# Nohup
nohup command >filename 2>&1
# Screen
使用 screen 很方便,有以下几个常用选项:
用screen -dmS session name来建立一个处于断开模式下的会话(并指定其会话名)。
用screen -list 来列出所有会话。
用screen -r session name来重新连接指定会话。
@alanwang93
alanwang93 / .gitignore
Created December 15, 2017 20:21
.gitignore for python on OSX
*~
.DS_Store
*.DS_Store
*.zip
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
@alanwang93
alanwang93 / Git
Last active February 25, 2019 14:58
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
# 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
@alanwang93
alanwang93 / .vimrc
Last active April 29, 2019 02:55
vim configuaration
" 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