Skip to content

Instantly share code, notes, and snippets.

View xgz123's full-sized avatar
🎯
Focusing

xgz123 xgz123

🎯
Focusing
View GitHub Profile
@xgz123
xgz123 / ubuntu
Last active October 16, 2016 14:53
$ uname -a
Linux link-lxub1604 4.4.0-15-generic #31-Ubuntu SMP Fri Mar 18 19:08:31 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -r
Release: 16.04
sudo apt-get install openssh-server
sudo /etc/init.d/ssh restart
"build-css": "node-sass --include-path scss scss/main.scss public/css/main.css",
"watch-css": "nodemon -e scss -x \"npm run build-css\""
@xgz123
xgz123 / install.sh
Last active February 20, 2017 09:07
profile
# /etc/profile
# source /etc/profile
# nodejs
export NODE_HOME=/home/xgz/app/node-v6.3.0
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules
# prefix 是nodejs的node_prefix
# $PREFIX/lib/node
export PREFIX=/home
{
"color_scheme": "Packages/Materialize/schemes/Material One Dark.tmTheme",
"theme": "Material One Dark.sublime-theme",
"ignored_packages":
[
"Vintage"
],
"overlay_scroll_bars": "enabled",
"line_padding_top": 3,
"line_padding_bottom": 3,
C-v 向前翻页
M(meta/alt)-v 向后翻页
C-l 让光标位置居中
C-p/n-b/f 方向
M-p/n 按单词移动
C/M-a/e 行(句)开头和行尾
C-<> 文本开头和结尾
C-u 8 C-f 向前移动8位(C-v 则按行数移动)
C-u 8 * 输入8个*
C-g 停止命令
npm info jquery
npm info jquery version
nano ~/.npmrc //打开配置文件
registry =https://registry.npm.taobao.org //写入配置文件
# "root" does not have permission to access the dev dir
npm install --unsafe-perm --verbose -g <package-name>
@xgz123
xgz123 / docker.sh
Last active January 17, 2017 06:31
# 指定了要提交的修改过的容器的ID、目标镜像仓库、镜像名
sudo docker commit 614122c0aabb aoct/apache2
sudo docker commit -m='A new image' --author='xx' 614122c0aabb aoct/apache2
docker tag image_id new_tag # change tag
# install
yum -y install docker-io
# start
# 安装pip
python get-pip.py
# where is site package
# sudo apt-get install 安装的package存放在 /usr/lib/python2.7/dist-packages目录中
# pip 或者 easy_install安装的package存放在/usr/local/lib/python2.7/dist-packages目录中
import site; site.getsitepackages()
# virtualenv
virtualenv ENV
// ImportError: cannot import name inputstream
pip install html5lib==1.0b8
# 1, 重写历史
# https://git-scm.com/book/zh/v1/Git-%E5%B7%A5%E5%85%B7-%E9%87%8D%E5%86%99%E5%8E%86%E5%8F%B2
git commit --amend # 修改最近一次提交
git rebase -i HEAD~3 # 交互式修改最近三次提交, 通过命令p(使用)/s(压制)/e(修改)做修改,删除,合并commit等操作
git rebase -i --root # 如果只有两次提交
git reset --hard HEAD~3 # 撤销最近三次提交,文件也恢复, 这三次丢失
# 找回历史
git reflog