Skip to content

Instantly share code, notes, and snippets.

@nkokkos
nkokkos / nginx.conf
Created May 30, 2013 09:50
This is an nginx configuration file for serving 2 or more rails applications at their own suburi using the passenger gem. That is, if you have a server http://myserver.com and you want to serve your app at http://myserver.com/app1 and your app2 at http://myserver.com/app2
#/opt/nginx/conf/nginx.conf
user nginx;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid logs/nginx.pid;
@nkokkos
nkokkos / gswin32c.exe
Last active October 15, 2018 09:49
Create a pdf file from a bunch of other pdf files
gswinc32.exe \
-dBATCH \
-dNOPAUSE \
-sDEVICE=pdfwrite \
-sOutPutFile=output.pdf \
input_1.pdf input_2.pdf input_3.pdf etc..

ffmpeg short guide

Supported input formats

$ ffmpeg -formats

Sub-clip Creation

$ ffmpeg -i input_file -ss timecode -t timecode -vcodec copy -acodec copy  output_file 

ex:
ffmpeg -i recorder_A.vob -ss 00:03:00 -t 00:30:15 -vcodec mpeg4 -acodec aac recorder_A.mp4

Audio Volume Modification

# set session for the very first time the app runs. It should go into the application controller
session[:locale] = I18n.default_locale if session[:locale].nil?