How to find WordPress admin users over mysql command line

How to show WordPress admin user using mysql command prompt

select * from wp_users u INNER JOIN wp_usermeta m ON m.user_id = u.ID where meta_value like '%administrator%';

or

SELECT u.ID, u.user_login, u.user_nicename, u.user_email FROM wp_users u INNER JOIN wp_usermeta m ON m.user_id
Read the rest

How to update .bashrc .bash_profile and get PS1 full path reflection

cd

Create .bash_profile if not exist yet

touch .bash_profile

The .bash_profile should contains the following:

if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

Append into the file .bashrc the following:

PS1="\u@\h [\$PWD]# "

LS_OPTIONS='--color=tty -F -a -b -T 0';
export LS_OPTIONS;
alias ls='/bin/ls $LS_OPTIONS';
alias dir='/bin/ls $LS_OPTIONS --format=vertical';
alias vdir='/bin/ls $LS_OPTIONS --format=long';
alias d=dir;
alias v=vdir;
eval `dircolors -b`

Run next to get this updated:

source .bashrc
Read the rest

How to install Drupal Console

If you don't have Drush and Composer installed yet, please do it firstly click here

cd
mkdir drupalconsole
cd drupalconsole
curl https://drupalconsole.com/installer -L -o drupal.phar
chmod +x drupal.phar
echo "alias drupal='~/drupalconsole/drupal.phar'" >> ~/.bashrc
source .bashrc

Navigate into your site root where you have Drupal installed

cd /home/$USER/public_html
composer require drupal/console:~1.0 --prefer-dist --optimize-autoloader --sort-packages

Check how its working:

drupal site:status
drupal about

Useful URLs:

https://docs.drupalconsole.com/en/getting/composer.htmlRead the rest

How to install atop

Enable epel repository if needed

## RHEL/CentOS 7 64-Bit ##
wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
yum install atop -y

Useful URLs:

https://www.tecmint.com/how-to-enable-epel-repository-for-rhel-centos-6-5/

https://www.tecmint.com/how-to-install-atop-to-monitor-logging-activity-of-linux-system-processes/Read the rest

How to get rid of /tmp/atop.d/atop.acct

You should never terminate atop by 'kill -9', because then it has no chance to stop process accounting; as a result the accounting file may consume a lot of disk space after a while!!!

Lets do this smoothly:

systemctl stop atopd
systemctl disable atopd

Check atop processes
ps auxfS |grep atop

Kill if any using 'kill -15'
kill -15 PID

Check for links and unlink if any:
ls /etc/systemd/system/ |grep atop

Remove atopd.service
Read the rest

How to reset admin password using drush

If you’re on Drupal 7 use https://github.com/drush-ops/drush/archive/7.x.zip to install Drush

drush upwd --password="jd938pls@l$4401ks" "admin"

MySQL command line:

UPDATE users SET pass = MD5('jd938pls@l$4401ks') WHERE uid=2;

Drush can generate a one-time login link.

drush uli

Then replace “default” with your website URL

To get URL with your domain name instead of default, try it as the following:

drush uli --uri=yourdomainnamehere.com
Read the rest