Skip to content

Instantly share code, notes, and snippets.

Avatar
🇻🇳

Oanh Nguyen oanhnn

🇻🇳
View GitHub Profile
@oanhnn
oanhnn / install-redis.sh
Created May 9, 2018 02:56 — forked from khelll/install-redis.sh
Installing Redis on Amazon Linux
View install-redis.sh
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=3.2.0
echo "*****************************************"
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make"
@oanhnn
oanhnn / laravel-queue.service
Last active January 12, 2022 05:19 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
View laravel-queue.service
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@oanhnn
oanhnn / bash-cheatsheet.sh
Created May 31, 2017 01:40 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@oanhnn
oanhnn / install-comodo-ssl-cert-for-nginx.rst
Created May 5, 2017 04:58 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.
View install-comodo-ssl-cert-for-nginx.rst

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@oanhnn
oanhnn / update_docker.sh
Created March 21, 2017 11:22 — forked from dylanscott/update_docker.sh
Travis Update to Docker 1.13
View update_docker.sh
#!/usr/bin/env bash
set -euo pipefail
sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-$(lsb_release -cs) main" > /etc/apt/sources.list.d/docker.list'
curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
sudo apt-key fingerprint 58118E89F3A912897C070ADBF76221572C52609D
sudo apt-get update
sudo apt-get -y install "docker-engine=1.13.1-0~ubuntu-$(lsb_release -cs)"
@oanhnn
oanhnn / vagrant.org
Created May 16, 2016 02:19 — forked from akiatoji/vagrant.org
CentOS 6.2 Box for Vagrant
View vagrant.org

Installing CentOS

Download net install iso: CentOS-6.2-x86_64-netinstall.iso

Create a new VirtualBox machine

  • Name: vagrant-centos
  • Operating System: Linux
  • Version: Red Hat
@oanhnn
oanhnn / .bashrc
Created September 24, 2015 09:43 — forked from zachharkey/.bashrc
Cpanel .bashrc to prevent error: "stdin: is not a tty"
View .bashrc
# .bashrc
# Prevent "stdin: is not a tty" errors
if [ $(expr index "$-" i) -eq 0 ]; then
return
fi
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
View redis-delkeys.sh
#!/bin/sh
#
# Usage: ./redis-delkeys.sh [-h host] [-p port] [-n db] pattern
#
# Matches keys with the KEYS command matching pattern
# and deletes them from the specified Redis DB.
set -e
HOST="localhost"
View regex-japanese.txt
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 (、。’)