Skip to content

Instantly share code, notes, and snippets.

View anhphamt's full-sized avatar

Phamazing anhphamt

View GitHub Profile
@anhphamt
anhphamt / compat_l5.php
Created July 28, 2016 02:52 — forked from vluzrmos/compat_l5.php
Lumen L5 compatibility helpers. That file should be added on root path of your project... and added to your composer.json
<?php
if(!function_exists('config_path'))
{
/**
* Return the path to config files
* @param null $path
* @return string
*/
function config_path($path=null)
@anhphamt
anhphamt / imagemagick-install-steps
Last active November 14, 2016 13:10 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
Try to use below link:
ffmpeg -r 25 -qscale 1 -i %05d.morph.jpg output.mp4
http://www.itforeveryone.co.uk/image-to-video.html
http://superuser.com/questions/624567/ffmpeg-create-a-video-from-images
@anhphamt
anhphamt / install_supervisord_centos.md
Last active February 22, 2022 04:00 — forked from fadhlirahim/installing_supervisor_macosx.md
Setting up supervisord in Mac OSX or CENTOS
@anhphamt
anhphamt / a.md
Created December 10, 2016 09:08 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

@anhphamt
anhphamt / latest-ffmpeg-centos6.sh
Created December 23, 2016 09:46 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum 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
@anhphamt
anhphamt / README.md
Created April 20, 2017 02:18 — forked from oodavid/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@anhphamt
anhphamt / RAILS_CHEATSHEET.md
Created August 20, 2017 03:20 — forked from mdang/RAILS_CHEATSHEET.md
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@anhphamt
anhphamt / routes.rb
Created September 19, 2017 08:44 — forked from tejo/routes.rb
Examples of advanced Rails Routes
Rails.application.routes.draw do
get '/(:locale)/products/(:category)/(page/:page).:extension',
:to => 'products#index',
:as => :products,
:constraints => {
:locale => /[a-z]{2}/,
:category => /.+?/,
:page => /\d+/
},
@anhphamt
anhphamt / successful-rails-nginx-production-deployment.txt
Created January 30, 2018 04:49 — forked from dhirajbajaj/successful-rails-nginx-production-deployment.txt
Ruby on Rails / Postgres / Nginx / Passenger / Capistrano / Ubuntu 14.04 / AWS
#####################################
# 0. SET UP AWS (ASSUMING YOU HAVE ALREADY SET UP AN ACCOUNT)
# CREATE SECURITY GROUP
• In the EC2 Dashboard, click Security Groups, then Create Security Group.
• Enter Name
• Enter Description
• Rules to add:
- HTTP
- SSH