GitLab相关维护命令

  • 载入配置服务(初始化和修改/etc/gitlab/gitlab.rb 后需要重新载入)
    sudo gitlab-ctl reconfigure

  • 启动服务
    sudo gitlab-ctl start

  • 停止服务
    sudo gitlab-ctl stop

  • 重启服务
    sudo gitlab-ctl restart

  • 检查redis的日志
    sudo gitlab-ctl tail redis

  • 检查postgresql的日志
    sudo gitlab-ctl tail postgresql

  • 检查gitlab-workhorse的日志
    sudo gitlab-ctl tail gitlab-workhorse

  • 检查logrotate的日志
    sudo gitlab-ctl tail logrotate

  • 检查nginx的日志
    sudo gitlab-ctl tail nginx

  • 检查sidekiq的日志
    sudo gitlab-ctl tail sidekiq

  • 检查unicorn的日志
    sudo gitlab-ctl tail unicorn

  • 检查服务状态
    sudo gitlab-ctl status

0

计算一个数字能拆分计算的次数

编写一个函数persistence,它接受一个正参数num并返回其乘法持久性,即必须将num中的数字相乘到一个数字的次数。这是codewars上的一道习题,感觉挺有意思的。
示例:
persistence(39) === 3; // because 3 * 9 = 27, 2 * 7 = 14, 1 * 4 = 4 and 4 has only one digit
persistence(999) === 4; // because 9 * 9 * 9 = 729, 7 * 2 * 9 = 126, 1 * 2 * 6 = 12, and finally 1 * 2 = 2
persistence(4) === 0; // because 4 is already a one-digit number

代码:

function persistence(int $num): int {
   if($num<10) return 0;
        $split_arr = str_split($num);
        $res = array_product($split_arr);
        return 1+persistence($res);

}
0

程序动态函数库解析

ldd [-vdr] [fildname]

ldd /usr/bin/passwd

    linux-vdso.so.1 =>  (0x00007fffabbc2000)
libuser.so.1 => /lib64/libuser.so.1 (0x00007f72a8c58000)
libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007f72a8a08000)
libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f72a86f1000)
libpopt.so.0 => /lib64/libpopt.so.0 (0x00007f72a84e7000)
libpam.so.0 => /lib64/libpam.so.0 (0x00007f72a82d8000)
libpam_misc.so.0 => /lib64/libpam_misc.so.0 (0x00007f72a80d3000)
libaudit.so.1 => /lib64/libaudit.so.1 (0x00007f72a7eaa000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f72a7c83000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f72a7a66000)
libc.so.6 => /lib64/libc.so.6 (0x00007f72a7699000)
libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007f72a7495000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f72a725d000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f72a6ffb000)
libffi.so.6 => /lib64/libffi.so.6 (0x00007f72a6df3000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f72a6bee000)
libcap-ng.so.0 => /lib64/libcap-ng.so.0 (0x00007f72a69e8000)
/lib64/ld-linux-x86-64.so.2 (0x00005589b1a5b000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007f72a67e4000)
0