2019/10/09

Upgrade Jenkins

wget http://updates.jenkins-ci.org/download/war/2.199/jenkins.war

cp -rp /usr/share/jenkins/jenkins.war cp -rp /usr/share/jenkins/jenkins.war.bak
cp jenkins.war /usr/share/jenkins/jenkins.war
kill -9 [java -jar /usr/share/jenkins/jenkins.war]
start jenkins again

2019/09/18

Linux resource checking basic command


top

ps -eo user,pcpu,pmem
ps -eo user,pcpu,pmem |sort -r -k3
free -m
## Free Memory = ( Total - Used + Buffer + Cache )
## Memory Utilized = (( Total - Free ) / Total) * 100 
ulimit -a
ulimit -c
df -h
df -i netstat -an |egrep "LISTEN|ESTABLISHED" |grep -v "LISTENING" telnet ${IP} ${port}
dd if=/dev/zero of=/tmp/testfile bs=1G count=1 oflag=direct

2019/08/06

Version Semantic

In essence a semantic version looks like this:
Major.Minor.Patch

v0.0.0 // New project
v0.1.0 // Add some functionality
v0.2.0 // Add other new functionality
v0.2.1 // Fix bug
v0.3.0 // Add some functionality
v0.3.1 // Fix bug
v0.3.2 // Fix bug
v0.3.3 // Fix bug
v0.3.4 // Fix bug
v0.4.0 // Add some functionality
v0.4.1 // Fix bug
v0.4.2 // Fix bug
v1.0.0 // Code is being used in production
v1.1.0 // Add some functionality
v1.2.0 // Add other new functionality
v1.2.1 // Fix bug
v2.0.0 // Implement changes that causes public API of code to become backwards incompatible
...
(from: https://www.jvandemo.com/a-simple-guide-to-semantic-versioning/)

2019/07/25

easy generate ssh key pair .pem


ssh-keygen -f id_rsa -y >private.pub
ssh-keygen -f private.pem -y >private.pub
cat private.pub >authorized_keys

2019/07/19

Other docker

😁 Overlay2 Cleaning 
docker system prune -a

😁 Host resource accessing
# cat /mycephfs/swarm_app/prometheus/compose_node_exporter/docker-compose.yml
version: '3.2'
services:
  nodeexporter:
    image: 10.138.47.238:8123/epd/node-exporter:v0.18.0
    container_name: EPD_nodeexporter
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /:/rootfs:ro
    command:
      - '--path.procfs=/host/proc'
      - '--path.rootfs=/rootfs'
      - '--path.sysfs=/host/sys'
      - "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc|dev|proc|run|sys|/boot/.+|var/lib/docker/.+)($$|/)"
    ports :
    - 9100:9100