Skip to content

Instantly share code, notes, and snippets.

View hieubuiduc's full-sized avatar

Hieu Bui Duc hieubuiduc

  • Zonmob Tech., JSC
  • Hanoi, Vietnam
View GitHub Profile
@hieubuiduc
hieubuiduc / install_gearman_php.sh
Created December 12, 2015 17:42
Install Gearman PHP extension on CentOS 6,7
#!/bin/sh
# Auto update
yum update
# Install the required packages
yum install libgearman-devel gcc
# Install php
yum -y install php php-pear php-mysql php-mcrypt php-mbstring
@hieubuiduc
hieubuiduc / nginx.conf
Last active March 17, 2020 13:01
Nginx default configuration file
# Nginx Configuration File
# http://wiki.nginx.org/Configuration
# Run as a less privileged user for security reasons.
user nginx;
# Set this parameters to the number of CPU core
# cat /proc/cpuinfo | grep processor | wc -l
# The maximum number of connections for Nginx is calculated by:
# max_clients = worker_processes * worker_connections
worker_processes 2;
@hieubuiduc
hieubuiduc / nginx
Created December 17, 2014 06:36
CentOS Nginx Init Script
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /etc/nginx/nginx.conf
# config: /etc/sysconfig/nginx
@hieubuiduc
hieubuiduc / nginx_install.sh
Last active March 17, 2020 13:01
Script to install/upgrade Nginx (Naxsi, PageSpeed, PCRE) from sources on CentOS 6
#!/bin/bash
#
# Script to install/upgrade Nginx(Naxsi,PageSpeed,PCRE) from sources on CentOS 6
#
# Author: Duc Hieu - 12/2014.
# Base System: CentOS release 6.6 (Final)
# License: MIT
#
# Syntax: # sh nginx_install.sh
#
@hieubuiduc
hieubuiduc / ruby_install.sh
Created January 24, 2014 07:53
Install Ruby for CentOS
#!/bin/sh
# Created by Hieu Bui Duc
cd /tmp
#Remove old Ruby
yum remove ruby
# Install dependencies
yum groupinstall "Development Tools"
yum install zlib zlib-devel
yum install openssl-devel
wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
@hieubuiduc
hieubuiduc / openerp_install.sh
Created January 24, 2014 07:51
Install OpenERP for CentOS
#!/bin/sh
# Author: Duc Hieu
# Modified script from Carlos E. Fonseca Zorrilla
yum -y install wget unzip
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://yum.pgrpms.org/9.2/redhat/rhel-6-i386/pgdg-centos92-9.2-6.noarch.rpm
yum -y install python-psycopg2 python-lxml PyXML python-setuptools libxslt-python pytz \
python-matplotlib python-babel python-mako python-dateutil python-psycopg2 \
pychart pydot python-reportlab python-devel python-imaging python-vobject \
hippo-canvas-python mx python-gdata python-ldap python-openid \
@hieubuiduc
hieubuiduc / yii_nginx.conf
Last active March 17, 2020 13:01
Yii Nginx Configuration
server {
listen 80;
server_name localhost;
root /var/www/yii;
access_log /var/log/nginx/yii_access.log;
error_log /var/log/nginx/yii_error.log;
index index.php;
client_max_body_size 25M;
@hieubuiduc
hieubuiduc / laravel4_nginx.conf
Created January 23, 2014 02:28
Laravel 4 Nginx Configuration
server {
# Port that the web server will listen on.
listen 80;
# Host that will serve this project.
server_name laravel.com;
# The location of our projects public directory.
root /var/www/laravel.com/public/;
# Point index to the Laravel front controller.
index index.html index.php;