Author: jpuyy

  • 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
  • linux desktop reboot shutdown hang处理

    linux desktop 当点击重启或关机,或通过命令,都会卡在

    restarting system
    shutting down system

    解决办法:

    centos 7 为例

    编辑

    sudo vim /etc/grub2.cfg

    在启动项一行最后添加 reboot=bios

    inux16 /boot/vmlinuz-3.10.0-123.el7.x86_64 root=UUID=e27de799-ef92-4a09-99cf-dde69fe13e88 ro vconsole.keymap=us crashkernel=auto vconsole.font=latarcyrheb-sun16 rhgb quiet reboot=bios

    参考:http://linux.koolsolutions.com/2009/08/04/howto-fix-linux-hangfreeze-during-reboots-and-restarts/

  • git clone很大的 repo

    如果一个 git 库有太长的 history,clone 一份需要好长时间,那么可以考虑不 clone 太长的 history.

    git clone --depth depth remote-url

    例如

    git clone --depth 2 https://github.com/torvalds/linux.git

    这样git log 只会看到两条记录

    参考:http://blogs.atlassian.com/2014/05/handle-big-repositories-git/