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
import { | |
TIME_CHANGE | |
} from '../actions/types'; | |
// khai báo 1 trạng thái khởi | |
const INITIAL = { | |
hour: 0 | |
}; | |
// reducer này sẽ nhận trạng thái khởi tạo ở bên trên nếu như state chưa |
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
<Router createReducer={reducerCreate}> | |
<Scene key="auth"> | |
<Scene | |
key="sign_in" | |
component={SignIn} | |
app={app} | |
initial={needSignIn} | |
title="Sign in" |
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
#!/bin/bash | |
## Author: Anh Tuan Nguyen ([email protected]) | |
## Created: 23/08/2016 | |
## Install Let's Encrypt and generate certs for nginx | |
## If you want to install nginx server: https://gist.github.com/anhtuank7c/74d404b63ebb33ce17973d079b84aed1 | |
## You will need git installed on your server | |
# Download lets encrypt to /opt/letsencrypt | |
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt |
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
#!/bin/bash | |
## Author: Anh Tuan Nguyen ([email protected]) | |
## Created: 08/08/2016 | |
## Install nginx, openssl, php7.0, mysql 5.7, phpmyadmin, cakephp 3.x | |
# update, upgrade to latest source | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
# GOOGLE PAGE SPEED |
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
#!/bin/bash | |
## Author: Anh Tuan Nguyen ([email protected]) | |
## Created: 08/08/2016 | |
# update, upgrade to latest source | |
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
# GOOGLE PAGE SPEED | |
sudo apt-get install -y build-essential zlib1g-dev libpcre3 libpcre3-dev 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
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install php5.6 | |
you can install more php5.6 module | |
sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml php5.6-intl php5.6-intl php5.6-mbstring php-apcu php-uuid php5.6-cgi php5.6-cli php5.6-gd php5.6-ldap php5.6-sqlite3 php-uploadprogress |
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
Go to http://dev.mysql.com/downloads/repo/apt/ then download the .deb file to your server | |
Install downloaded package: sudo dpkg -i package_name | |
Update Apt: sudo apt-get update | |
Install mysql: sudo apt-get install mysql-server | |
After install, going to secure it: | |
sudo mysql_secure_installation |
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
<?php | |
namespace App\Auth; | |
use Cake\Auth\BaseAuthenticate; | |
use Cake\Network\Request; | |
use Cake\Network\Response; | |
class LdapAuthenticate extends BaseAuthenticate | |
{ |
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
(setup ssl self-cert first https://www.digitalocean.com/community/tutorials/how-to-create-a-ssl-certificate-on-apache-for-ubuntu-14-04) | |
1) Install the Server Dependencies: | |
apt-get update | |
apt-get install git | |
2) Download the Let’s Encrypt Client: | |
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
3) Set Up the SSL Certificate: |
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
<ifModule mod_gzip.c> | |
mod_gzip_on Yes | |
mod_gzip_dechunk Yes | |
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ | |
mod_gzip_item_include handler ^cgi-script$ | |
mod_gzip_item_include mime ^text/.* | |
mod_gzip_item_include mime ^application/x-javascript.* | |
mod_gzip_item_exclude mime ^image/.* | |
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* | |
</ifModule> |