Locating a Preconfigured “ls” Alias in CentOS Using grep

Linux distributions sometimes configure “ll” (lowercase L’s) as an alias to “ls -l”. Debian based OS’s typically do this from the users ~/.bashrc file. This is not the case with Red Hat/CentOS based OS’s. I couldn’t remember where CentOS set the alias and I needed to locate it. As a non-root user, this proved to be a little more challenging than I first expected. Yes, I could look it up on the web but I decided to make an exercise out of it and it was more challenging than it would first seem.

grep -riE "alias ?ll" /etc/ 2> /dev/null

I’m sure there are other ways to it but this worked. In short. I knew I needed to search for “ll” in /etc, but “ll” is also common in many words. Also, I’m running as a normal user so I wanted to avoid “Permission Denied” and other errors that cluttered the search.

Note the the following also returns the same:

 grep -riE "alias ?ll" /etc/ 2>&1 | grep -v "Permission" 

RAID – Mark Failure and Replace Drive

I have wanted to get this posted for a while but have been busy with SANS FOR500 material, work, etc.

What I try to do when transferring my old notes to the blog is to go out and work through the steps first, correcting my notes as I step through them.  With this post, I have not done that because of the time it would take to setup and run through the steps.  But as I always warn, these are notes, not full instructions.  They get you in the ball park but you have to find the bases yourself.

So here we go…

This posting assumes raid and drive layout of this earlier post. Some steps below also refer to this post.

Software RAID 5 with UEFI/GPT via Ubuntu installer – Ubuntu Server 18.04

It might be best to set the efibootmgr to a partition not on the affected drive in case a reboot happens.  See steps 7-10 from the post above.

Check on drive state (and other useful items):

cat /proc/mdstat
mdadm --detail /dev/md0
mdadm --detail /dev/md1
mdadm --detail /dev/md2

Since in this case there are 3 raid arrays, mark the appropriate drive in all 3 arrays as failed and for removal (in this case, sde).

Mark failure:

mdadm --fail /dev/md0 /dev/sde2
mdadm --fail /dev/md1 /dev/sde3
mdadm --fail /dev/md2 /dev/sde4

Mark for removal:

mdadm --remove /dev/md0 /dev/sde2
mdadm --remove /dev/md1 /dev/sde3
mdadm --remove /dev/md2 /dev/sde4

Once drive is replaced,  re-add drive back into array:

mdadm --add /dev/md0 /dev/sde2
mdadm --add /dev/md1 /dev/sde3
mdadm --add /dev/md2 /dev/sde4

Watch rebuild status:

cat /proc/mdstat
mdadm --detail /dev/md0
mdadm --detail /dev/md1
mdadm --detail /dev/md2

Go to the link at the beginning of this post and do steps 7-10 if needed.

Install Latest Version of Firefox on CentOS 7

I decided to install the latest version of Firefox on my CentOS 7 VM. This is what I did.

Download the latest version of Firefox:

$ wget http://ftp.mozilla.org/pub/firefox/releases/60.0/linux-x86_64/en-US/firefox-60.0.2.tar.bz2

As root, remove the CentOS install of Firefox:

# yum remove firefox

Move the tarball to /usr/local/src:

# cd /usr/local/src
# mv /home/me/firefox-60.0.2.tar.bz2 .

Extract the files:

tar xvjf firefox-60.0.2.tar.bz2

Set link up:

ln -s /usr/local/src/firefox/firefox /usr/bin/firefox

As normal user, run it. Also, check to see if an update is available:

$ firefox &

If an update is available, download it. Then as root, mv the tarball to /usr/local/src and extract it as done above. If you want to save the old version as a backup just in case the new version fails to work, do this before doing the extraction:

# cd /usr/local/src
# cp -r firefox/ firefox_old/