Linux命令备忘

端口转发

# socat TCP-LISTEN:80,fork,reuseaddr TCP:XXX:80
# nc -c nc XXX 80 -l 80 -v -k

紧急救援

mount -o remount,rw /

即时HTTP Server

  • Python 2
python -m SimpleHTTPServer 8080
  • Python 3
python -m http.server 8080
python -m CGIHTTPServer 8080

下载Nexus

wget --user=userid --password=password 'https://nexusurl:8081/nexus/repository/<repository id>/<replace the grouf is . with />/<artifact id>/<version>/<file name>' -O ${WORKSPACE}/<new file name>

ipmitool

ipmitool -H ipaddress -I lanplus -U username -P password power status
ipmitool -H ipaddress -I lanplus -U username -P password power on
ipmitool -H ipaddress -I lanplus -U username -P password power off