Tag:Small inkstone

  • Go multi process record execution results

    Time:2022-6-7

    package main import ( “fmt” “sync” “time” ) //Simulate a time-consuming task func job(worker int)int{ time.Sleep(time.Millisecond*500) return worker } func main(){ //Record start time start:=time.Now() wg:=sync.WaitGroup{} //Initializing the channel is used to record the work results of each task reciveChan :=make(chan int) //Cycle through 5 tasks for i:=0;i<5;i++{ wg.Add(1) go func(par int) { //Save task […]

  • Firewalld operation

    Time:2022-5-22

    #Start firewalld service systemctl start firewalld.service #Enable power on self starting firewalld service systemctl enable firewalld.service #Release port to “192.168.10.0/24″ firewall-cmd –permanent –add-rich-rule=”rule family=”ipv4″ source address=”192.168.10.0/24″ port protocol=”tcp” port=”8080″ accept” #The port is prohibited from being accessed by “192.168.10.0/24″ firewall-cmd –permanent –add-rich-rule=”rule family=”ipv4″ source address=”192.168.10.0/24″ port protocol=”tcp” port=”9999″ drop” #Reload configuration rules firewall-cmd –reload This […]

  • A script that counts the percentage of memory usage

    Time:2022-5-19

    A script that counts the percentage of memory usage #!/bin/bash #Author YangLei #yum install -y bc change_rate_uv=`echo “scale=2; $(free -m|awk ‘{print $3}’ |sed -n ‘2p’)/$(free -m|awk ‘{print $2}’ |sed -n ‘2p’) * 100 “|bc`% if [ `echo $change_rate_uv|cut -c 1` == “.” ]; then change_rate_uv=0$change_rate_uv fi echo $change_rate_uv shell linux This work adoptsCC agreement, reprint […]

  • P7zip decompress more than 4G compressed packages

    Time:2022-5-16

    P7zip decompress more than 4G compressed packages Note: please download the offline installation package in the network disk Link:pan.baidu.com/s/1q8c5nmnEMt1r6IkMu…Extraction code: tkca #Install dependent Libraries yum install glibc.i686 #Decompress tar -xjpf p7zip_9.20.1_x86_linux_bin.tar.bz2 mv p7zip_9.20.1/bin/7za /usr/bin rm -rf p7zip_9.20.1 p7zip_9.20.1_x86_linux_bin.tar.bz2 #Decompresszip包命令 7za x date.zip linux 7za This work adoptsCC agreement, reprint must indicate the author and the […]

  • Openssh upgrade (from openssh_7.4p1 to openssh_8.4p1) [operation Script]

    Time:2022-5-14

    Openssh upgrade (from openssh_7.4p1 to openssh_8.4p1) ##–Status before upgrade [[email protected] ~]# ssh -V OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017 ##–Start upgrade wget -c https://ftp.openssl.org/source/openssl-1.1.1h.tar.gz wget -c https://openbsd.hk/pub/OpenBSD/OpenSSH/portable/openssh-8.4p1.tar.gz yum install -y gcc gcc-c++ glibc make autoconf openssl openssl-devel pcre-devel pam-devel yum install -y pam* zlib* mv /usr/bin/openssl /usr/bin/openssl_bak mv /usr/include/openssl /usr/include/openssl_bak tar xfz openssl-1.1.1h.tar.gz cd openssl-1.1.1h […]

  • NFS server setup

    Time:2022-5-10

    Service installation yum install -y nfs-utils Configure shared directory #cat /etc/exports #Shared directory path setting authorization network segment setting permission /app/nfs-shared 192.168.10.0/24(rw,no_root_squash,sync,no_wdelay) Service startup and self startup systemctl start nfs systemctl enable nfs The firewall releases the network segment to be connected to NFS #firewall-cmd –permanent –add-rich-rule=”rule family=”ipv4″ source address=”192.168.10.0/24″ port protocol=”tcp” port=”111″ accept” firewall-cmd […]

  • Oracle common maintenance query

    Time:2022-5-2

    Check deadlock SELECT s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#, l.ORACLE_USERNAME,l.OS_USER_NAME,l.PROCESS FROM V$LOCKED_OBJECT l,V$SESSION S WHERE l.SESSION_ID=S.SID; Force deadlock release alter system kill session ‘1500,6160’; reference resourceswww.jb51.net/article/85039.htm Check the SQL of deadlock and the SQL executed before deadlock according to Sid –Deadlock time select sql_text from v$sqlarea a,v$session b where a.SQL_ID=b.SQL_ID and (b.SID=47 or b.SID=3847); –Before deadlock select sql_text from v$sqlarea […]

  • Create imagepullsecrets

    Time:2022-5-1

    Image key warehouse creation method I docker login -u admin -p **** 192.168.10.22:8888 kubectl create secret generic harborsecret \ –from-file=.dockerconfigjson=/root/.docker/config.json \ –type=kubernetes.io/dockerconfigjson kubectl get secret harborsecret –output=yaml Create image warehouse key mode 2 kubectl create secret docker-registry harborsecret \ –docker-server=192.168.10.22:8888 \ –docker-username=admin \ –docker-password=**** –docker-em[email protected] Imagepullsecrets is configured in the controller spec: containers: – name: […]

  • Install mwget

    Time:2022-4-30

    yum install -y openssl openssl-devel bzip2 gcc gcc-c++ intltool python-pip zip unzip wget vim sshpass pip install –upgrade pip pip install –upgrade setuptools pip install cryptography paramiko wget http://jaist.dl.sourceforge.net/project/kmphpfm/mwget/0.1/mwget_0.1.0.orig.tar.bz2 tar -xjvf mwget_0.1.0.orig.tar.bz2 cd mwget_0.1.0.orig ./configure make -j4 make install #Test using mwget to download things mwget -c 8 https://www.baidu.com/favicon.ico linux wget mwget This work adoptsCC […]

  • Install ansible-2.4.2

    Time:2022-4-29

    wget https://releases.ansible.com/ansible/ansible-2.4.2.0.tar.gz tar -zxf ansible-2.4.2.0.tar.gz cd ansible-2.4.2.0 make install #sed -i ‘s/^#host_key_checking = False/host_key_checking = False/g’ /etc/ansible/ansible.cfg ansible This work adoptsCC agreement, reprint must indicate the author and the link to this article :kissing_ closed_ eyes:

  • readinessProbe & livenessProbe Demo

    Time:2022-4-28

    Readinessprobe & liveness probe three detection methods Httpget: send an HTTP request to check whether the service is normal, and return a 200-399 status code, indicating that the container is in a healthy state. Tcpsocket: perform TCP check on the IP and port of the container. If a TCP connection can be established, the container […]

  • Installing tcping for Linux

    Time:2022-4-26

    wget -O tcping https://soft.mengclaw.com/Bash/TCP-PING chmod +x tcping ./tcping -d 127.0.0.1 6379 This work adoptsCC agreement, reprint must indicate the author and the link to this article :kissing_ closed_ eyes: