Skip to content

Instantly share code, notes, and snippets.

View tuyenv's full-sized avatar

Tuyen Vuong tuyenv

View GitHub Profile
@tuyenv
tuyenv / setup-macbook
Last active October 21, 2019 19:53
Setup Development ENV on MacOS: Apache, PHP
#requirements
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew install openldap libiconv
#httpd
brew install httpd
sudo brew services start httpd
config 80 and localhost: /usr/local/etc/httpd/httpd.conf
@tuyenv
tuyenv / custom-social-share.html
Created August 15, 2019 05:21 — forked from mrtonyhuynh/custom-social-share.html
Custom Social Share Button with Callback
<html>
<head>
<title>Social Share</title>
</head>
<body>
<h2>Custom Social Share Button with Callback</h2>
<button id="share-facebook">Share on Facebook</button>
<button id="share-twitter">Share on Twitter</button>
@tuyenv
tuyenv / eu_cookie_banner.js
Created June 5, 2019 14:42 — forked from bavington/eu_cookie_banner.js
Simple EU Cookie Law Banner JavaScript
@tuyenv
tuyenv / install_elasticsearch_osx.md
Created August 20, 2018 15:49 — forked from djonsson/install_elasticsearch_osx.md
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@tuyenv
tuyenv / nginx-tuning.md
Created January 2, 2018 08:59 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@tuyenv
tuyenv / nginx.conf
Created November 20, 2017 23:30 — forked from denys281/nginx.conf
phpmyadmin nginx virtual host (php-fpm)
server {
# Listen on port 81
listen 81;
# Server name being used (exact name, wildcards or regular expression)
# server_name phpmyadmin.my;
root /usr/share/phpmyadmin;
@tuyenv
tuyenv / download.php
Created November 16, 2017 10:15 — forked from eliah-w/download.php
PHP Download Script
<?php
##################################################################################################
##################################################################################################
## Description: PHP Download Controller ##
## Author: vanita5 <[email protected]> ##
## Date: Nov 2014 ##
## File: download.php ##
## Version: 1.0 ##
## ##
## ##
@tuyenv
tuyenv / elasticsearch.yml
Created September 14, 2017 08:16
/etc/elasticsearch/elasticsearch.yml
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please see the documentation for further information on configuration options:
module.exports = function() {
var client = 'client',
clientApp = './client/app'
dist = 'dist',
tmp = '.tmp',
docs = 'documentation',
landing = 'landing';
var config = {
client: client,
dist: dist,