Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #### automating mount of loop devices with systemd dependencies
- [root@localhost system]# cat loop.service
- [Unit]
- Description=automatically set up loop devices
- Documentation=man:losetup
- [Service]
- Type=oneshot
- ExecStart=/usr/sbin/losetup -fP /diskfile.img
- PrivateDevices=no
- [Install]
- WantedBy=local-fs.target
- [root@localhost system]# tail -1 /etc/fstab
- /dev/loop0p1 /loop0 ext2 x-systemd.requires=loop.service 0 0
- ######
- [root@localhost ~]# history
- 1 find / -name "hosts"
- 2 find / -name "*hosts*"
- 3 locate hosts
- 4 history
- 5 updatedb
- 6 locate hosts
- 7 touch sander
- 8 locate sander
- 9 find / -name "sander"
- 10 find / -user student
- 11 find / -user student | wc
- 12 w
- 13 useradd linda
- 14 find / -user linda
- 15 find / -user linda -exec cp {} /root/linda/ \;
- 16 mkdir /root/linda ; find / -user linda -exec cp {} /root/linda/ \;
- 17 ls -a linda
- 18 ls -l
- 19 cd linda
- 20 ls -l
- 21 -a
- 22 ls -a
- 23 find / -perm /4000
- 24 man find
- 25 find / -type f -size +100M
- 26 mkdir -p find/content; find /etc -exec grep -l student {} \; -exec cp {} find/content/ \; 2>/dev/null
- 27 ls
- 28 tree find/
- 29 find /etc/ -name '*' -type f | xargs grep '127.0.0.1'
- 30 vim /etc/dummy
- 31 find /etc/ -name '*' -type f | xargs grep '127.0.0.1'
- 32 find /etc/ -name '*' -type f | xargs grep '127\.0\.0\.1'
- 33 cd
- 34 vim countdown
- 35 history
- 36 bash countdown 13
- 37 sed -n 5p /etc/passwd
- 38 vim myfile
- 39 sed -i 's/old/new/' myfile
- 40 cat myfile
- 41 sed -i 's/old/new/g' myfile
- 42 cat myfile
- 43 sed -i -e '2d' myfile
- 44 cat myfile
- 45 awk -F : '{ print $4 }' /etc/passwd
- 46 awk -F : '/linda/ { print $3 }' /etc/passwd
- 47 man awk
- 48 pinfo awk
- 49 last
- 50 which last
- 51 ls -l /bin/last
- 52 vim /etc/login.defs
- 53 cd /etc/skel/
- 54 ls -al
- 55 echo hello > hello
- 56 pwd
- 57 useradd -m -s /bin/bash bob
- 58 cd /home/bob
- 59 ls -al
- 60 ls -ld .
- 61 passwd -S bob
- 62 chage -l bob
- 63 id bob
- 64 tail /etc/passwd
- 65 man 5 passwd
- 66 finger bob
- 67 usermod -s /usr/bin/passwd bob
- 68 tail -1 /etc/passwd
- 69 passwd bob
- 70 su - bob
- 71 password
- 72 finger
- 73 yum provides */finger
- 74 yum install -y epel-release
- 75 ssh [email protected]
- 76 cd
- 77 countdown 12
- 78 ./countdown 12
- 79 bash countdown 12
- 80 useradd -G wheel -s /usr/bin/passwd anna
- 81 chage anna
- 82 grep anna /etc/passwd /etc/shadow /etc/group
- 83 passwd --help
- 84 usermod -s /bin/bash anna
- 85 passwd anna
- 86 passwd -e anna
- 87 su - anna
- 88 su - student
- 89 ssh [email protected]
- 90 #make sure the following is entered after doing visudo: Defaults timestamp_type=global,timestamp_timeout=240
- 91 history
- 92 history -d 90
- 93 history
- 94 touch myfile
- 95 ls -l myfile
- 96 chattr +i myfile
- 97 rm -f myfile
- 98 lsattr myfile
- 99 chattr -i myfile
- 100 lsattr myfile
- 101 rm myfile
- 102 ls
- 103 countdown
- 104 echo $PATH
- 105 ./countdown
- 106 ls -l
- 107 chmod +x countdown
- 108 ./countdown
- 109 cd /home/linda
- 110 touch wortel
- 111 su - linda
- 112 cd
- 113 groupadd sales
- 114 groupadd account
- 115 usermod -aG sales linda
- 116 usermod -aG sales lisa
- 117 useradd -G sales lisa
- 118 usermod -aG account anna
- 119 useradd -G account anouk
- 120 grep -E {account|sales} /etc/group
- 121 grep -E '{account|sales}' /etc/group
- 122 tail -2 /etc/group
- 123 tail -10 /etc/group
- 124 mkdir -p /data/account /data/sales
- 125 cd /data
- 126 ls -l
- 127 chmod 770 *
- 128 ls -l
- 129 chgrp account account
- 130 chgrp sales sales
- 131 ls -l
- 132 id anna
- 133 usermod -G sales anna
- 134 id anna
- 135 usermod -aG account,wheel anna
- 136 id anna
- 137 usermod -G account,wheel anna
- 138 su - anna
- 139 su - anouk
- 140 chmod +t *
- 141 chmod g+s *
- 142 ls -l
- 143 su - anna
- 144 su - anoukt
- 145 su - anouk
- 146 history
- 147 cd
- 148 ./countdown 21
- 149 ls -l /data
- 150 man chattr
- 151 umask
- 152 cd /etc
- 153 grep -R 'umask' *
- 154 vim bashrc
- 155 cd skel/
- 156 ls -a
- 157 vim .bashrc
- 158 awk -F : ' $3 > 1000 { print $1 }'
- 159 awk -F : ' $3 > 1000 { print $1 }' /etc/passwd
- 160 which passwd
- 161 ls -l $(which passwd)
- 162 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); echo $i; done
- 163 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); do echo $i; done
- 164 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); do cp .bashrc /home/$i/; done
- 165 for i in $(awk -F : ' $3 > 1000 { print $1 }' /etc/passwd); do cp -f .bashrc /home/$i/; done
- 166 su - anna
- 167 su - anouk
- 168 cd
- 169 cd /data
- 170 ls -l
- 171 su - linda
- 172 history
- 173 ls -l `which ls`
- 174 ls -l `which passwd`
- 175 ls -l $(which passwd)
- 176 df -h
- 177 poweroff
- 178 setenforce 0
- 179 su - linda
- 180 setenforce
- 181 setenforce 1
- 182 su - linda
- 183 exit
- 184 cat /etc/passwd
- 185 su - anouk
- 186 lsblk
- 187 df -h
- 188 dd if=/dev/zero of=/diskfile.img bs=1M count=1024
- 189 dd if=/dev/zero of=/diskfile2.img bs=1M count=1024
- 190 losetup -fP /diskfile.img
- 191 losetup -fP /diskfile2.img
- 192 losetup -a
- 193 lsblk
- 194 ./countdown 12
- 195 history
- 196 lsblk
- 197 fdisk /dev/loop0
- 198 mkfs.ext2 /dev/loop0p1
- 199 lsblk
- 200 mount /dev/loop0p1 /mnt
- 201 cd /mnt
- 202 touch loop1file
- 203 ls -kl
- 204 cd
- 205 umount /mnt
- 206 ls /mnt
- 207 vim /etc/fstab
- 208 mount -a
- 209 mkdir /loop0
- 210 mount -a
- 211 mount
- 212 ls /loop0
- 213 reboot
- 214 losetup -a
- 215 losetup -fP diskfile.img
- 216 losetup -fP /diskfile.img
- 217 lsblk
- 218 mount -a
- 219 mount
- 220 tail -1 /etc/fstab
- 221 su - anouk
- 222 su - anna
- 223 su - anouk
- 224 su - anna
- 225 history
- 226 df -h
- 227 history
- 228 vim /etc/fstab
- 229 reboot
- 230 mount -a
- 231 losetup -fP /diskfile.img
- 232 systemctl list-dependencies
- 233 cd /usr/lib/systemd/system
- 234 cp fstrim.service /etc/systemd/system/loop.service
- 235 vim /etc/systemd/system/loop.service
- 236 systemctl cat sshd.service
- 237 vim /etc/systemd/system/loop.service
- 238 systemctl enable loop.service
- 239 reboot
- 240 history
- 241 systemctl status loop.service
- 242 vim /etc/fstab
- 243 reboot
- 244 ssh [email protected]
- 245 cd /etc/systemd/system/
- 246 ls
- 247 vim loop.service
- 248 systemctl enable --now loop.service
- 249 cat loop.service
- 250 tail -1 /etc/fstab
- 251 mount | grep loop
- 252 lsblk
- 253 fdisk /dev/sdb
- 254 xxd /dev/sdb1 | less
- 255 pvcreate /dev/sdb1
- 256 xxd /dev/sdb1 | less
- 257 pvs
- 258 vgcreate --help | less
- 259 vgcreate vgdata /dev/sdb1
- 260 pvs
- 261 vgs
- 262 lvcreate --help | less
- 263 lvcreate --longhelp | wc
- 264 lvcreate --longhelp | less
- 265 lvcreate -n lvdata -L 1G vgdata
- 266 lvs
- 267 mkfs.xfs /dev/vgdata/lvdata
- 268 mkdir /lvdata
- 269 vim /etc/fstab
- 270 mount -a
- 271 history
- 272 grep student /etc/*
- 273 ps aux
- 274 ps aux | grep cron
- 275 lvs
- 276 df -h
- 277 tail -1 /etc/fstab
- 278 ls -l /dev/mapper/vgdata-lvdata /dev/vgdata/lvdata
- 279 vgs
- 280 vgextend --help
- 281 pvs
- 282 vgextend vgdata /dev/sdb2
- 283 vgs
- 284 lvs
- 285 lvextend /dev/vgdata/lvdata -L +1G
- 286 lvs
- 287 df -h
- 288 xfs_growfs /dev/vgdata/lvdata
- 289 df -h
- 290 fdisk /dev/sdc
- 291 mkfs.ext4 /dev/sdc1
- 292 mkdir /sdc1
- 293 vim /etc/fstab
- 294 mount -a
- 295 df -h
- 296 poweroff
- 297 mount
- 298 cd /sdc1
- 299 touch testfiles{1..100}
- 300 ls
- 301 df -h | grep sdc
- 302 cd
- 303 fdisk /dev/sdc
- 304 umount /dev/sdc1
- 305 fdisk /dev/sdc
- 306 mount -a
- 307 df -h
- 308 resize2fs /dev/sdc1
- 309 df -h
- 310 cd /dev/sdc1
- 311 cd /sdc1
- 312 ls
- 313 history
- 314 vim /etc/fstab
- 315 man -k label
- 316 man -k user
- 317 mandb
- 318 man -k label
- 319 e2label --help
- 320 man e2label
- 321 e2label /dev/sdc1 coffee
- 322 blkid
- 323 vim /etc/fstab
- 324 umount /dev/sdc1
- 325 cd /
- 326 umount /dev/sdc1
- 327 mount -a
- 328 xfs_admin --help
- 329 cd
- 330 ./countdown 12
- 331 vim /etc/fstab
- 332 lsblk
- 333 vim /etc/fstab
- 334 umount /dev/sdc1
- 335 dd if=/dev/zero of=/dev/sdc bs=1M count=1024
- 336 reboot
- 337 lsblk
- 338 mdadm --create /dev/md0 --level 5 --raid-devices 3 /dev/sd{c,d,e}
- 339 cat /proc/mdstat
- 340 mdadm --details /dev/md0
- 341 mdadm --detail /dev/md0
- 342 mdadm --detail --scan --verbose
- 343 mdadm --detail --scan --verbose >> /etc/mdadm.conf
- 344 cat /proc/mdstat
- 345 mkfs.ext4 -L DATA /dev/md0
- 346 iostat
- 347 iostat 2 50
- 348 vim /etc/fstab
- 349 man mdadm
- 350 vim /etc/default/grub
- 351 #grub2-mkconfig -o /boot/grub/grub.cfg
- 352 find / -name "grub.cfg"
- 353 grub2-mkconfig -o /boot/grub2/grub.cfg
- 354 history
- 355 reboot
- 356 systemctl --type help
- 357 systemctl list-units
- 358 systemctl cat sshd.service
- 359 ps aux | grep ssh
- 360 kill -9 1125
- 361 systemctl status sshd
- 362 systemctl cat sshd.service
- 363 yum install httpd
- 364 systemctl status httpd
- 365 systemctl enable --now httpd
- 366 systemctl cat httpd.service
- 367 ls /etc/systemd/system/multi-user.target.wants/
- 368 ls /etc/systemd/system/multi-user.target.wants/ -l
- 369 systemctl disable httpd.service
- 370 systemctl status httpd.service
- 371 systemctl stop httpd
- 372 yum install vsftpd
- 373 systemctl edit httpd.service
- 374 systemctl status httpd
- 375 ps aux | grep httpd
- 376 ps aux | grep http
- 377 ps aux | grep ftp
- 378 systemctl start httpd
- 379 ps aux | grep ftp
- 380 systemctl status httpd
- 381 ./countdown 12
- 382 export EDITOR=/usr/bin/vim
- 383 systemctl edit httpd.service
- 384 systemctl show httpd.service
- 385 systemctl list-dependencies
- 386 cd /usr/lib/systemd/system
- 387 ls
- 388 ls fstrim*
- 389 systemctl cat fstrim.service
- 390 systemctl cat fstrim.timer
- 391 systemctl list-timers
- 392 man 7 systemd.time
- 393 man 7 systemd.timer
- 394 man -k systemd
- 395 man systemd.generator
- 396 man systemd.directives
- 397 man systemd.unit
- 398 cd /run/systemd/generator/
- 399 ls
- 400 cat /etc/fstab
- 401 vim lvdata.mount
- 402 vim loop0.mount
- 403 cp loop0.mount /etc/systemd/system/
- 404 systemctl list-dependencies
- 405 cd /etc/systemd/system/
- 406 vim loop0.mount
- 407 vim /etc/fstab
- 408 systemctl enable loop0.mount --now
- 409 reboot
- 410 systemctl disable loop0.service
- 411 systemctl disable loop0.mount
- 412 vim /etc/fstab
- 413 history
- 414 grep -E '{svm|vmx}' /proc/cpuinfo
- 415 grep vmx /proc/cpuinfo
- 416 ./countdown 22
- 417 mkdir /nfsshare
- 418 vim /etc/exports
- 419 systemctl enable --now nfs-server
- 420 yum search nfs
- 421 yum install nfs-utils
- 422 systemctl enable --now nfs-server
- 423 showmount -e localhost
- 424 ip a
- 425 firewall-cmd --list-all
- 426 systemctl stop firewalld
- 427 systemctl start firewalld
- 428 firewall-cmd --get-services
- 429 firewall-cmd --add-service mountd
- 430 firewall-cmd --add-service mountd --permanent
- 431 firewall-cmd --add-service nfs --permanent
- 432 firewall-cmd --add-service nfs3 --permanent
- 433 firewall-cmd --add-service rpc-bind --permanent
- 434 systemctl restart firewalld
- 435 vim /etc/httpd/conf/httpd.conf
- 436 cd /var/www/html/
- 437 vim index.html
- 438 systemctl enable --now httpd
- 439 curl localhost
- 440 df -h
- 441 poweroff
- 442 vgs
- 443 lsblk
- 444 dd if=/dev/zero of=/dev/sdc bs=1M count=10
- 445 dd if=/dev/zero of=/dev/sdd bs=1M count=10
- 446 fdisk /dev/sdc
- 447 vgextend cs /dev/sdc1
- 448 vgs
- 449 lvextend /dev/cs/root -l +100%FREE
- 450 lvextend /dev/cs/root -l +100%FREE -r
- 451 df -h
- 452 dd if=/dev/sr0 of=/centos.iso bs=1M
- 453 yum groups list
- 454 yum groups install "Virtualization Host"
- 455 yum install virt-manager
- 456 systemctl enable --now libvirtd
- 457 lsmod | grep kvm
- 458 virt-manager &
- 459 virsh list
- 460 ./countdown 12
- 461 alias docker=podman
- 462 yum module install container-tools
- 463 yum search podman
- 464 yum install podman
- 465 vim /etc/containers/registries.conf
- 466 podman run -d nginx
- 467 podman ps
- 468 podman run ubuntu
- 469 docker ps
- 470 podman ps -a
- 471 podman run -it ubuntu
- 472 docker ps
- 473 uname -r
- 474 docker exec -it upbeat_babbage /bin/bash
- 475 ps fax
- 476 podman ps
- 477 podman inspect upbeat_babbage | less
- 478 ip a | less
- 479 podman run -p 8080:80 -d nginx
- 480 podman ps
- 481 curl localhost:8080
- 482 history
- [root@localhost ~]#
Advertisement
Add Comment
Please, Sign In to add comment