Skip to content

Instantly share code, notes, and snippets.

Sergey Kozlov SergeyKozlov

Block or report user

Report or block SergeyKozlov

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
SergeyKozlov / template-download
Created Mar 29, 2019 — forked from elmariachi111/template-download
JQuery-File-Upload templates written in Mustache / Handlebars
View template-download
<tr class="template-download fade">
<td class="name"><span>{{name}}</span></td>
<td class="size"><span></span></td>
<td class="error" colspan="2">
<span class="label label-important">{{error}}</span></td>
SergeyKozlov / gist:ffdcf821c7908d15ef1c6d7316ed9317
Created Sep 24, 2018 — forked from danielgwood/gist:1510463
Human formatted time between dates (JavaScript)
View gist:ffdcf821c7908d15ef1c6d7316ed9317
* Given two dates (or one date and assume "now" for the second), convert this to
* a human-readable string, like "2 months".
* I use this to put "3 months ago" strings into plugins. My use case has the date
* coming in as a seconds-only UNIX epoch, so the params are expected at this.
* @param time1 integer Number of seconds since UNIX epoch
* @param time2 integer Number of seconds since UNIX epoch
* @return string
SergeyKozlov / Rakefile.rb
Created Jul 6, 2018 — forked from Epictetus/Rakefile.rb
How to do automatic backup with Heroku PGBackups and Heroku Cron.
View Rakefile.rb
require 'aws/s3'
require 'heroku'
require 'heroku/command'
require 'heroku/command/auth'
require 'heroku/command/pgbackups'
task :cron do
class Heroku::Auth
def self.client ENV['heroku_login'], ENV['heroku_passwd']
SergeyKozlov /
Created Feb 27, 2018
This gist will show you how to build a minimalist, statically-linked ffmpeg binary under the ~/bin subdirectory on your home on Ubuntu 16.04LTS. Comes with NPP, CUDA and NVENC capabilities.

Minimalist static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/
SergeyKozlov /
Created Feb 26, 2018 — forked from teocci/
Compile FFmpeg on Ubuntu 16.04

Compile FFmpeg on Ubuntu

This basic guide supports Ubuntu Xenial Xerus 16.04 and will enable several external encoding and decoding libraries: libfaac (AAC encoder), libfdk-aac (AAC encoder), libmp3lame (MP3 encoder), libopencore-amr (AMR encoder/decoder), librtmp (for additional RTMP protocols), libtheora (Theora encoder), libvorbis (Vorbis encoder), libvpx (VP8 encoder/decoder), and libx264 (H.264 encoder). These are optional and may be omitted if desired. This guide will also install many filters (see the filter list in the [Filtering Guide][1].

Note: Copy and paste the whole code box for each step.


SergeyKozlov /
Created Feb 22, 2018 — forked from mrbar42/
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)


bash beach.mkv

will produce:

      |- playlist.m3u8
      |- 360p.m3u8
SergeyKozlov /
Created Jan 23, 2018 — forked from umpirsky/
Install Ubuntu on RAID 0 and UEFI/GPT system
sudo -s
apt-get -y install mdadm
apt-get -y install grub-efi-amd64
sgdisk -z /dev/sda
sgdisk -z /dev/sdb
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda
SergeyKozlov /
Created Nov 23, 2017 — forked from Vestride/
Encoding video for the web

Encoding Video


Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
SergeyKozlov / nginx.default.conf
Created Oct 8, 2017 — forked from sumardi/nginx.default.conf
Install PHP-FPM, Nginx & MySQL on EC2 with Amazon Linux AMI
View nginx.default.conf
# Install linux update, followed by GCC and Make
sudo yum -y update
sudo yum install -y gcc make
# Install Nginx and PHP-FPM
sudo yum install -y nginx php-fpm
# Install PHP extensions
sudo yum install -y php-devel php-mysql php-pdo \
php-pear php-mbstring php-cli php-odbc \
SergeyKozlov / rowdeleter.rb
Created Sep 26, 2017 — forked from noomerikal/rowdeleter.rb
RowDeleter for HBase Scan with TimeRange
View rowdeleter.rb
Usage: /bin/hbase shell rowdeleter.rb
import java.text.SimpleDateFormat
import java.text.ParsePosition
import java.util.Date
import org.apache.hadoop.hbase.client.Delete
import org.apache.hadoop.hbase.client.HTable
You can’t perform that action at this time.