• Harbor Invalid Credentials

    查了两天这个问题.. 太难了.. core registry proxy 交差着看, 而且虽然有失败认证的报错, 但最后返回是200. nginx 里面还没有 xforward 信息.

    Harbor 代码也有不合理的地方, 其实有些请求不需要任何权限即可访问, 但是如果请求带了basic auth信息, Harbor也会验证, 密码不对就会导致用户被锁. 这样可以被攻击啊?

    Trace + log, 太重要了, 否则出了问题, 真是难查, 代码还不熟悉的情况下.

  • Life

    周六吃过午饭, 去山姆买奶粉. 然后回来打麻将, 输了800多, 晚上去吃了海底捞, 回来继续打到夜里3点, 还是没回本.

    周日睡到中午, 下午带小孩去滴水湖转了一圈, 吃了一个寿喜锅.

    今天早晨9点起来, 刷了个牙, 看他们带小孩回来了.

  • Restoring Container

    systemctl start docker 的时候, 总是 restoring container , 但又恢复不了, 一直卡着.

    /var/lib/docker 在这里找一下 container 目录, 删掉重启就好了, 可能需要 umout 先

    如果是 docker stop 失败。 可以上述操作后 docker rm -f

  • Life

    周六开车去大闸蟹, 回来6点了, 打了会麻将, 脑子不行, 一直输.

    周日做 Harbor 切换, 发现 Replication 问题, 查了一下午, 未果.

    9点起床. 西瓜早晨跟别人车走了. 我起来的时候小朋友已经睡啦, 据说昨天夜里4点醒了之后就没睡好, 醒醒停停的.

    没吃早饭, 上午好饿, 早早去食堂吃了, 然后买了杯 Manner 薄荷拿铁. 继续看 Harbor Replication 失败的问题.

  • How Can I Center The Window On Each Search Result

    https://vi.stackexchange.com/questions/13641/how-can-i-center-the-window-on-each-search-result

    https://stackoverflow.com/questions/45866451/put-the-search-results-at-the-top-of-the-screen-in-vi

    If you :set scrolloff=999 (or other arbitrarily high number) you will get the effect you are looking for but it doesn’t turn off. In other words, the cursor line will be midway between the top and bottom of the window whether you’re searching, editing, moving around in Normal mode, etc.

    From :help scrolloff:

    Minimal number of screen lines to keep above and below the cursor. This will make some context visible around where you are working. If you set it to a very large value (999) the cursor line will always be in the middle of the window (except at the start or end of the file or when long lines wrap).

    Try it out. Some people keep this on all the time. Maybe you’ll like it, too. We might also be able to figure out a mapping/script that enables it just while searching, too, but if you don’t want to mess around with a mapping with zz I imagine you don’t want to mess around with a mapping for this either.

  • Stap Find Which Process Send Udp

    systemtap 真好用

    stap -e 'probe netfilter.ip.local_out {
      if (dport == 53) # or parametrize
          printf("%s[%d %d] %s:%d\n", execname(), ppid(), pid(), daddr, dport)
    }'
    
  • Oom Kill

    Chapter 13 Out Of Memory Management

    13.4 Killing the Selected Process

    Once a task is selected, the list is walked again and each process that shares the same mm_struct as the selected process (i.e. they are threads) is sent a signal. If the process has CAP_SYS_RAWIO capabilities, a SIGTERM is sent to give the process a chance of exiting cleanly, otherwise a SIGKILL is sent.

    CAP_SYS_RAWIO 参考 capabilities(7) — Linux manual page

    如何查询一下进程的 capabilities How to find out what linux capabilities a process requires to work?

    $ getpcaps PID: = cap_chown,cap_dac_override,cap_fowner,cap_fsetid,cap_kill,cap_setgid,cap_setuid,cap_setpcap,cap_net_raw,cap_sys_chroot,cap_mknod,cap_audit_write,cap_setfcap+i

  • 国庆七天流水账

    前两天去南京和张家港参加章旭婚礼, 2号晚上回来. 三号下午去看了socket activation, 看了一下午, 还挺满足的. 四号打麻将, 三个人输了luckygirl 1000多 五号本科室友过来吃饭打牌 六号去姨家里, 七号吃过晚饭回来. 和三弟他们喝酒打牌, 三弟输了500多. 8号修车, 和三弟小蒋打牌, 三个人输了小蒋1000多.

  • Moral Kidnapping

    提前打个招呼, 不要道德绑架我, 我是个没有道德的人.

  • Demand For Browser

    在浏览器里面使用新页面打开一个链接后, 希望可以在这个新页面回退到前一个, 并且锚定在那个超链接上.

    有时候啪啪啪打开好多页面, 再看的时候(可能是第二天了)已经想不起来为啥打开这个页面了