Skip to content

Instantly share code, notes, and snippets.

View trinvh's full-sized avatar

Tri Nguyen trinvh

View GitHub Profile
@trinvh
trinvh / gist:af1adef88213fe76917d941a7430f97c
Created February 27, 2018 10:52 — forked from rkuzsma/gist:b9a0e342c56479f5e58d654b1341f01e
Example Kubernetes yaml to pull a private DockerHub image
Step by step how to pull a private DockerHub hosted image in a Kubernetes YML.
export DOCKER_REGISTRY_SERVER=https://index.docker.io/v1/
export DOCKER_USER=Type your dockerhub username, same as when you `docker login`
export DOCKER_EMAIL=Type your dockerhub email, same as when you `docker login`
export DOCKER_PASSWORD=Type your dockerhub pw, same as when you `docker login`
kubectl create secret docker-registry myregistrykey \
--docker-server=$DOCKER_REGISTRY_SERVER \
--docker-username=$DOCKER_USER \
@trinvh
trinvh / router.php
Last active April 2, 2018 10:22
router.php
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$DOMAIN = 'api.mixcord.co';
$site = "https://" . $DOMAIN;
$request = $_SERVER["REQUEST_URI"];
$url = $site . $request;
@trinvh
trinvh / prod-mixcord-default.conf
Last active June 14, 2018 06:41
prod-mixcord-default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
root /var/www/html;
index index.ssp index.html index.htm index.php;
server_name _;
@trinvh
trinvh / staging-mixcord-default.conf
Last active June 14, 2018 06:42
staging-mixcord-default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
root /var/www/html;
index index.ssp index.html index.htm index.php;
server_name _;
@trinvh
trinvh / www.conf
Created April 26, 2018 01:58
Default php7.0-fpm config
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
@trinvh
trinvh / nginx.conf
Created May 16, 2018 17:29 — forked from ashleydw/nginx.conf
Laravel nginx conf file
server {
listen 80 default_server;
server_name example.com www.example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public;
index index.php index.html;
@trinvh
trinvh / coreos.yml
Created May 17, 2018 06:58
Docker composer for CoreOS Cloud config
files:
- path: /opt/bin/docker-compose
filesystem: root
mode: 0744
contents:
remote:
url: https://github.com/docker/compose/releases/download/1.21.2/docker-compose-Linux-x86_64
verification:
hash:
function: sha512
@trinvh
trinvh / .env
Created May 27, 2018 06:07
mixcord-prod.env
{
"environment": "prod"
}
@trinvh
trinvh / .env
Created May 27, 2018 06:08
mixcord-staging.env
{
"environment": "staging"
}
@trinvh
trinvh / dev-mixcord-default.conf
Last active June 14, 2018 06:42
dev-mixcord-default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
root /var/www/html;
index index.ssp index.html index.htm index.php;
server_name _;