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
To enable the slow query log in MySQL, follow these steps: | |
1). Log in to your server using SSH. | |
2). At the command line, type the following command: | |
mysql -u root -p | |
3). Type the MySQL root password. | |
4). To enable the slow query log, type the following command at the mysql> prompt: |
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: http://www.indiabix.com/java-programming/declarations-and-access-control/ | |
Access modifiers dictate which classes, not which instances, may access features. | |
Methods and variables are collectively known as members. Method and variable members are given access control in exactly the same way. | |
private | |
makes a member accessible only from within its own class | |
protected | |
makes a member accessible only to classes in the same package or subclass of the class |
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
+--------------------+ | |
| Feature | | |
+--------------------+ | |
Start a new feature | |
|- Development of new features starting from the 'develop' branch. | |
Finish up a feature | |
|- Finish the development of a feature. | |
|- Merges the feature branch into 'develop' |
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
Command to display Memory usage, Disk Usage and CPU Load | |
======================================================== | |
free -m | awk 'NR==2{printf "Memory Usage: %s/%sMB (%.2f%%)\n", $3,$2,$3*100/$2 }' | |
df -h | awk '$NF=="/"{printf "Disk Usage: %d/%dGB (%s)\n", $3,$2,$5}' | |
top -bn1 | grep load | awk '{printf "CPU Load: %.2f\n", $(NF-2)}' | |
# should also try monit |
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
Ubuntu-12-04 | |
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-memcache-on-ubuntu-12-04 | |
Ubuntu-14-04 | |
https://www.digitalocean.com/community/tutorials/how-to-install-and-use-memcache-on-ubuntu-14-04 | |
Read More: | |
https://www.digitalocean.com/community/tags/caching?type=tutorials | |
======================================================= |
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
mysqldbcopy is part of mysql-utilities. | |
apt-get install mysql-utilities (if not yet installed) | |
Usage: mysqldbcopy --source=user:pass@host:port:socket --destination=user:pass@host:port:socket orig_db:new_db | |
Example: | |
mysqldbcopy --source=user_name:password@localhost:3306 --destination=user_name:password@localhost:3306 mddb:mddb_demo | |
Working Example: |
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
When you see PHP Warning: something like | |
"failed to open stream: Too many open files in /var/www/... | |
You need to check open file limit as below: | |
$ ulimit -n | |
4096 | |
Change the following lines in the file: /etc/security/limits.conf | |
* soft nofile 4096 | |
* hard nofile 4096 |
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 |
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
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 |
NewerOlder