shell [ 和 ]] 的区别
soruce
shell [ 和 ]] 的区别
区别一
[ ]是符合POSIX标准的测试语句,兼容性更强,几乎可以运行在所有的Shell解释器中
[[ ]]仅可运行在特定的几个Shell解释器中(如Bash等)
区别二:<和>在[[ ]]中用作排序,而[ ]不支持
区别三:[ ]中使用-a和-o表示逻辑与和逻辑或,[[ ]]使用&&和||来表示
[[ ]]不支持-a
区别四:在[ ]中==是字符匹配,在[[ ]]中是模式匹配
[[ "$name" == c* ]] && echo Y || echo N
# name=ccc
# [[ "$name" == c* ]] && echo Y || echo N
Y
# [...
tcpdump
soruce
tcpdump filter
https://www.wains.be/pub/networking/tcpdump_advanced_filters.txt
tcpdump advanced filters
========================
Sebastien Wains <sebastien -the at sign- wains -dot- be>
http://www.wains.be
###################################################################
This page is not updated anymore and contains mistakes ...
rsyslog
doc1
doc2
rsyslog
man rsyslog.conf
rsyslog 作为标准的syslog守护进程,预装在了大多数的Linux发行版中。在客户端/服务器架构的配置下,rsyslog同时扮演了两种角色:
1.作为一个syslog服务器,rsyslog可以收集来自其他设施的日志信息;
2.作为一个syslog客户端,rsyslog可以将其内部的日志信息传输到远程的syslog服务器。
当通过syslog机制来收集日志时,有3个必须要考虑到的重要事情:
1、设施层级: 监听何种类型的进程
2、严重性 (优先) 级别: 收集何种级别的日志消息
3、目标: 发送或记录日志消息到何处
现在我们更加深入地了解一下配置是如何定义的
设施层级定义了一种用来对内部系统进程进行...
Basic Jenkins
using agent
managing node
stackoverflow
cloudbees
credential
secret text和token看起来没什么差别
gitlab下载code的时候如果使用git协议,那么需要用到ssh类型的credential。
如果使用https协议,不需要用credential。
credential会发送给agent去使用,所以不需要在agent上面做任何配置。
但是有的时候有证书的问题,需要到agent上面去安装target git网站的证书。
ssh类型的credential是,你随便在某个机器上生成公钥和私钥,然后把公钥配置到gitlab,把私钥配置成jenkins的credential。
# git credential set...
tmt basic
Reference1
tmt brief
Test Management Tool
TMT基于Flexible Metadata Format,是一个测试管理工具。
使用tmt,你可以把测试配置、脚本与被测源码放到一起。
通过生成fmf格式的配置文件,包括test plan story,可以轻松的管理测试配置。
The tmt tool provides a user-friendly way to work with tests.
You can comfortably create new tests, safely and easily run tests across different environments,
review test results, debug...
tmt specification
Reference1
Specification
Core
adjust
# Disable a test for older distros
enabled: true
adjust:
enabled: false
when: distro < fedora-33
because: the feature was added in Fedora 33
# Adjust the required package name
require: procps-ng
adjust:
- require: procps
when: distro == centos-6
# Extend the environment variables, us...
JQ
Reference1
Reference2
Reference3
jq 语法
jq 是 stedolan 开发的一个轻量级的和灵活的命令行JSON处理器
jq 用于处理JSON输入,将给定过滤器应用于JSON文本输入,并在标准输出上将过滤器的结果生成为JSON。
yum install jq
jq [options] <jq filter> [file...]
jq [options] --args <jq filter> [strings...]
jq [options] --jsonargs <jq filter> [JSON_TEXTS...]
-c 紧凑而不是漂亮的输出;
-n ...
SYNCE & DPLL
Reference1
Reference2
Reference3
Reference4
Clock
In everyday usage, the term clock refers to a device that maintains and displays the time of day and perhaps the date.
In the world of electronics, however, clock refers to a microchip that generates a clock signal,
which is used to regulate the timing and speed of the components on a circu...
共计 109 篇文章,14 页。