Skip to content

Instantly share code, notes, and snippets.

View nguyenvq's full-sized avatar

Vo Quoc Nguyen nguyenvq

  • HCMC
View GitHub Profile
nguyenvq /
Created March 19, 2024 09:02 — forked from linuxdevops-34/
Complete guide for deploying rails application to aws ec2 instance, using capistrano as deploying tool with nginx & puma server

Deploy Rails Application to AWS EC2

Creating AWS EC2 Instance

- login to 'AWS Management Console' (
- from 'Services'(in navbar) choose 'EC2'
- from 'Create Instance' section, click on 'Launch Instance'
- then select 'AMI' (Amazon Machine Image), we will be using 'Ubuntu Server 16.04 LTS (HVM)' as example
- select 'Instance Type' as per your requirement
- then click 'Next:Configure Instance Details' to continue
  change 'Configure Instance Details' or used as default settings
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
Regex for matching Hirgana or Katakana
Regex for matching Non-Hirgana or Non-Katakana
Regex for matching Hirgana or Katakana or basic punctuation (、。’)
nguyenvq /
Created April 17, 2020 03:00 — forked from spalladino/
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
nguyenvq / hls.conf
Created August 13, 2019 14:48 — forked from jb-alvarado/hls.conf
srs rtmp server with hls multiple bitrates
listen 1935;
max_connections 20;
daemon on;
pid /usr/local/srs/objs/;
srs_log_tank file; # console;
srs_log_file /var/log/srs.log;
ff_log_dir /dev/null;
# can be: verbose, info, trace, warn, error
srs_log_level warn;
nguyenvq / gist:5cbba5dcc4042e06ac139673530feccd
Created October 30, 2018 09:32 — forked from tott/gist:3895832
create cpu load in python
#!/usr/bin/env python
Produces load on all available CPU cores
from multiprocessing import Pool
from multiprocessing import cpu_count
def f(x):
while True:
nguyenvq /
Created August 20, 2018 18:08 — forked from DrYazid/
StarUml 3.0 full version

StarUML 3.0

  • 1- install staruml. : staruml
  • 2- install node.js : node.js
  • 3- go to ...\AppData\Local\Programs\StarUML\resources
  • 4- open CMD As admin
  • 5- execute
nguyenvq / A Nuxt.js VPS production
Created August 1, 2018 10:19 — forked from DreaMinder/A Nuxt.js VPS production
Deployment manual for a real-world project built with nuxt.js + koa + nginx + pm2

Example of deployment process which I use in my Nuxt.js projects. I usually have 3 components running per project: admin SPA, nuxt.js renderer and JSON API.

This manual is relevant for VPS such as or It's easier to use things like Now for deployment but for most cases VPS gives more flexebillity needed for projects bigger then a landing page.

Let's assume that you have entered fresh installation of Ubuntu instance via SSH. Let's rock:

1.Initial setup.

nguyenvq /
Created March 13, 2018 07:49 — forked from GhazanfarMir/
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## Install NGINX ##############
# Install software-properties-common package to give us add-apt-repository package
sudo apt-get install -y software-properties-common
# Install latest nginx version from community maintained ppa
sudo add-apt-repository ppa:nginx/stable
# Update packages after adding ppa
nguyenvq / .htaccess
Created February 27, 2018 06:21 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /