Wednesday, October 11, 2017

linux 101

# view uptime or acpi live
watch uptime/ watch acpi
# disable /etc/resolv.conf DNS update
echo 'PEERDNS=no' >> /etc/sysconfig/network-scripts/ifcfg-eth0

# troubleshooting DNS TCP/UDP port
dig +tcp A example.com# checking CPU

cat /proc/cpuinfo

# checking GPU
lspci |grep -i nvid# vim save with sud

o permission
:w !sudo tee %

# run level
chkconfig

# change /var/log/LOG permission
$FileOwner SOMEONE
$FileGroup SOMEGROUP
$FileCreateMode 0644
$DirCreateMode 0755
$Umask 0022

# remount
 mount -o remount,rw /

# make muldipal file
touch {a..z}.txt

#grep the exact string
grep -w


#checking GPU
update-pciids; lspci | grep -E "VGA|3D"
#or
sudo lshw -c video

#zmap, -B is for bandwidth, 1M
zmap -B1M   --probe-module=icmp_echoscan 0.0.0.0/0  -o/tmp/OUTPUT_FILE.txt   2>/dev/null

#check package via command
yum provides semanage

# check file ctime ull formate
ls --full-time
ls -l --time=atime
ls -l --time=ctime

# fixing locale issue 
#vim /etc/profile
export LC_ADDRESS="en_US.UTF-8"
export LC_IDENTIFICATION="en_US.UTF-8"
export LC_MEASUREMENT="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"

# crontab
@reboot         root    sleep 60;SOME_COMMAND_LIKE_reboot
# timestamp
ping 8.8.8.8 | xargs -L 1 -I '{}' date '+%Y-%m-%d %H:%M:%S: {}' 

No comments:

Post a Comment