root@localhost ~]# vim /etc/gdm/custom.conf [daemon] AutomaticLoginEnable=True AutomaticLogin=root [security] [xdmcp] [chooser] [debug]
临时关闭:
systemctl stop firewalld
永久关闭:
vim /etc/sysconfig/selinux SELINUX=enforcing修改为: SELINUX=disabled
或者尝试:
chkconfig iptables off
sudo /usr/sbin/sshd -D & # Redhat 7 重启sshd服务: systemctl restart sshd.service
uname -a # 或, lsb_release -a
修改/etc/ssh/sshd_config
UseDNS no GSSAPIAuthentication no
修改/etc/ssh/ssh_config
GSSAPIAuthentication no
root权限下,修改/etc/gdm/custom.conf文件在[daemon]节增加:
AutomaticLogin=User Name AutomaticLoginEnable=True
adduser name -p password
配置/etc/sudoers
#Defaults requiretty
Defaults visiblepw
解决“sudo: no tty present and no askpass program specified”
grep 'model name' /proc/cpuinfo
grep 'MemTotal' /proc/meminfo
df -h
service network restart
chkconfig –list iptables
chkconfig iptables off –level 2345
rpm -qa | grep 包名称
lsof -i:5258
netstat –an | grep 177
编辑/etc/ssh/sshd_config
UseDNS no
grep -rnI ConnectionInfo.cpp * | grep -v Po | grep -v include | grep -v Makefile.in | grep -v Makefile:
中文切换成英文:编辑/etc/sysconfig/i18n,zhCN.UTF-8修改为enUS.UTF-8。
cp /etc/sysconfig/i18n $HOME/.i18n
英文环境默认不启用输入法,可以如下方法启用:
1)、System → Preferences → Input Method → 打开IM Chooser窗口 → Enable Input Method Feature。
2)、如果无法显示候选词窗口,可能是多个版本Python造成缺少gtk库的原因,恢复Python使用默认版本即可。
[root@yz_dev ~]# echo "yz:1234" | chpasswd
[root@yz_dev ~]# sed -i "s/原字符串/新字符串/g" grep 原字符串 -rl 目录
cat /proc/cpuinfo | grep "cpu cores" | uniq
[root@gb33 ~]# date Sat Feb 18 13:54:44 CST 2017 [root@gb33 ~]# date -u Sat Feb 18 05:54:49 UTC 2017 [root@gb33 ~]# date -R Sat, 18 Feb 2017 13:54:52 +0800 [root@gb33 ~]# clock --show Sat 18 Feb 2017 01:57:01 PM CST -0.807795 seconds
[yz@yz_dev ~]$ sudo fdisk -l [yz@yz_dev ~]$ sudo mount /dev/sdb1 /opt
[root@yz_dev ~]# vi /etc/fstab /dev/mapper/VolGroup-lv_root / ext4 defaults 1 1 UUID=361af9a1-fa9a-4903-87c2-56a53a89393b /boot ext4 defaults 1 2 /dev/mapper/VolGroup-lv_home /home ext4 defaults 1 2 /dev/mapper/VolGroup-lv_swap swap swap defaults 0 0 tmpfs /dev/shm tmpfs defaults 0 0
注:查看分区UUID方法:
[root@yz_dev ~]# blkid /dev/sdb1
命令:cat /proc/PID/stat,例如:
[yz@yz_dev ~]$ cat /proc/37480/stat 37480 (mysql) S 37459 37480 37459 34817 37480 4202496 766 0 10 0 1 5 0 0 20 0 1 0 10306067 136282112 681 18446744073709551615 4194304 4411980 140733620337360 140733620335928 259761694528 0 0 4096 134889479 18446744071582216919 0 0 17 1 0 0 9 0 0
其中,第4列为父进程PID。
命令使用示例:
wget ftp://yz:yz@10.10.10.23//opt/tpch_data/100s_tbl/ -r -nH -q &
echo 3 > /proc/sys/vm/drop_caches
将80端口映射到3000端口:
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 3000 # 查看 nat 链规则 sudo iptables -t nat -L -n --line-number # 删除规则 PREROUTING 的规则 1 sudo iptables -t nat -D PREROUTING 1