Operating Systems & Environments
How To Create a Sudo User on CentOS 7/8
The sudo
command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on CentOS, without having to modify your server’s sudoers
file. If you want to configure sudo for an existing user, simply skip to step 3.
Linux : analyses the running process
Use htop
or top
to analyses the running process
run also ps auxf to see a detailed status of the current running processes.
PHP 7.2 and use it instead of PHP 7.3 in Mac OS Catalina
- Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- brew install [email protected]
- echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile
- echo 'export PATH="/usr/local/opt/[email protected]/sbin:$PATH"' >> ~/.bash_profile
- source ~/.bash_profile
-open /private/etc/apache2/httpd.conf
- add this line "LoadModule php7_module /usr/local/opt/[email protected]/lib/httpd/modules/libphp7.so"
Mac Check Apache config
Use this command
apachectl configtest
To restart apache
sudo apachectl restart
Install percona-server on Mac Catalina
First of all Install Homebrew from here
After you finish you need to run this command
brew install percona-server
Initialize the DB
unset TMPDIR
mysqld --initialize --datadir=/usr/local/var/mysql --user={your username} --port=3307 --general-log-file=/var/log/percona/percona-error.log
Note :Don't forget to replace the username with your user {your username} = root
Mac OS Catalina apache does not read my User files
do you have this error message and you did not find any solution to solve it
Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
Fatal error: Unknown: Failed opening required '/Users/{user name}/Documents/{your index.php path} (include_path='.:') in Unknown on line 0
Please follow the below steps
1- Open "System Preferences"
Linux Move Directory Command Line
To move SOURCE directory to a DEST directory use the mv command as follows:
mv source dest
mv /path/to/source /path/to/dest
Verify the proxy works , Elasticsearch
Verify the proxy works by entering the following command:
curl -i http://localhost:<proxy port>/_cluster/health
example:
curl -i http://localhost:8080/_cluster/health
Find all XML files that have been changed in last 24 hours
You can use this command to find it
find . -name "*.xml" -mtime -1 -ls
Completely restore centOS 7 as it was on first installation ( Factory Reset)
# Get all yum commands previously run
yum history list all
# Get the details of the command
yum history info [entry number]
# Undo each command top-down
yum history undo [entry number]
You have to be careful not to undo the initial system install!