Skip to content

Instantly share code, notes, and snippets.

View duythien's full-sized avatar
🏠
Working from home

Thien Tran duythien

🏠
Working from home
View GitHub Profile
@duythien
duythien / gist:9666658
Created March 20, 2014 15:40
http.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@duythien
duythien / gist:9885387
Last active August 29, 2015 13:57
nginx.conf
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
# multi_accept on;
}
http {
@duythien
duythien / gist:9917340
Created April 1, 2014 16:10
dnscrypt.service
# For more info about custom unit files, see systemd.unit(5) or
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
# For example, if you want to increase mysql's open-files-limit to 10000,
# you need to increase systemd's LimitNOFILE setting, so create a file named
# "/etc/systemd/system/mariadb.service.d/limits.conf" containing:
# [Service]
# LimitNOFILE=10000
SELECT t.*, tt.*, tr.object_id, p.*
FROM wp_terms AS t
INNER JOIN wp_posts AS p
ON p.id = t.term_id
INNER JOIN wp_term_taxonomy AS tt
ON tt.term_id = t.term_id
INNER JOIN wp_term_relationships AS tr
ON tr.term_taxonomy_id = tt.term_taxonomy_id
WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format')
AND tr.object_id IN (8)
1/https://www.drupal.org/project/backstretch module provide set backgroud full page
2/hook_process_page custom logo any page, etc
3/https://www.drupal.org/project/views_merge_rows
@duythien
duythien / gist:cfd806c6ee28b10d5f0e
Created October 3, 2014 08:46
Multi version php
Configure: error: Cannot find openssl's <evp.h>
# yum install openssl-devel
Could not find pcre.h in /usr
# yum install pcre-devel

###Send a pull request on GitHub for only latest commit

git checkout -b upstream upstream/master

git cherry-pick

git push origin upstream

@duythien
duythien / gist:4d045c8d2f3844c471f2
Last active May 30, 2016 09:10
Install multiple Phalcon

In this particular post, we intend to offer a solution to install multiple versions of Phalcon, PHP and run them on a single web server. The PHP 5.5.x and 5.6.x will be used in here, but you can replace it with other versions. Any servers that support PHP-FPM should be enough but we recommend using the Nginx for the web server. The environment using in this tutorial is Fedora OS - a Linux system.

Preliminary Note

This tutorial will cover the installation of PHP 5.5.x correspoding Phalcon 1.3.x and PHP 5.6.x correspoding Phalcon 2.0.0. We also configuration some Nginx

Installing Nginx

Nginx is an available package in Fedora OS which we can install as follow:

@duythien
duythien / php_parks.md
Last active August 29, 2015 14:12 — forked from ryanj/php_parks.md

Open Source Mapping with PHP and MongoDB

In response to Steve's call for a shift toward civic-focused applications that are a better suited for adoption and maintenance by PHP-friendly IT departments, I've momentarily set aside OpenShift's shiny new nodejs-0.10 cartridge in order to show you how easy it is to write a basic single-page mapping application in PHP.

Those of you who are familiar with Steve's mapping quickstarts may recognize this application as a port of his own MongoDB-Python-Flask example which uses MongoDB's spatial features to perform a classic bounding-box query.

*Project source: [https://github.com/openshift-quickstart/silex-mongodb-pa