Skip to content

Instantly share code, notes, and snippets.

@devthue
devthue / install_docker_ubuntu_16_04.md
Last active July 26, 2017 10:34
Install Docker ubuntu 16.04

Install docker for ubuntu 16.04

apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
apt-get install software-properties-common
apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
apt-get update
apt-cache policy docker-engine
systemctl status docker
apt-get install docker-engine
@devthue
devthue / add_ssh.md
Created March 10, 2017 03:23
Add SSH to server
Macbook-2:~ mac$ cd .ssh
Macbook-2:.ssh mac$ ls
id_rsa		id_rsa.pub	known_hosts
Macbook-2:.ssh mac$ scp id_rsa.pub root@o.test:./id_rsa.pub
root@o.test's password:
id_rsa.pub                                                                                                                                                              100%  406     6.6KB/s   00:00
Macbook-2:.ssh mac$ ssh root@o.test
root@o.test's password:
Welcome to Ubuntu 16.04.1 LTS (GNU/Linux 4.9.7-x86_64-linode80 x86_64)
@devthue
devthue / rsa-php.md
Created October 19, 2016 02:17
Mã hóa RSA với PHP
  • Tạo cặp khóa Publickey và Private key
// Config RSA
$config = array(
    "digest_alg" => "sha512",
    "private_key_bits" => 2048,
    "private_key_type" => OPENSSL_KEYTYPE_RSA,
);
@devthue
devthue / .bashrc
Created October 11, 2016 09:28
Docker .bashrc
service nginx start
service php5-fpm start
cp /hosts /etc/hosts
export TERM=xterm
mongod --fork --logpath /var/log/mongodb.log
@devthue
devthue / Debug-PHP.md
Last active October 21, 2016 15:34
Debug PHP
  • Nếu bị lỗi 404: Sai đường dẫn

  • 500 : Code PHP bị sai lúc này bật log lên xem

  • Sử dụng die('abcd'); trong file index.php

  • Sử dụng hàm hiển thị lỗi trong index.php :

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
@devthue
devthue / Nginx-Config.md
Last active October 18, 2016 15:36
Config Nginx
  • Chỉnh sửa file /etc/hosts ngoài máy thật
127.0.0.1 bigseo.dev
  • Thêm 1 file nginx config mới /etc/nginx/conf.d với tên file bigseo.dev.conf nội dung:

Thay đổi:

@devthue
devthue / create-category-phalcon.md
Last active September 18, 2016 07:40
Create category with Phalcon

Create Category Phalcon

Mysql

id(int, AI)

parent(int)

priority(int)

@devthue
devthue / su-dung-docker.md
Created September 14, 2016 08:28
Sử dụng Docker
@devthue
devthue / docker-ubuntu.md
Created August 19, 2016 03:02
LEMP + RabbitMQ + Redis server (Ubuntu 14.04)

Pull Images

docker pull dinhbang/lemp

Create container from images dinhbang/lemp

@devthue
devthue / iTerm2-Shortcut-key.md
Last active December 18, 2016 11:19
Add in iTerm2 the following Profile Shortcut Keys