rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Category: Linux
Cool additions to the Gnome Desktop
Go to https://extensions.gnome.org and install the browser extension.
Use firefox, not chrome, chrome goes haywire when you install the browser extension
Then look for the following extensions and install them.
- Dash to Panel
Arc Menu
see original article here:
https://www.reddit.com/r/Fedora/comments/hr3j6k/fedora_32_is_awesome/
Find and replace text within a file using sed
Find and replace text within a file using sed
The procedure to change the text in files under Linux/Unix using sed:
- Use Stream EDitor (sed) as follows:
- sed -i 's/old-text/new-text/g' input.txt
- The s is the substitute command of sed for find and replace
- It tells sed to find all occurrences of ‘old-text’ and replace with ‘new-text’ in a file named input.txt
- Verify that file has been updated:
- more input.txt
Resetting the Root Password of RHEL-8
Resetting the Root Password of RHEL-8
Resolution
1) Break the boot sequence by adding ‘rd.break’ at kernel stanza in grub. To do this, restart your system and when the GRUB splash screen comes:
- Select/highlight the kernel you wish to boot using the up/down arrow keys.
- Press the e key to edit the entry.
- Select/highlight the line starting with the word kernel or linux.
- Press the e key to edit the line.
- Add ‘rd.break’ at the end.
- Press ENTER to accept the changes.
- Press the ‘ctrl + x’ key to boot the kernel with the modified command line.
2) The system will provide a shell which will be from initramfs:
. . Entering emergency mode. Exit the shell to continue. Type "journalctl" to view system logs. You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot after mounting them and attach it to a bug report. switch_root:/#
3) Root filesystem will be mounted read-only at ‘sysroot’ directory:
switch_root:/# mount | grep -i sysroot /dev/mapper/rhel-root on /sysroot type xfs (ro,relatime,attr2,inode64,noquota)
4) Remount it with read-write mode:
switch_root:/# mount -o remount,rw /sysroot
5) Chroot into it:
switch_root:/# chroot /sysroot/
sh-4.4#
6) Change the password:
sh-4.4# passwd Changing password for user root. New password: BAD PASSWORD: The password is shorter than 8 characters Retype new password: passwd: all authentication tokens updated successfully.
7) Relabel the filesystem:
sh-4.4# touch /.autorelabel
8) Exit from the shell:
sh-4.4# exit exit switch_root:/# switch_root:/# exit
9) The system will continue the paused booting sequence:
. Starting Relabel all filesystems... [ OK ] Started Manage Sound Card St localhost login:
Remove CTRL-M characters from a file in UNIX
Remove CTRL-M characters from a file in UNIX
1) Open the file in vi
2) Type the following
:%s/^M//g
3) Press enter
to the ^M you have to type CTRL+V and then CTRL+M
Hard Drive Burn-in Testing
Hard Drive Burn-in Testing
THIS TEST WILL DESTROY ANY DATA ON THE DISK SO ONLY RUN THIS ON A NEW DISK WITHOUT DATA ON IT OR BACK UP ANY DATA FIRST
1) Run a short test
# smartctl -t short /dev/sdb
2) Run a conveyance test ???
# smartctl -t conveyance /dev/sdb
3) Run a long test
# smartctl -t long /dev/sdb
4) Run badblocks
# badblocks -ws /dev/sdb
Installing Visual Studio Code on RHEL
RHEL, Fedora, and CentOS based distributions
We currently ship the stable 64-bit VS Code in a yum repository, the following script will install the key and repository:
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
Then update the package cache and install the package using dnf (Fedora 22 and above):
sudo dnf check-update
sudo dnf install code
Or on older versions using yum:
yum check-update
sudo yum install code
Due to the manual signing process and the system we use to publish, the yum repo may lag behind and not get the latest version of VS Code immediately
Find out more about Ansible
Crontab explained
Cannot boot because missing external disk
See man pages fstab(5) and mount(8).
Using the nofail mount option will ignore missing drives during boot.
nofail Do not report errors for this device if it does not exist.
So your fstab line should instead look like:
UUID=6826692e-79f4-4423-8467-cef4d5e840c5 /backup/external ext4 defaults,nofail 0 0