分类 默认分类 下的文章

BASH小工具(2)

jq

用于命令行处理json数据

  • https://github.com/stedolan/jq
  • https://www.ibm.com/developerworks/cn/linux/1612_chengg_jq/index.html

xmlstarlet

用于命令行处理xml文档

  • https://www.ibm.com/developerworks/cn/xml/x-starlet.html
  • http://xmlstar.sourceforge.net/

VSCODE

open new tab for edit file

{
    "git.ignoreMissingGitWarning": true,
    "window.zoomLevel": 0,
    "workbench.colorTheme": "Quiet Light",
    "extensions.ignoreRecommendations": true,
    "http.proxyStrictSSL": false,
    "http.proxy": "",
    "workbench.editor.enablePreview": false
}

PY科学计算

link memo

https://www.jianshu.com/p/9f6a9456ad5f
https://blog.csdn.net/qq_22022063/article/details/78979367
https://www.jianshu.com/p/68be3a7bd7b7
https://blog.csdn.net/rumswell/article/details/8927603
https://www.cnblogs.com/misswangxing/p/7903595.html
https://www.ixueshu.com/
http://wiki.jikexueyuan.com/project/start-learning-python/311.html

install pyenv and config

curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
pyenv install --list
pyenv install 3.6.3
pyenv rehash
pyenv versions
pyenv local 3.6.3 # set current folder 
python --version

set python3 venv

python3 -m venv ./venv
source venv/bin/activate # use venv
deactivate # exit venv

use douban as pypi source

vi ~/.pip/pip.conf
----------
[global]
index-url=http://pypi.doubanio.com/simple

[install]
trusted-host=pypi.doubanio.com

readline and tab-complete for python interact

yum -y install ncurses-devel patch
pip install gnureadline
wget -O repl.py -P /path/to/sys https://raw.githubusercontent.com/lilydjwg/winterpy/master/pylib/cli.py
python
>>> import repl

注意: 使用pip install readline不行; gcc需要使用4.7

pandas numpy error

pip uninstall numpy
pip install numpy==1.14.5

解决matplotlib.pyplot的依赖问题(bzip2,tkinter)

yum install bzip2-devel tkinter tk-devel
pyenv install 3.6.3 # reinstall
cd /root/.pyenv/versions/3.6.3/lib/python3.6/lib-dynload
cp ~/_bz2.cpython-36m-x86_64-linux-gnu.so ./
ln -s /usr/lib64/libbz2.so.1.0.6 /usr/lib64/libbz2.so.1.0

matplotlib.pyplot display undefine

vi ~/.bash_profile
----------
export MPLBACKEND="agg"
----------
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.show()
plt.savefig('table.png')

艺术进阶

about color and design

http://vdisk.weibo.com/u/3740738601
http://vdisk.weibo.com/u/1158082872

about guitar and music

https://musicbody.net/
https://github.com/Audiveris/audiveris

sharing site

https://imgur.com/

project based on nodejs

package.json cheat sheet

  • "name": "foo" // 包名称(全局唯一)
  • "private": true, // 阻止项目发布到www.npmjs.com
  • "main": "index.js" // 模块的入口,可通过require()加载
  • "bin": { "appname": "/path/to/appfile" } // 可执行文件路径
  • "bin": "/path/to/appdir/" // 可执行文件所在目录
  • "scripts": {"start": "ss -tnl"} // 脚本命令字典
  • "config": {"port": "8080"} // npm config set foo:port 8080
    // browser指定提供浏览器使用的版本(browserify打包)
  • "browser": {"tipso": "./node_modules/tipso/src/tipso.js"}

package.json some defaut config

  • "scripts": {"start": "node server.js"}
  • "scripts":{"preinstall": "node-gyp rebuild"}

use node_env variable

$ npm install cross-env --save-dev
$ cross-env NODE_ENV=development webpack --config build/webpack.config.js

History API

  • History.replaceState : 修改HIS栈最新的一项历史
  • History.pushState : 向HIS栈添加一个状态对象
  • PopStateEvent : 当前活动历史发生改变时触发

referrence

https://cnodejs.org/topic/56ed0cdf515e7305367f0df7
https://www.cnblogs.com/nullcc/p/5829218.html
https://developer.mozilla.org/zh-CN/docs/Web/API/History
https://github.com/browserify/browserify-handbook

www.000webhost.com