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
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
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
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
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
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
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
Create new droplet (1 click application or manual e.g. LAMP stack) | |
Step 1: Create a new user | |
Step 2: Root privileges | |
Step 3: Add Public Key Authentication | |
Step 4: Disable remote SSH access to root account | |
Step 5: Testing the changes | |
Step 6: Configure time zones | |
Step 7: Configure NTP Synchronization | |
Step 8: Setting up a firewall |
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
Summary | |
========= | |
1) Create an A record for your sub-domain that points to your droplet | |
2) Create a .config file for your sub-domain site in /etc/apache2/sites-available | |
3) Create the directory for your site in /var/www (or wherever you said it was in the config file) | |
4) Enable the site in apache with: sudo a2ensite sub.yourdomain.com (or whatever you named your site in the config) | |
5) reload apache: sudo service apache2 reload | |
NOTE: the DNS record you create might take awhile to propagate | |
============================================================================================ |
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
Configuring SPF and DKIM for outgoing mail digital signing | |
https://www.exratione.com/2014/07/setting-up-spf-and-dkim-for-an-ubuntu-1404-mail-server/ | |
Ref: http://www.openspf.org/SPF_Record_Syntax | |
Ref: http://www.dkim.org/ | |
If Postfix not installed | |
https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-postfix-on-ubuntu-14-04 | |
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-as-a-send-only-smtp-server-on-ubuntu-14-04 | |
MX tool: |