This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A root account password can be set several ways. The following discussion demonstrates three methods: | |
Use the SET PASSWORD statement | |
Use the UPDATE statement | |
Use the mysqladmin command-line client program | |
To assign passwords using SET PASSWORD, connect to the server as root and issue a SET PASSWORD statement for each root account listed in the mysql.user table. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mysqldump -uroot databasename > database.sql | |
mysql create database databasename DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; | |
Option1 | |
======= | |
$ mysqldump yourFirstDatabase -u user -ppassword > yourDatabase.sql | |
$ mysql yourSecondDatabase -u user -ppassword < yourDatabase.sql | |
Option2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assuming that you're starting with a basic LAMP stack, first you need to install the needed packages: | |
sudo apt-get install libapache2-mod-fastcgi php5-fpm | |
Then create the file "/etc/apache2/conf-available/php5-fpm.conf" with the contents: | |
<IfModule mod_fastcgi.c> | |
AddHandler php5-fcgi .php | |
Action php5-fcgi /php5-fcgi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Check if query caching is available: | |
mysql> show variables like 'have_query_cache'; | |
+------------------+-------+ | |
| Variable_name | Value | | |
+------------------+-------+ | |
| have_query_cache | YES | | |
+------------------+-------+ | |
Check if query caching is enabled: | |
mysql> show variables like 'query%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Digital Packages Image upload utilizes blueimp image upload bundle and requires php-gd to be installed, you can check gd using phpinfo(). | |
You can also use blueimp with other two image libraries, imagick and imagemagick, please see UploadHandler.php in the blueimp bundle for changing the options. | |
apt-get install php5-imagick | |
php5enmod imagick | |
apt-get install imagemagick php5-imagick | |
service apache2 reload |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -r -H "search string" * | |
ref: https://www.siteground.com/tutorials/ssh/ssh_searching.htm | |
find /path/to/fies -type f -name "*.js" -exec grep -il 'string' {}\; > output.txt | |
count number of files within a dir recursively or specifically: | |
============================================================== | |
$ find /var/www/html/cache/ -type f -print | wc -l | |
$ ls | wc -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip all files in a dir | |
====================== | |
zip -r filename.zip foldername/ | |
zip all files in current dir | |
============================= | |
zip -r filename.zip * | |
unzip | |
===== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ref: https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite-for-apache-on-ubuntu-14-04 | |
Ref: https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite | |
sudo a2enmod rewrite | |
sudo service apache2 restart | |
sudo nano /etc/apache2/sites-enabled/000-default.conf | |
Follow the instructions from the link given above |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. mkdir /var/www/mydomain.com | |
2. mkdir /var/www/mydomain.com/html | |
3. useradd <-username> | |
4. passwd <-username> | |
5. chown –R <-username> /var/www/mydomain.com | |
5. groupadd <-groupname> | |
6. gpasswd -a <-username> <-groupname> | |
7. chgrp -R <-groupname> /var/www/mydomain.com | |
8. chmod -R g+rw /var/www/mydomain.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First, check "$ ulimit -a". | |
Go to /etc/security/limits.conf and add the two lines described below: | |
* soft nofile 10240 | |
* soft nproc 10240 | |
Reboot system or add following line to the end of /etc/pam.d/common-session: | |
session required pam_limits.so |