lsblk
parted /dev/sda
(parted) u MiB
(parted) rm 1
(parted) mklabel gpt
(parted) mkpart primary 1 100%
lsblk
parted /dev/sda
(parted) u MiB
(parted) rm 1
(parted) mklabel gpt
(parted) mkpart primary 1 100%
import logging | |
import pika | |
import time | |
LOG_FORMAT = ('%(levelname) -1s %(asctime)s %(name) -1s %(funcName) ' | |
'-1s %(lineno) -5d: %(message)s') | |
LOGGER = logging.getLogger(__name__) | |
user="user" |
find . -regextype sed -regex ".*/af/[0-9]\{1,\}/[0-9]\{1,\}/[0-9]\{1,\}.json"
Sub Main
xsh.Screen.Send("export update_dir=/root/zhouwei/")
xsh.Screen.Send(VbCr)
xsh.Screen.Send("cd /data && rm -rf `date +%Y%m%d` && cd $update_dir && rm * -rf")
xsh.Screen.Send(VbCr)
xsh.Screen.Send("scp root@10.227.101.23:/root/soc_env/CloudSocEnv*.tar.gz .")
xsh.Screen.Send(VbCr)
xsh.Screen.WaitForString "root@10.227.101.23's password:"
xsh.Screen.Send("kenchow")
rename 's/oldString/newString/' *
比如:before_a_dog.txt替换以后为after_a_dog.txt
sed -i "s/oldString/newString/g" `grep oldString -rl /path`
sudo service mysql stop && sudo apt-get --purge remove "mysql*" && sudo rm -rf /etc/mysql/ && sudo rm -rf /var/lib/mysql && sudo apt-get autoremove |
#!/bin/bash | |
# Stop all containers | |
docker stop $(docker ps -a -q) | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
add-apt-repository ppa:certbot/certbot | |
apt update | |
apt install certbot | |
certbot certonly --webroot -w /usr/share/nginx/html -d weibot.top -m weiofcn@gmail.com --agree-tos |