cat /etc/group | grep sudo
Category: Linux
Linux and Unix Copy files
To copy a directory with all subdirectories and files, use the cp command. Below is an example command of how you would use the cp command to copy files. Additional information about this command and other examples are available through the above cp link.
cp -r /home/hope/files/* /home/hope/backup
In the example above, the cp command would copy all files, directories, and subdirectories in the /home/hope/files directory to the /home/hope/backup directory.
or
Copy a folder called /tmp/conf to /tmp/backup:
cp -avr /tmp/conf/ /tmp/backup
-a : Preserve the specified attributes such as directory an file mode, ownership, timestamps, if possible additional attributes: context, links, xattr, all.
-v : Explain what is being done.
-r : Copy directories recursively. Example
Ubuntu 14.04 – PHP Version Upgraded
php -v
Shows:
PHP 5.6.25-2+deb.sury.org~trusty+1 (cli)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologiescode
In the page the php code phpinfo();
phpinfo();
Shows:
PHP Version 5.5.9-1ubuntu4.19
Now to correct this you need to:
sudo a2dismod php5 sudo a2enmod php5.6 sudo service apache2 restart
Cheers
Apache see access log
tail -f /var/log/apache2/access.log
Check how Apache2 parses VHOSTS
Apache can be a bit picky with *:80 at times, so you might want to try 8.8.8.8:80 instead to see if it works better. Run
apachectl -t -D DUMP_VHOSTS
to see how Apache parses your configuration files.
Letsencrypt Combining plugins
Combining plugins
Sometimes you may want to specify a combination of distinct authenticator and installer plugins. To do so, specify the authenticator plugin with --authenticator
or -a
and the installer plugin with --installer
or -i
.
For instance, you could create a certificate using the webroot plugin for authentication and the apache plugin for installation.
certbot run -a webroot -i apache -w /var/www/html -d example.com
Link: Get more info at Certbot.
Install PHP Composer
1) Update your packages:
sudo apt-get update
2) Install the curl utility:
sudo apt-get install curl
3) Download the installer:
sudo curl -s https://getcomposer.org/installer | php
4) Move the composer.phar file:
sudo mv composer.phar /usr/local/bin/composer
5) Use the composer command to test the installation. If Composer is installed correctly, the server will respond with a long list of help information and commands:
user@localhost:~# composer ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 1.3.2 2017-01-27 18:23:41 Usage: command [options] [arguments] Options: -h, --help Display this help message -q, --quiet Do not output any message
Remove Virtual Host from Apache2
sudo a2dissite example.com.conf
sudo rm /etc/apache2/sites-available/example.com.conf
sudo rm -Rf /var/www/example.com
Having DNS issues on one server
dig +short smtp.office365.com
Result
lb.geo.office365.com. outlook.office365.com.g.office365.com. outlook-latam4.office365.com. 40.102.33.226 191.232.98.210 40.102.32.146 191.232.101.130 191.232.101.178 191.232.99.178 191.232.98.242 191.232.106.2 191.232.106.34 191.232.106.18
Empty File Using echo Command
# echo "" > access.log OR # echo > access.log
Note: You should keep in mind that an empty string is not the same as null. A string is already an object much as it may be empty while null simply means non-existence of an object.
For this reason, when you redirect the out of the echo command above into the file, and view the file contents using the cat command, is prints an empty line (empty string).
To send a null output to the file, use the flag -n
which tells echo to not output the trailing newline that leads to the empty line produced in the previous command.
# echo -n "" > access.log