This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
agent none | |
stages { | |
stage('stash') { | |
agent { label "master" } | |
steps { | |
script{ | |
def t = tool name: 'abc', type: 'org.jenkinsci.plugins.docker.commons.tools.DockerTool' | |
echo "${t}" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Import Nodesource RPM key (CentOS < 7). | |
rpm_key: | |
key: http://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL | |
state: present | |
when: ansible_distribution_major_version|int < 7 | |
- name: Import Nodesource RPM key (CentOS 7+).. | |
rpm_key: | |
key: https://rpm.nodesource.com/pub/el/NODESOURCE-GPG-SIGNING-KEY-EL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible my_server -m debug -a 'var=my_secret' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { | |
Set<Object> seen = ConcurrentHashMap.newKeySet(); | |
return t -> seen.add(keyExtractor.apply(t)); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 查看存在的alert | |
/mmiot/alertmanager-0.13.0.linux-amd64/amtool --alertmanager.url=http://192.168.76.10:9093 alert | |
/mmiot/alertmanager-0.13.0.linux-amd64/amtool --alertmanager.url=http://192.168.76.10:9093 -o extended alert |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible -i inventory all -m authorized_key \ | |
-a "user=vagrant key='{{ lookup('file', '/Users/jack/.ssh/id_rsa.pub') }}' path=/home/vagrant/.ssh/authorized_keys manage_dir=no" -u vagrant -k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location /device/images/ { | |
alias /usr/local/openresty/nginx/html/images/; | |
autoindex off; | |
try_files $uri =404; | |
access_log off; | |
expires 30d; | |
## No need to bleed constant updates. Send the all shebang in one | |
## fell swoop. | |
tcp_nodelay off; | |
## Set the OS file cache. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#nethogs: 按进程查看流量占用 | |
#iptraf: 按连接/端口查看流量 | |
#ifstat: 按设备查看流量 | |
#ethtool: 诊断工具 | |
#tcpdump: 抓包工具 | |
#ss: 连接查看工具 | |
#其他: dstat, slurm, nload, bmon |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## awk脚本结构 | |
awk ' BEGIN{ statements } statements2 END{ statements } ' | |
## 工作方式 | |
## 1.执行begin中语句块; | |
## 2.从文件或stdin中读入一行,然后执行statements2,重复这个过程,直到文件全部被读取完毕; | |
## 3.执行end语句块; | |
## print 打印当前行 | |
## 使用不带参数的print时,会打印当前行; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 启动服务 | |
systemctl start <服务项名称> | |
## 停止服务 | |
systemctl stop <服务项名称> | |
## 重启服务 | |
systemctl restart <服务项名称> |