支持从多个源同时下载,支持多线程
#从多个源下载
aria2c http://a/f.iso ftp://b/f.iso
#多线程下载
aria2c -x 2 http://a/f.iso
天空没有翅膀的痕迹,但我已飞过
世上的事,只要肯认真去学,没有一件是太晚的
支持从多个源同时下载,支持多线程
#从多个源下载
aria2c http://a/f.iso ftp://b/f.iso
#多线程下载
aria2c -x 2 http://a/f.iso
临时目录配置
http://manpages.ubuntu.com/manpages/bionic/man5/tmpfiles.d.5.html
临时目录清理命令
http://manpages.ubuntu.com/manpages/bionic/man8/systemd-tmpfiles.8.html
配置文件发在 /etc/tmpfiles.d/
配置文件内容示例
#Type Path Mode UID GID Age Argument d /root/download – – – 1h –
立即清理临时文件命令
sudo systemd-tmpfiles –clean
压缩 tar -czf aaa.tar.gz ./aaa
解压到当前文件夹
tar -xzf aaa.tar.gz
多行文本省略
-webkit-line-clamp
示例
关键css内容
.news-zuixin p {
font-size: 14px;
color: #888;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
display: -webkit-box;
-webkit-line-clamp: 2;
line-height: 20px;
height: 40px;
}
解压缩
gzip -d ./path/to/file
压缩文件
gzip -c name.txt
##/bin/bash
npm config set registry https://registry.npm.taobao.org
npm install
npm run build
cd dist
rm -rf new_dist.tar.gz
tar -zcvf new_dist.tar.gz *
## /bin/bash
cd /data/jenkins-npm-demo
mkdir -p dist
rm -rf new_dist
rm -rf old_dist
mkdir new_dist
tar -zxvf new_dist.tar.gz -C ./new_dist
mv ./dist ./old_dist
mv ./new_dist ./dist
pipeline语法
sshPublisher(
publishers: [
sshPublisherDesc(
configName: '192.168.7.66',
transfers: [
sshTransfer(
cleanRemote: false,
excludes: '',
execCommand: '''
cd /data/jenkins-npm-demo
mkdir -p dist
rm -rf new_dist
rm -rf old_dist
mkdir new_dist
tar -zxvf new_dist.tar.gz -C ./new_dist
mv ./dist ./old_dist
mv ./new_dist ./dist
''',
execTimeout: 120000,
flatten: false,
makeEmptyDirs: false,
noDefaultExcludes: false,
patternSeparator: '[, ]+',
remoteDirectory: '/data/jenkins-npm-demo',
remoteDirectorySDF: false,
removePrefix: 'dist',
sourceFiles: 'dist/new_dist.tar.gz')],
usePromotionTimestamp: false,
useWorkspaceInPromotion: false,
verbose: false
)
]
)
修改成清华镜像站
清华镜像站网址
https://mirrors.tuna.tsinghua.edu.cn/
https://www.cnblogs.com/ninefish/p/9818080.html
https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/update-center.json
https://jenkins.pentaq.com/pluginManager/advanced
docker中运行jenkins
##/bin/bash
docker run \
--rm \
--name jenkins-tutorials \
-u root \
-p 17780:8080 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
-v "$HOME":/home \
jenkinsci/blueocean
##nginx
location = / {
error_page 588 = @wordpress;
#如果有preview参数,则返回wordpress页面
if ($arg_preview) {
return 588;
}
add_header Cache-Control "no-store";
add_header Pragma "No-cache";
expires -1;
etag off;
root /data/pentaq-weui-wap/dist;
try_files $uri $uri/ /index.html;
}
location @wordpress {
root /data/var/www/trunk/app/news;
try_files $uri $uri/ /index.php?$args;
}
先启动备用服务,再停主服务,然后更新主服务代码,最后启动主服务关闭备用服务。
达成服务无缝更新。
##nginx
location / {
error_page 502 = @backup;
proxy_pass http://127.0.0.1:4000;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location @backup {
proxy_pass http://127.0.0.1:5000;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
gitlab打包了nginx, redis, postgresql, sidekiq 和 unicorn 服务。
也因此在安装gitlab的机器上你不能再独立安装nginx,你可以直接使用gitlab提供的nginx。
相关配置文件Location
/var/opt/gitlab
启动、重启命令gitlab-ctl start
gitlab-ctl stop
gitlab-ctl restart
更多信息gitlab-ctl status
gitlab-ctl help
只重启nginxsudo gitlab-ctl restart nginx