Skip to content

Instantly share code, notes, and snippets.

@vasergen
Last active August 10, 2019 06:41
Show Gist options
  • Save vasergen/ecb00bda9fd031c0874a78571894d936 to your computer and use it in GitHub Desktop.
Save vasergen/ecb00bda9fd031c0874a78571894d936 to your computer and use it in GitHub Desktop.
one one one
one one one
one one one
one one one
one one one
one one one
#add MATE GUI to centos#
yum install -y redhat-lsb-core net-tools epel-release kernel-headers kernel-devel
yum groupinstall -y "Development Tools"
yum groupinstall -y "X Window system" "MATE Desktop"
systemctl set-default graphical.target
systemctl isolate graphical.target
#add GNOME GUI to centos mini
yum grouplist
yum groupinstall "GNOME Desktop"
yum groups install "Server with GUI"
asd asd asd asd
systemctl asd sdaaaa set-default graphical.target
asd asd asd asd
systemctl isolate graphical.target
#utils
cat
less
head
tail
cat > file <<END ... END -> heredoc
tar -cf bin.tar bin -> just archive
tar -czf bin.tar.gz bin -> zip archive
gzip bin.tar
bzip bin.tar
cpio
#####recover root password########
1. interapt boot menu
2. remove `rhgb` `quit`
3. add `rd.break` `enforcing=0`
4. mount -o remount,rw /sysroot
5. chroot /sysroot
6. passwd ...
7. exit #go to switch_root
8. mount -o remount,ro /sysroot
9. exit
10.restorecon /etc/shadow
11.setenforce 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment