小编Coc*_*dit的帖子

gitlab初始root密码

我正在尝试对 gitlab 进行自动化部署,所有内容都已预先配置。我需要指定初始 root 密码,以便首次登录时不会出现密码重置屏幕提示。我在模板中看到综合配置选项:https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/files/gitlab-config-template/gitlab.rb.template#L509

506 #### Change the initial default admin password and shared runner registration tokens.
507 ####! **Only applicable on initial setup, changing these settings after database
508 ####!   is created and seeded won't yield any change.**
509 # gitlab_rails['initial_root_password'] = "password"
Run Code Online (Sandbox Code Playgroud)

然而,正如文档所说,该选项在安装后不会生效。因此,gitlab-ctl reconfigure正如我所测试的那样,使用不会部署这些更改。

当我尝试这篇文章中的解决方案时:

$ sudo gitlab-rake gitlab:setup RAILS_ENV=production GITLAB_ROOT_PASSWORD="Pa$$w0rd!" GITLAB_ROOT_EMAIL="gitlab@domain.com" DISABLE_DATABASE_ENVIRONMENT_CHECK=1
This will create the necessary database tables and seed the database.
You will lose any previous data stored in the …
Run Code Online (Sandbox Code Playgroud)

gitlab gitlab-omnibus

29
推荐指数
4
解决办法
10万
查看次数

Sed和awk导致线环绕

我有一个表格的文件:

FA01_01:The birch canoe slid on the smooth planks  
FA01_02:Glue the sheet to the dark blue background
Run Code Online (Sandbox Code Playgroud)

我需要它的形式(也注意使用小写):

<s> the birch canoe slid on the smooth planks </s> (FA01_01)  
<s> glue the sheet to the dark blue background </s> (FA01_02)
Run Code Online (Sandbox Code Playgroud)

所以我用sed尝试了以下表达式:

sed 's/\(.......\):\(.*$\)/(\1) <s> \2 <\/s>/' tmp.dat
Run Code Online (Sandbox Code Playgroud)

但这是它返回的内容:

</s> (FA01_01)anoe slid on the smooth planks  
</s> (FA01_02)eet to the dark blue background
Run Code Online (Sandbox Code Playgroud)

无论出于何种原因,似乎sed导致被替换的模式环绕到行的开头但仅用于第二个匹配.例:

$> sed 's/\(.......\):\(.*$\)/\1 \2/' tmp.dat
FA01_01 The birch canoe slid on the smooth planks
Run Code Online (Sandbox Code Playgroud)

是的,但是

$>sed 's/\(.......\):\(.*$\)/\2 …
Run Code Online (Sandbox Code Playgroud)

regex unix awk sed

4
推荐指数
1
解决办法
390
查看次数

标签 统计

awk ×1

gitlab ×1

gitlab-omnibus ×1

regex ×1

sed ×1

unix ×1