我们记录,我们监控,我们管理

不做事,不BB

Problem

使用composer require 本地GitLab中的项目,会把.git文件夹一块拉进来,从而在commit的时候报子项目问题

Cause

在配置composer repositories时,type使用的是git,则在提取时,等同于git clone,则会连着.git一起clone下来

正确的方法应该是参考 https://docs.gitlab.com/ee/user/packages/composer_repository/

发布时

  1. 在项目中composer init 来生成composer.json
  2. 发布一个release或打一个tag
  3. 通过API发布Composer package,这一步需要access token

成功后会在项目的Package Registry的菜单下看到他

安装时

  1. 在Package Registry点详情进去也会看到相关命令
1
composer config repositories.<group_id> composer https://gitlab.example.com/api/v4/group/<group_id>/-/packages/composer/
  1. 需要设置access token,推荐–global,不然会在项目中留下auth.json,不宜提交
  2. 需要设置gitlab-domains
1
composer config gitlab-domains <你的GitLab地址>
  1. 如果你的GitLab是HTTP,还需要设置"secure-http": false
  2. composer require 你的包

对于Linux命令参数中被误解析成-xxx的参数问题,如

1
2
[root@HBSpy extreme]# rename -mib
rename: invalid option -- 'm'

可以在参数前加–

1
[root@HBSpy extreme]# rename -- -mib .mib extreme-*

参考: https://unix.stackexchange.com/questions/11376/what-does-double-dash-mean

More precisely, a double dash (–) is used in most bash built-in commands and many other commands to signify the end of command options, after which only positional arguments are accepted.
Example use: lets say you want to grep a file for the string -v - normally -v will be considered the option to reverse the matching meaning (only show lines that do not match), but with – you can grep for string -v like this:
grep – -v file

从CentOS-7-x86_64-Minimal编译安装Vim8

依赖

1
2
3
yum install python3 python3-devel
yum install ncurses ncurses-devel
yum install perl-devel perl-ExtUtils-Embed

configure参考

1
2
3
4
5
6
7
8
9
10
11
12
13
./configure --enable-pythoninterp=yes --enable-python3interp=yes --enable-multibyte --enable-luainterp=yes --enable-perlinterp=yes --enable-rubyinterp=yes --with-python3-command=python3 --enable-cscope

--with-features=TYPE tiny, small, normal, big or huge (default: huge)
# 默认就是huge了

--enable-python3interp=OPTS Include Python3 interpreter. default=no OPTS=no/yes/dynamic
# 这些interp根据说明应该是=yes

--with-python3-config-dir=PATH Python's config directory (deprecated)
# 这个已经deprecated了,改用--with-python3-command=python3

--enable-perlinterp=OPTS
# 启用就是事多,注意要装上面的依赖

make

1
2
3
4
cd src 			# 官方推荐你去src目录make
make distclean # if you build Vim before
make # 可以加-jN并行
sudo make install

XXX

enable了不等于装上了,之后最好vim --version查看下

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[root@localhost vim]# vim --version
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Feb 22 2021 14:47:31)
Included patches: 1-2541
Compiled by root@localhost.localdomain
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 +perl +title
-clientserver +job +persistent_undo -toolbar
-clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak +python3 +visualextra
+cryptv +lispindent +quickfix +viminfo
+cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape -lua -ruby +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval -mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save

你看这个lua和ruby的interp其实就没装上

UI Recorder jWebDriver 不支持括号开头的XPath, 如

1
(//input)[2]

原因在于jWebDriver错误的认为括号开头的是css selector

修改lib/elements.js

1
2
// using = /^\.?\//.test(value)?'xpath':'css selector';
using = /^(\.|\()?\//.test(value)?'xpath':'css selector';

1
$input = shell_exec($cmd = '/usr/bin/python3 ' . APP_PATH . "/library/OpsKG/input_jieba.py $input");

无输出,python其实并没有收到正确的中文输入,exec的中文编码问题

需要先设置exec的环境变量

1
2
putenv('LC_ALL=en_US.UTF-8');
$input = shell_exec($cmd = '/usr/bin/python3 ' . APP_PATH . "/library/OpsKG/input_jieba.py $input");

或在命令前export LANG=en_US.UTF-8;

Win10 内置的MD5 sum

1
2
3
4
$ CertUtil -hashfile /d/BaiduYunDownload/绳缚本事高清PDF版.pdf
SHA1 的 D:/BaiduYunDownload/绳缚本事高清PDF版.pdf 哈希:
253fab6e0318a28e4e49b5e776663397e253d7a1
CertUtil: -hashfile 命令成功完成。

lrzsz在tmux下并不可用,但有方法取消rz/sz的卡死状态

rz: 5次ctrl+x
sz: 4次ctrl+x

  • ctrl+a: 光标移到行首
  • ctrl+b: 光标左移一个字母
  • ctrl+c: 杀死当前进程
  • ctrl+d: 删除光标所在字母; 注意和backspace以及ctrl+h的区别,这2个是删除光标前的字符
  • ctrl+d: 退出当前 Shell
  • ctrl+e: 光标移到行尾
  • ctrl+f: 光标右移
  • ctrl+h: 删除光标前一个字符,同 backspace 键相同
  • ctrl+k: 清除光标后至行尾的内容
  • ctrl+l: 清屏,相当于clear
  • ctrl+r: 搜索之前打过的命令。会有一个提示,根据你输入的关键字进行搜索bash的history
  • ctrl+t: 交换光标位置前的两个字符
  • ctrl+u: 清除光标前至行首间的所有内容
  • ctrl+w: 移除光标前的一个单词
  • ctrl+y: 粘贴或者恢复上次的删除
  • ctrl+z: 把当前进程转到后台运行,使用fg命令恢复。比如top -d1 然后ctrl+z,到后台,然后fg,重新恢复
0%