Blog

  • 迁移 kvm

    domain=rskwliyu
    host1=10.31.216.10
    host2=10.31.216.20
    echo “in $host1”
    echo “ssh $host2 ok”
    echo “cd /”
    echo “tar c etc/libvirt/qemu/$domain.xml data/kvm/$domain.img | nc -l 3389”

    echo “in $host2”
    echo “cd /”
    echo “nc $host1 3389 | tar x”

    echo “in $host1”
    echo “virsh migrate –live $domain qemu+ssh://$host2/system”

    echo “in $host2”
    echo “virsh edit $domain”
    echo “in guest curl put”

    echo “curl http://etcd.hupu.io:4001/v2/keys/hostvars/$host1/domain/$domain?recursive=true -XDELETE”

  • jobs

    Why join the navy if you can be a pirate? 如果能当海盗,为什么要去参加海军? ——steve jobs

  • 常用数字

    86400 sec= 1d

    2592000 sec = 30d

    1440 min=1d

  • linux 用户密码过期

    明明使用 公私钥 登陆,确提示密码不对。

    使用 chage 来防止密码过期。

    查看当前的过期时间

    chage -l vagrant
    Last password change					: never
    Password expires					: never
    Password inactive					: never
    Account expires						: never
    Minimum number of days between password change		: 0
    Maximum number of days between password change		: 99999
    Number of days of warning before password expires	: 7
    

    设置密码永不过期

    chage -m 0 -M 99999 -I -1 -E -1 vagrant
  • redis set使用

    统计集合 key 的 member 的数量

    SCARD hello:step:3000:obj_type0
  • gitlab fork库与源库保持更新

    fork 之后做自己的功能,要与源库进行功能合并时用 MergeRequest

    但是如果自己的库与源库落后太多,则可以这样

    查看远程 repo

    git remote -v

    如果里面只能看到你自己的两个源(fetch 和 push),那就需要添加主repo的源:

    git remote add upstream URL
    git remote -v
    

    如果想与主repo合并:

    git fetch upstream
    git merge upstream/master
    或 git rebase upstream/master