Skip to content

Instantly share code, notes, and snippets.

View hoannc54's full-sized avatar

Nguyễn Công Hoan hoannc54

  • Hanoi
View GitHub Profile
@hoannc54
hoannc54 / docker-install-ubuntu-1804.sh
Last active October 27, 2018 02:05
Docker install
# Docker installation script for Ubuntu 16.04 (Xenial) on Azure
# Usage: execute sudo -i, first.
# wget -q -O - "$@" https://gist.githubusercontent.com/tsaqib/9c7c6eed460930b1a14665043bd2157c/raw/ --no-cache | sh
# After running the script reboot and check whether docker is running.
apt-get update -y
apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@hoannc54
hoannc54 / pdf2htmlEX
Created October 15, 2018 02:18
pdf2htmlEX
Usage: pdf2htmlEX [options] <input.pdf> [<output.html>]
-f,--first-page <int> first page to convert (default: 1)
-l,--last-page <int> last page to convert (default: 2147483647)
--zoom <fp> zoom ratio
--fit-width <fp> fit width to <fp> pixels
--fit-height <fp> fit height to <fp> pixels
--use-cropbox <int> use CropBox instead of MediaBox (default: 1)
--hdpi <fp> horizontal resolution for graphics in DPI (default: 144)
--vdpi <fp> vertical resolution for graphics in DPI (default: 144)
@hoannc54
hoannc54 / latest-ffmpeg-centos7.sh
Last active November 22, 2018 23:43 — forked from bodny/latest-ffmpeg-centos7.sh
Installs latest ffmpeg on Centos 7
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum -y install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@hoannc54
hoannc54 / apps.yml
Last active July 27, 2018 15:38 — forked from vuthaihoc/apps.yml
Build ffmpeg 4 with fdk-aac x264 x265 xvid lame on centos 6
apps:
- script : /path/to/artisan
name : 'converter'
interpreter : /path/to/php
cwd : /path/to/code
exec_mode: fork
args : args1 args2
autorestart : true
restart_delay : 30000
out_file : /path/to/log/converter.out.log
@hoannc54
hoannc54 / migrate.sh
Created May 28, 2018 09:27 — forked from pedro-santiago/migrate.sh
Upgrade MAMP 4 to Mysql 5.7.18 (on Sierra tested)
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.18-macos10.12-x86_64.tar.gz
tar xfvz mysql-5.7.18-macos10.12-x86_64.tar.gz
echo "Stopping MAMP"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "Copy Bin"
@hoannc54
hoannc54 / migrate.sh
Created May 11, 2018 02:50 — forked from pepijnblom/migrate.sh
Upgrade MAMP to Mysql 5.7
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.15-osx10.11-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"

Source

Chỉ mục hỗn hợp - kiến thức cơ sở MariaDB

Một bhọc bài học nhỏ trong "Chỉ mục hỗn hợp"

Tài lnày tài liệu này tầm thường và có lẽ là nhàm chán, nhưng lại tạo nên nhiều thông tin thú vị, có lẽ điều mà bạn không nhận ra về cách hoạt động đánh chỉ mục của MariaDB và MySQL.

Điều này cũng giải thích [EXPLAIN][1] (đến một mức độ nào đó).

Source

Compound (Composite) Indexes - MariaDB Knowledge Base

A mini-lesson in "compound indexes" ("composite indexes")

This document starts out trivial and perhaps boring, but builds up to more interesting information, perhaps things you did not realize about how MariaDB and MySQL indexing works.

This also explains [EXPLAIN][1] (to some extent).

@hoannc54
hoannc54 / AbstractFoo.php
Created April 18, 2018 21:25 — forked from pjdietz/cloudSettings
Testing Protected Method of Abstract Class with PHPUnit
<?php
namespace Minitest;
abstract class AbstractFoo
{
protected function bar()
{
return $this->baz();
}
@hoannc54
hoannc54 / gist:46aad49a152c7b4dec6c9b2b8e780d0d
Created November 23, 2017 03:31
API Token Authentication in Laravel 5.2 & 5.3
Gioi thieu API TOKEN