Skip to content

Instantly share code, notes, and snippets.

@trungpv93
trungpv93 / install.sh
Created July 19, 2016 08:02
Install Laravel 5.2 with NGINX and PHP-7.0 on Ubuntu
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install nginx php7.0-fpm php7.0-cli php7.0-mcrypt php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mbstring php7.0-mysql php7.0-readline php7.0-xml php7.0-zip git
sudo nano /etc/php/7.0/fpm/php.ini
#cgi.fix_pathinfo=0
sudo phpenmod mcrypt curl gd imap json mbstring mysql readline xml
@trungpv93
trungpv93 / google-img-resize.mdown
Created August 19, 2016 18:11
Google’s authentication-less on-the-fly image resizing service

Google's authentication-less on-the-fly image resizing service

I found it while poking around the Google+ HTML. Jotting down some notes felt like a good idea, so here goes. If you know more about this API, let me know, please!

(Word of warning: I spent ~30 minutes on both my experimentation and this here write-up, so it might not be the most thought-provoking, brilliant thing you read today.)

cd ~
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
composer create-project --prefer-dist laravel/laravel laravel
sudo chown -R :www-data laravel
sudo chmod -R 775 laravel/storage
@trungpv93
trungpv93 / mail-setup.sh
Last active December 10, 2019 07:30
Install Postfix, Dovecot, RoundCube on Ubuntu 14.04
#!/usr/bin/env bash
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
DOMAIN="xxx.vn"
PASS_DB_ROUNDCUBE="xxx"
apm install minimap minimap-cursorline emmet double-tag atom-beautify autoclose-html highlight-selected code-peek remote-sync seti-ui seti-syntax
@trungpv93
trungpv93 / Microsoft SQL Server 環境の構築.md
Created October 5, 2016 09:35 — forked from yuga/Microsoft SQL Server 環境の構築.md
WindowsにSQL Server 2012 Expressをインストールして、Linux上のHaskellからODBCで接続できるようになるまで。

Microsoft SQL Server 環境の構築

  • Server: Widnwos & SQL Server
  • Client: Linux

Microsoft SQL Server 2012 Express のインストール方法

@trungpv93
trungpv93 / Tiếng việt trong Laravel + SQL Server trên Ubuntu.md
Last active November 2, 2016 09:45
Tiếng việt trong Laravel + SQL Server trên Ubuntu
  • Cài đặt FreeTDS

$ apt-get install libsybdb5 freetds-common php5-sybase

  • Thêm cấu hình trong config/database.php trong Laravel 5
'sqlsrv' => [
            'driver' => 'sqlsrv',
 'host' => env('DB_HOST', 'localhost'),
@trungpv93
trungpv93 / gulpfile.js
Created October 7, 2016 11:12
AdminLTE Theme for Laravel 5
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
@trungpv93
trungpv93 / gist:5c094d69b560823fba38e2a810c8d8a1
Created October 19, 2016 07:39
Fix issue Select2 in Modal Bootstrap
//Fix Select2 In Modal
$.fn.modal.Constructor.prototype.enforceFocus = function () {
//Initialize Select2 Elements
$(".select2").select2();
};
@trungpv93
trungpv93 / gist:81ae2a89c83338fe123634659601dc2f
Created October 20, 2016 09:11
How To Compress AVI and MP4 Video Files With FFmpeg - Ubuntu/Debian
ffmpeg -i input.avi -vcodec msmpeg4v2 output.avi
ffmpeg -i input.mp4 -acodec mp2 output.mp4