基础
元组
- 不可变性:元组一旦创建就不能修改,这使得元组在某些情况下比列表更安全。
- 存储:可以存储不同类型的数据。
- 性能:由于元组的不可变性,它们通常比列表有更快的访问速度。
- 用途:适合用于存储不需要修改的数据集合,如函数返回多个值时。
- 语法:使用逗号
,
来定义,圆括号()
可省略。
1 | # best_language = ('python',) |
https://github.com/Requarks/wiki?tab=readme-ov-file
https://docs.requarks.io/install/docker
1 | MySQL root@localhost:wiki> SHOW VARIABLES like "auto_increment%"; |
auto_increment_offset : AUTO_INCREMENT列值的起点,也就是初始值。取值范围是1 .. 65535
auto_increment_increment : 控制列中的值的增量值,也就是步长。其默认值是1,取值范围是1 .. 65535
https://github.com/requarks/wiki/issues/1485
Incorrect groups auto-increment configuration! Should start at 0 and increment by 1. Contact your database administrator.
MySQL wikijs@localhost:wiki> truncate
groups
You’re about to run a destructive command.
Do you want to proceed? (y/n): y
Your call!
(1701, ‘Cannot truncate a table referenced in a foreign key constraint (wiki
.usergroups
, CONSTRAINTusergroups_groupid_foreign
)’)#SET FOREIGN_KEY_CHECKS=0;
/etc/my.cnf 设置
http://www.ansible.com.cn/docs/galaxy.html
https://galaxy.ansible.com/ui/search/
1 | ansible-galaxy search 在galaxy上搜索角色 |
#从文件中下载角色到指定路径
ansible-galaxy install -r galaxyroles.yml -p /home/greg/ansible/roles/
cat galaxyroles.yml
- src: http://materials/ phpinfo.tar
name: phpinfo
http://www.ansible.com.cn/docs/galaxy.html
https://galaxy.ansible.com/ui/search/
1 | ansible-galaxy search 在galaxy上搜索角色 |
#从文件中下载角色到指定路径
ansible-galaxy install -r galaxyroles.yml -p /home/greg/ansible/roles/
cat galaxyroles.yml
- src: http://materials/ phpinfo.tar
name: phpinfo
https://docs.gitlab.com/ee/install/docker.html
1 | mkdir -p /mnt/oss/gitlab/{config,logs,data} |
docker-compose.yml
version: '3.6'
services:
web:
image: 'gitlab/gitlab-ce:16.6.2-ce.0'
restart: always
container_name: gitlab
# hostname: 'gitlab-ce' #hostname标签是设置容器的主机名
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.ui.k8s.cn:18443'
letsencrypt['enable'] = false
gitlab_rails['gitlab_ssh_host'] = 'gitlab.ui.k8s.cn'
gitlab_rails['gitlab_shell_ssh_port'] = 2224
gitlab_rails['gravatar_enabled'] = true
#### For HTTPS
gitlab_rails['gravatar_ssl_url'] = "https://seccdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"
#### Use this line instead for HTTP
# gitlab_rails['gravatar_plain_url'] = "http://cdn.libravatar.org/avatar/%{hash}?s=%{size}&d=identicon"
#gitlab_rails['initial_root_password'] = 'c123456;'
#复制crt证书到挂载目录
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.ui.k8s.cn.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.ui.k8s.cn.key"
#配置http自动跳转到https协议的地址;
nginx['redirect_http_to_https'] = true
nginx['enable'] = true
nginx['client_max_body_size'] = '250m'
#配置监听容器内的443端口,注意不是外面主机的443端口
nginx['listen_port'] = 443
nginx['ssl_protocols'] = "TLSv1.1 TLSv1.2"
nginx['logrotate_frequency'] = "weekly"
nginx['logrotate_rotate'] = 52
nginx['logrotate_compress'] = "compress"
nginx['logrotate_method'] = "copytruncate"
nginx['logrotate_delaycompress'] = "delaycompress"
nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on",
}
nginx['custom_error_pages'] = {
'404' => {
'title' => 'Example title',
'header' => 'Example header',
'message' => 'Example message'
}
}
# gitlab_rails['smtp_enable'] = true
# gitlab_rails['smtp_address'] = "smtp.example.com"
# gitlab_rails['smtp_port'] = 587
# gitlab_rails['smtp_user_name'] = "no-reply@example.com"
# gitlab_rails['smtp_password'] = "changeMeToSomethingGood"
# gitlab_rails['smtp_domain'] = "example.com"
# gitlab_rails['smtp_authentication'] = "login"
# gitlab_rails['smtp_enable_starttls_auto'] = true
ports:
- '8980:80'
- '18443:443'
- '2224:22'
volumes:
- '/mnt/oss/gitlab/config:/etc/gitlab'
- '/mnt/oss/gitlab/logs:/var/log/gitlab'
- '/mnt/oss/gitlab/data:/var/opt/gitlab'
- '/mnt/oss/gitlab/certs:/etc/gitlab/ssl'
shm_size: '256m'
gitlab-runner:
image: 'gitlab/gitlab-runner:v16.9.0'
restart: unless-stopped
container_name: 'gitlab-runner'
depends_on:
- web
privileged: true
extra_hosts:
- "gitlab.ui.k8s.cn:192.168.122.1" # 添加主机名
volumes:
- /mnt/oss/gitlab/runner/config:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock
- /mnt/oss/gitlab/certs/gitlab.ui.k8s.cn.crt:/home/gitlab-runner/gitlab.ui.k8s.cn.crt