distros:centos
Differences
This shows you the differences between two versions of the page.
Last revisionBoth sides next revision | |||
distros:centos [2016/06/24 16:55] – created Sean Rhone | distros:centos [2016/06/24 17:03] – Sean Rhone | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Information ====== | ||
+ | * CentOS 7 | ||
+ | |||
+ | ====== Download ====== | ||
+ | |||
+ | * https:// | ||
+ | |||
+ | ====== Software ====== | ||
+ | |||
+ | ===== Update ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo yum clean ' | ||
+ | |||
+ | ===== General ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo yum install htop p7zip unar aria2 hdparm nano unzip | ||
+ | |||
+ | ====== Settings ====== | ||
+ | |||
+ | ==== Nano as default editor ==== | ||
+ | |||
+ | sudo nano '/ | ||
+ | |||
+ | Defaults editor = / | ||
+ | |||
+ | ==== Secure Shell ==== | ||
+ | |||
+ | === Change Listen Port === | ||
+ | |||
+ | * Connect with ssh ' | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | Port x | ||
+ | |||
+ | === Firewall === | ||
+ | |||
+ | == New Port == | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo firewall-cmd --permanent --add-port=' | ||
+ | |||
+ | == Remove Old == | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo firewall-cmd --permanent --remove-service=' | ||
+ | |||
+ | ====== Kernel Settings ====== | ||
+ | |||
+ | ===== Security ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | kernel.dmesg_restrict = 1 | ||
+ | kernel.kptr_restrict = 1 | ||
+ | |||
+ | ====== GRUB ====== | ||
+ | |||
+ | ===== Timeout ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | GRUB_TIMEOUT=3 | ||
+ | | ||
+ | ===== BIOS Update ===== | ||
+ | |||
+ | sudo grub2-mkconfig -o '/ | ||
+ | |||
+ | ====== Automatic Updates ====== | ||
+ | |||
+ | ===== Service ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | |||
+ | ===== Timer ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | [Unit] | ||
+ | Description=Software Package Maintenance and Updater | ||
+ | Wants=network-online.target | ||
+ | | ||
+ | [Timer] | ||
+ | OnCalendar=*-*-* 06:00:00 | ||
+ | Persistent=true | ||
+ | | ||
+ | [Install] | ||
+ | WantedBy=timers.target | ||
+ | |||
+ | ====== Steven Black' | ||
+ | |||
+ | ===== Service ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | [Service] | ||
+ | Type=oneshot | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | ExecStart='/ | ||
+ | |||
+ | ===== Timer ===== | ||
+ | |||
+ | sudo -e '/ | ||
+ | |||
+ | [Unit] | ||
+ | Description=Hosts File Protection Updater | ||
+ | Wants=network-online.target | ||
+ | | ||
+ | [Timer] | ||
+ | OnCalendar=weekly | ||
+ | Persistent=true | ||
+ | | ||
+ | [Install] | ||
+ | WantedBy=timers.target | ||
+ | |||
+ | ====== Notable Folders and Commands ====== | ||
+ | |||
+ | ===== Show CPU Frequency ===== | ||
+ | |||
+ | grep ' | ||
+ | |||
+ | watch -n 0.1 grep \'cpu MHz\' '/ | ||
+ | |||
+ | ===== Partition Information ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | df -hT | ||
+ | |||
+ | ===== Optimal GCC compiler flags ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+// | ||
+ | |||
+ | ===== Remove EXIF data ===== | ||
+ | |||
+ | **** | ||
+ | |||
+ | exiftool -all= *.* -overwrite_original | ||
+ | |||
+ | ===== FirewallD ===== | ||
+ | |||
+ | ==== List Active Rules ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo firewall-cmd --list-all | ||
+ | |||
+ | ==== List Available Services ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo firewall-cmd --get-service | ||
+ | |||
+ | ==== Reload ==== | ||
+ | |||
+ | **** | ||
+ | |||
+ | sudo firewall-cmd --reload | ||
+ | |||
+ | ==== Add/Remove Service ==== | ||
+ | |||
+ | * Add '' | ||
+ | |||
+ | sudo firewall-cmd --add-service=x | ||
+ | |||
+ | sudo firewall-cmd --remove-service=x | ||
+ | |||
+ | ==== Add/Remove Service ==== | ||
+ | |||
+ | * Add '' | ||
+ | * Change '' | ||
+ | |||
+ | sudo firewall-cmd --add-port=x/ | ||
+ | |||
+ | sudo firewall-cmd --remove-port=x/ |