Keybase proof

I hereby claim:

  • I am thuannvn on github.
  • I am thuan_ng ( on keybase.
  • I have a public key whose fingerprint is 10D8 6C2B 634B 33C4 049D 9C8F 99D1 B666 0D86 CFFC

To claim this, I am signing this object:

#!/bin/bash -e
if [ "$UID" -ne 0 ]; then
echo "Please run as root"
exit 1
# Only run it if we can (ie. on Ubuntu/Debian)
if [ -x /usr/bin/apt-get ]; then
apt-get update
import subprocess
def uptime():
raw = subprocess.check_output('uptime').replace(',','')
days = int(raw.split()[2])
if 'min' in raw:
hours = 0
minutes = int(raw[4])
hours, minutes = map(int,raw.split()[4].split(':'))

A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


View terraform-2tier-vpc
# define some variables
variable "aws_ubuntu_ami" {
default = "ami-972444ad"
variable "aws_keypair" {
default = "xxxx"
# AWS account details
View slackpost
# Usage: slackpost <token> <channel> <message>
# Enter the name of your slack host here - the thing that appears in your URL:

Nginx FastCGI cache

Example /etc/nginx/nginx.conf using FastCGI (e.g. to PHP-FPM) with FastCGI cache enabled. This will capture returned data and persist it to a disk based cache store for a configurable amount of time, great for robust full page caching.

Will need to create a directory to hold cache files, for the example given here that would be:

$ sudo mkdir -p /var/cache/nginxfastcgi
$ chown www-data: /var/cache/nginxfastcgi
# Copyright (c) 2011, Xabier (slok) Larrakoetxea
# Copyright (c) 2011, Iraide (Sharem) Diaz
# 3 clause/New BSD license:
# opensource:
# wikipedia:
# This script allows to upload to Fileserve with FTP various files at the same time
View deploy.yml
- hosts: all
gather_facts: no
- name: Backup database
shell: "{{ item }}"
- mkdir -p ~jenkins/dbbackups
- drush @{{ shortname }}_{{ env }} sql-dump --skip-tables-key=common | gzip > ~jenkins/dbbackups/{{ shortname }}_{{ env }}_prior_to_{{ build }}.sql.gz