记一些杂技(持续更新)
- 命令行连接shadowsocks客户端
sslocal -s IP -p PORT -l LOCAL_PORT -k PASSWORD -m 加密方式
- 修改npm源
在~/.npmrc
里添加下面这行
如果是用的 cnpm,需要添加到
~/.cnpmrc
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
# 安装包时指定源
npm install -gd package --registry=http://registry.npm.taobao.org
# 设置全局npm源码
npm config set registry http://registry.npm.taobao.org
- 查看sqlite表结构
.schema tab_name
- Ubuntu chromium安装Flash
sudo apt-get install chromium-browser
sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree --install
- Ubuntu rpm包转deb
sudo apt-get install alien
sudo alien xxx.rpm
- Ubuntu任务栏点击最小化
gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ launcher-minimize-window true
- Linux制作U盘镜像
dd if=ISOFILE of=/dev/sdX
- Docker中Python中文错误
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-8: ordinal not in range(128)
docker run -it --name python -e PYTHONIOENCODING=utf-8 -e LANG=en_US.utf8 -e LANGUAGE=en_US.utf8 -e LANG_ALL=en_US.utf8 -e LC_ALL=en_US.utf8 centos /bin/bash
或者进入容器执行以下指令设置字符集
export PYTHONIOENCODING=utf-8
export LANG=en_US.utf8
export LANGUAGE=en_US.utf8
export LANG_ALL=en_US.utf8
export LC_ALL=en_US.utf8
- 修改Linux PS1前缀
# .bashrc
PS1='\[\033[01;34m\]\w\[\033[00m\]\$ '
- 命令行设置代理
# .bashrc
export http_proxy=http://IP:PORT
export https_proxy=http://IP:PORT
- git使用Token
# .netrc
machine IP
login Username
password Token
- pip更新所有包
pip install -U $(pip freeze | awk '{split($0, a, "=="); print a[1]}')
- 通过SQLplus连接Oracle
sqlplus USER/PWD@//IP:PORY/DB_NAME
- 查询dblink的过来的表数据
select * from orders@lin_ks; # 表名@dblink名