shell 密码生成
echo \`< /dev/urandom tr -dc \_A-Z-a-z-0-9 | head -c32\`
或者
yum install pwgen
pwgen 12位随机密码
列出所有变量
set
查看二进制文件内容
hexdump /usr/sbin/init > 1.txt
检测修复磁盘
e2fsck
随机数取
import random
print (random.randrange(1,29))
vim 粘贴格式乱
set paste
清理cache内存
/etc/sysctl.conf
vm.drop\_caches = 1
vm.drop\_caches = 2
vm.drop\_caches = 3
操作机录写入message
vim rsys.sh
cat >> /etc/profile <<EOF
HISTFILESIZE\=2000
HISTSIZE\=2000
HISTTIMEFORMAT\="%Y%m%d-%H%M%S: "
export HISTTIMEFORMAT
export PROMPT\_COMMAND\='{ command=$(history 1 | { read x y; echo $y; }); logger -p local1.notice -t bash -i "user=$USER,ppid=$PPID,from=$SSH\_CLIENT,pwd=$PWD,command:$command"; }'
EOF
echo "127.0.0.1 secaudit.xf.conf" >>/etc/hosts
echo ':msg,contains, "Did not receive identification string from 127.0.0.1" ~' >>/etc/rsyslog.conf
echo "authpriv.\* @secaudit.xf.conf" >>/etc/rsyslog.conf
echo "local1.notice @secaudit.xf.conf" >>/etc/rsyslog.conf
service rsyslog restart
安装桌面图形化
yum groupinstall "GNOME Desktop" "Graphical Administration Tools"
systemctl set-default graphical.target
configure时
vim auto/cc/gcc
#debug
#CFLAGS="$CFLAGS -g" ##这一行注释起来,关闭编译时的调试模式,这样编译得到的源码包的大小会减少很多
centos7阿里云源安装
wget \-O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget \-O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo