curl -kv https://localhost:8443
p.s. tcp 8443, port to open ssl textcurl -vvv https://localhost:8443
p.s. verbose modecurl https://esv1-c-lfmt-01t.airbnb.biz:5601/api/status | python -m json.tool
print out as json formatopenssl s_client -connect 172.18.54.133:5601
Linux# cat 20200505_Whitelisting_Ips.csv | grep 202 | xclip (paste -> xclip -o)
MAC# cat 20200505_Whitelisting_Ips.csv | grep 202 | pbcop (paste -> pbpaste)
ls /etc/init.d
sudo systemctl status jira
sudo systemctl stop jira
sudo systemctl start jira
sudo systemctl restart network
tail -f /opt/atlassian/jira/logs/catalina.out
df -h
lsb_release -a
sudo /usr/local/bin/python3.9 -m venv /opt/my-envs/venv-python3.9
# Activate the Venv
source /opt/my-envs/venv-python3.9/bin/activate
sudo /opt/my-envs/venv-python3.9/bin/pip install --upgrade pip
python3.6 -m venv testenv
source testevn/bin/activate
pip3 install --upgrade pip
pip3 install -r requirements.txt
deactivate
cd /home/svc_jenkins/workspace/wlc-upgrader
sudo su svc_jenkins
chmod 655 infoblox.yaml
-rw-r-xr-x 1 awx awx 63 Mar 11 11:04 infoblox.yaml
”-”,普通文件.
”d”目录,字母”d”,是dirtectory(目录)的缩写.
“l”符号链接。请注意,一个目录或者说一个文件夹是一个特殊文件,这个特殊文件存放的是其他文件和文件夹的相关信息.
“b”块设备文件。
“c”字符设备文件。
紧接着的3*3个字符分3组,各指示此文件的读、写、执行权限,对于owner、group、others
777 = -rwxrwxrwx 可读,可写,可执行
655 = -rw-r-xr-x
400 = -r--------
紧接着的1代表文件或文档内文件的数量
紧接着的代表 user group
表示文件大小。文件大小用byte来表示,而空目录一般都是1024byte
表示文件名。我们可以用ls –a显示隐藏的文件名。
chown -R awx:awx infoblox.yaml
-r = recursive looking
rm -rf venv/
locate abc.json
!!
sudu !!
curl ifconfig.me
mv {*,*} ..
scp /Users/conor_wu/Downloads/AIR-CT5520-K9-8-8-130-0.aes zusa-n-abcd-tftp01.xyz.biz:/tmp
sudo vi /etc/ssh/sshd_config
PasswordAuthentication yes
useradd
userdel (可能需要在sudo su 模式下)
Permission Deny (public key) 问题
vi /etc/ssh/sshd_config
ChallengeResponseAuthentication no
PasswordAuthentication no(改成yes)
PrintMotd no
Subsystem sftp /usr/libexec/sftp-server
UsePAM yes
X11Forwarding no
-----------------
配置ssh jumphost 问题
vi .ssh/config
Host sftp
Hostname x.x.x.x
User conor_wu
Proxyjump 'ip of the jump host'
ControlPath ~/.ssh/%r@%h:%p
ControlMaster auto
ControlPersist 8h
PasswordAuthentication no
PubkeyAuthentication yes
IdentityFile ~/.ssh/id_rsa.pub #( or yubikey used to select yubikey.pub)
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
find /dir -name filename 在/dir目录及其子目录下面查找名字为filename的文件
find . -name "*.c" 在当前目录及其子目录(用“.”表示)中查找任何扩展名为“c”的文件
export command is used to export a variable or function to the environment of all the child processes running in the current shell.
$ export country=India
$ export -f functionname # exports a function in the current shell.
It exports a variable or function with a value. “env” command lists all the environment variables. In the following example, you can see that env displays the exported variable.
$ env
SESSIONNAME=Console
country=India
_=/usr/bin/env
ls -l | grep '^a' 通过管道过滤ls -l输出的内容,只显示以a开头的行。
grep 'test' d* 显示所有以d开头的文件中包含test的行。
grep 'test' aa bb cc 显示在aa,bb,cc文件中匹配test的行。
grep '[a-z]' aa 显示所有包含每个字符串至少有5个连续小写字符的字符串的行。
grep 'w(es)t.*' aa 如果west被匹配,则es就被存储到内存中,并标记为1,然后搜索任意个字符(.*),这些字符后面紧跟着另外一个es(),找到就显示该行。如果用egrep或grep -E,就不用""号进行转义,直接写成'w(es)t.*'就可以了。
grep -i pattern files :不区分大小写地搜索。默认情况区分大小写
diff “file_a” “file_a“
利用linux diff 命令,比较两个文档的 差别difference
-i ignore Case
-y side-by-side
-W 使用-y时指定间隙
-u 统一输出格式
> 输出区别到文件
说明:
“|”表示前后2个文件内容有不同
“<”表示后面文件比前面文件少了1行内容
“>”表示后面文件比前面文件多了1行内容
当前有一台服务器的内存使用情况如下所示(关于 free -m 命令的解释说明,详情请点击这里):
[root@host ~]# free -m
total used free shared buffers cached
Mem: 128662 128144 517 117 0 43240
-/+ buffers/cache: 84903 43758
Swap: 15999 15998 1
[root@host ~]#
上述服务器的 Swap 的空闲空间仅剩下 1 MB 了,同时物理内存的空间仅剩 517 MB ,而 cache 使用了物理内存中的 43240 MB ,所以此时我们先清理掉 cache 缓存,释放出大部分的物理内存:
[root@host ~]# sync; echo 1 > /proc/sys/vm/drop_caches
[root@host ~]#
[root@host ~]# free -m
total used free shared buffers cached
Mem: 128662 83393 45269 117 0 35
-/+ buffers/cache: 83358 45304
Swap: 15999 15998 1
[root@host ~]#
如上所示,清理掉 cache 缓存后物理内存的空闲空间达到了 45269 MB ,比 Swap 已使用空间更大了,此时执行清理 Swap 的命令(即关掉 Swap 后再开启,让 Swap 中的数据迁移到物理内存):
[root@host ~]# swapoff -a;swapon -a
此时如果您再开启一个命令行界面(比如另一个 ssh 连接)您将会看到 Swap 中的数据正一点一点地迁移到物理内存: