sed -i.bak ‘s/name/name2222/g’ 1.txt
作者:judexie
如何解决 minikube 安装问题
rm -fr .minikube
minikube start minikube start –image-mirror-country=cn
minikube start –vm-driver=kvm2 –registry-mirror=https://registry.docker-cn.com –image-mirror-country=cn –image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
docker mysql运行和验证
docker pull mysql
docker images
apt-get install mysql-client
docker run --name=mytestdb -p 3306:3306 -p 33060:33060 -e MYSQL_ROOT_PASSWORD=YourPassword -d mysql
mysql -h 127.0.0.1 -P 3306 -u root -p #注意使用localhost连接的时候,mysql client会使用 unix socket进行连接,所以要使用ip或者127.0.0.1而不是localhost
mysql 恢复忘记root密码脚本-centos
#!/bin/bash
newpassword=$1
if [ “$newpassword” == “” ];then
echo “password is emty. please use ./mysql_password_recovery.sh yourpassword”
exit
fi
echo ” Stopping mysql…”
systemctl stop mysqld
echo ” Setting the mySQL environment option..”
systemctl set-environment MYSQLD_OPTS=”–skip-grant-tables”
echo “Startng mysql ignoring password verification..”
systemctl start mysqld
echo “Updating the root user password with your provided password”
# mysql -u root
echo “UPDATE mysql.user SET authentication_string = PASSWORD(‘$newpassword’) WHERE User = ‘root’ AND Host = ‘localhost’;” | mysql -u root
echo “FLUSH PRIVILEGES;” | mysql -u root
#echo “quit” | mysql -u root
echo “Stopping mysql..”
systemctl stop mysqld
echo “Unsetting the mySQL envitroment option so it starts normally next time..”
systemctl unset-environment MYSQLD_OPTS
echo “Start mysql normally..”
systemctl start mysqld
echo “Try to login using your new password:”
mysql -u root -p
redis install注意点
1、 make MALLOC=libc
2、注意按照tcl
3、make test后
4、./utils/install_server.sh配置自动启动等
mysql default password
grep “temporary password” /var/log/mysqld.log
# grep “temporary password” /var/log/mysqld.log
2019-11-22T15:39:47.315529Z 1 [Note] A temporary password is generated for root@localhost: _Ow,eqT,c7pa
然后可以设置新密码:
SET PASSWORD = PASSWORD(“root”);
tmux quick usage
session management
tmux ls (or tmux list-sessions)
tmux new -s session-name
Ctrl-b d Detach from session
tmux attach -t [session name]
tmux kill-session -t session-name
Ctrl-b c Create new window
Ctrl-b d Detach current client
Ctrl-b l Move to previously selected window
Ctrl-b n Move to the next window
Ctrl-b p Move to the previous window
Ctrl-b & Kill the current window
Ctrl-b , Rename the current window
Ctrl-b q Show pane numbers (used to switch between panes)
Ctrl-b o Switch to the next pane
Ctrl-b ? List all keybindings
moving between windows
Ctrl-b n (Move to the next window)
Ctrl-b p (Move to the previous window)
Ctrl-b l (Move to the previously selected window)
Ctrl-b w (List all windows / window numbers)
Ctrl-b window number (Move to the specified window number, the
default bindings are from 0 — 9)
Tiling commands
Ctrl-b % (Split the window vertically)
CTRL-b ” (Split window horizontally)
Ctrl-b o (Goto next pane)
Ctrl-b q (Show pane numbers, when the numbers show up type the key to go to that pane)
Ctrl-b { (Move the current pane left)
Ctrl-b } (Move the current pane right)
Make a pane its own window
Ctrl-b : “break-pane”
add to ~/.tmux.conf
bind | split-window -h
bind – split-window -v
awk quick
awk ‘$9 == “404” {print $7}’ access.log |sort|uniq -c|sort -rn| head -n 50 # List top 50 404 (not found) pages from requests to your website in descending order.
linux快速模拟cpu 100%方法
用原生 centos 自带工具,方法是通过压缩随机数据并将结果发送到 /dev/null
cat /dev/urandom | gzip -9 > /dev/null
CPU 使用率到达 99%。
yum update发生异常出现kernel panic的解决
1、重启虚拟机或者物理机
2、在启动项时,选择之前老版本的kernel进行启动
3、进入虚拟机后,执行yum reinstall kernel
4、重新安装成功后,再次尝试重启