Blog

  • npm使用淘宝的registry

    遇到过 forever 装不上的情况

    /usr/bin/npm install forever -g
    
    701 error Error: shasum check failed for /root/tmp/npm-5826-Ev6S_4GZ/1438247556786-0.7053809177596122/tmp.tgz
    701 error Expected: 4353b88b7131797fb5520e39eba263df5863cba3
    701 error Actual:   28322c7853c55e33081b19337d4e5359b8cceaae
    701 error     at /usr/lib/node_modules/sha/index.js:38:8

    换成淘宝的registry后正常。

    npm config set registry http://registry.npm.taobao.org/
  • mac terminal 查词典

    在 mac 的 terminal 下打开词典并查 blog

    open dict://blog

    要输入的命令有点长,于是在 ~/.zshrc 中添加函数

    dict(){
      open dict://$1
    }

    在 terminal 中可以这样查 dict blog

  • git Your branch and ‘origin/master’ have diverged

    On branch master

    Your branch and ‘origin/master’ have diverged,

    and have 7 and 8 different commits each, respectively.

    处理方法

    git rebase origin/master

  • nginx 关闭 error_log

    error_log off并不能关闭日志记录功能,它将日志文件写入一个文件名为off的文件中,如果你想关闭错误日志记录功能,应使用以下配置:

    error_log /dev/null crit;

    把存储位置设置到Linux的黑洞中去

  • vim打开文件

    vim 打开文件并跳到最后一行

    vim + filename

    vim 打开文件并跳到指定行

    vim +n filename

    vim 打开两个文件,并以 vsplit 显示

    vim -O file1 file2

    vim 打开两个文件,并以 split 显示

    vim -o file1 file2

    save all

    :wqa
    

    vim can open .zip, .tar.gz files, to prview the filenames in side the package.

  • 查看nfs的挂载情况

    对于 nfs server ,查看有哪些客户端连过来

    showmount -a