Skip to content

Instantly share code, notes, and snippets.

View oanhnn's full-sized avatar

Oanh Nguyen oanhnn

View GitHub Profile

Keybase proof

I hereby claim:

  • I am oanhnn on github.
  • I am oanhnn ( on keybase.
  • I have a public key ASBz46P9m49f_0yO5K2NGtyVdTIOlUErX1eGVu1ZhavbmQo

To claim this, I am signing this object:

oanhnn /
Created July 19, 2023 02:45
Show My IP on MacOS
echo "Public IP:" $(curl -s
echo "Private IP:"
echo "- en0:" $(ipconfig getifaddr en0 || echo 'Not connected')
echo "- en5:" $(ipconfig getifaddr en5 || echo 'Not connected')
oanhnn / crontab -e
Last active March 8, 2024 05:22
Scripts for gitlab and gitlab runner
# Clear Gitlab runner cache (docker) weekly at 17:05 on Saturday (UTC)
5 17 * * 6 sudo /usr/share/gitlab-runner/clear-docker-cache prune-volumes >/dev/null 2>&1
oanhnn / js.code-workplace
Last active August 27, 2019 09:52
VSCode settings
"folders": [
"path": "..."
"settings": {
"emmet.includeLanguages": {
"javascript": "html",
"vue": "html",
const callbackFunction1 = function(
) {
// Get the maximum by checking first if there is a maximum from the previous step
const maximum = accumulator.maximum
? // If there is, then check if the current element is higher than the previous maximum
oanhnn /
Last active March 27, 2019 09:05
LEMP provider scripts
#!/bin/bash -ex
addgroup dev
adduser --disabled-password --ingroup dev $SSHUSER
usermod -aG sudo $SSHUSER
mkdir -p /home/$SSHUSER/.ssh
oanhnn / input-range.scss
Created May 17, 2018 09:24
Styling Cross-Browser Compatible Range Inputs with Sass
// Styling Cross-Browser Compatible Range Inputs with Sass
// Github:
// Author: Darlan Rod
// Version 1.4.1
// MIT License
$track-color: #eceff1 !default;
$thumb-color: #607d8b !default;
$thumb-radius: 12px !default;
oanhnn /
Created May 3, 2018 08:30
Install wkhtmltopdf on AMZ Linux
#!/usr/bin/env bash
yum -y install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo openssl icu
wget${VERSION}/wkhtmltox-${VERSION}_linux-generic-amd64.tar.xz --dns-timeout=5 --connect-timeout=5
tar -xJf wkhtmltox-${VERSION}_linux-generic-amd64.tar.xz
cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
oanhnn /
Last active November 21, 2020 23:11
[Ubuntu 16.04] Setup server using NGINX proxy multi site with SSL (Certbot)
#!/usr/bin/env bash
service nginx stop
rm -rf /etc/nginx/sites-available/10-${APP_SLUG}.conf /etc/nginx/sites-enabled/10-${APP_SLUG}
echo "[✔] Remove Virtual Host for ${DOMAIN}"
oanhnn /
Last active September 23, 2017 10:28
Deploy laravel to shared host

Phương pháp triển khai ứng dụng Laravel trên shared hosting

Hướng dẫn đơn giản để triển khai ứng dụng Laravel và Lumen trên shared hosting.

Yêu cầu

Before trying to deploy a Laravel application on a shared hosting, you need to make sure that the hosting services provide a fit requirement to Laravel. Basically, following items are required for Laravel 5.2: Trước khi thực hiện triển khai ứng dụng Laravel trên shared hosting, bạn cần đảm bảo nhà cung cấp dịch vụ cho bạn môi trường với các yêu cầu cần thiết cho Laravel. Về cơ bản, yêu cầu cho Laravel 5.2 như sau:

  • PHP >= 5.5.9