Skip to content

Instantly share code, notes, and snippets.

View trungpv1601's full-sized avatar
🤖
Diversifying; Practical; more code than talk.

trungpv trungpv1601

🤖
Diversifying; Practical; more code than talk.
View GitHub Profile
@trungpv1601
trungpv1601 / Laravel PHP7 LEMP AWS.md
Created July 28, 2017 05:35 — forked from santoshachari/Laravel PHP7 LEMP AWS.md
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@trungpv1601
trungpv1601 / elasticsearch-es-delete-all-data.md
Created August 25, 2017 13:01 — forked from diegopacheco/elasticsearch-es-delete-all-data.md
How to Delete All Data in Elasticsearch?
curl -XDELETE localhost:9200/*
@trungpv1601
trungpv1601 / youtubedl.mp3.sh
Last active September 19, 2017 13:29 — forked from rugbyprof/youtubedl.mp3.sh
youtube dl as mp3
youtube-dl --extract-audio --audio-format mp3 <video URL>
youtube-dl -i "<Youtube URL>" -o "%(title)s.%(ext)s" --extract-audio --audio-format "mp3" --audio-quality "192k"
youtube-dl --extract-audio --audio-format mp3 --audio-quality 0 URL
@trungpv1601
trungpv1601 / ts-dl.sh
Created September 13, 2017 08:48 — forked from katopz/ts-dl.sh
Download .ts video file by ffmpeg via .m3u8
# Install ffmpeg
brew install ffmpeg
# Download
ffmpeg -i https://foo.com/bar.m3u8 -c copy -bsf:a aac_adtstoasc output.mp4
@trungpv1601
trungpv1601 / install.sh
Created November 10, 2017 06:44 — forked from indreklasn/install.sh
init our node project, install next, react, react-dom, making /pages dir
mkdir next-react-ssr && cd next-react-ssr && npm init -y && npm install --save react react-dom next && mkdir pages
@trungpv1601
trungpv1601 / uuids.php
Created November 21, 2017 03:53 — forked from renebakx/uuids.php
Laravel 5.4 UUID Trait
<?php
namespace App\Traits;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Ramsey\Uuid\Uuid;
trait Uuids {
@trungpv1601
trungpv1601 / gist:b9936bb455f034d10bfc2bdecfabcae9
Created December 1, 2017 04:31 — forked from Mikodes/gist:be9b9ce42e46c3d4ccb6
All Media queries for resolutions
/* (320x480) iPhone (Original, 3G, 3GS) */
@media only screen and (min-device-width: 320px) and (max-device-width: 480px) {
/* insert styles here */
}
/* (320x480) Smartphone, Portrait */
@media only screen and (device-width: 320px) and (orientation: portrait) {
/* insert styles here */
}
function getBaseUrl($includeTrailingSlash = FALSE)
{
$protocol = (isset($_SERVER['HTTPS']) && 'off' !== $_SERVER['HTTPS']) ? 'https' : 'http';
$domain = php_uname('n');
$port = '';
if (isset($_SERVER['HTTP_HOST'])) {
$domain = filter_input(
INPUT_SERVER,
'HTTP_HOST',
@trungpv1601
trungpv1601 / my.cnf
Created March 23, 2019 09:36 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# === Updated December 2018 ===
#
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have less or more resources available you should adjust accordingly to save CPU,
# RAM and disk I/O usage.
# The settings marked with a specific comment or the word "UPD" after the value
@trungpv1601
trungpv1601 / README.md
Created July 10, 2019 06:03 — forked from leek/_Magento1_DeleteTestData.md
Magento 1 - Delete All Test Data

These set of scripts are for Magento 1. For Magento 2, see this Gist.