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
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">
{{#error}}
<td></td>
<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>
{{/error}}
{{^error}}
@SergeyKozlov
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
SergeyKozlov / Rakefile.rb
Created Jul 6, 2018 — forked from Epictetus/Rakefile.rb
How to do automatic backup with Heroku PGBackups and Heroku Cron. http://carlhoerberg.com/automatic-backup-of-heroku-database-to-s3
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
Heroku::Client.new ENV['heroku_login'], ENV['heroku_passwd']
@SergeyKozlov
SergeyKozlov / ffmpeg-minimalist-build-nvenc-static.md
Created Feb 27, 2018 — forked from Brainiarc7/ffmpeg-minimalist-build-nvenc-static.md
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.
View ffmpeg-minimalist-build-nvenc-static.md

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
SergeyKozlov / compile_ffmpeg.md
Created Feb 26, 2018 — forked from teocci/compile_ffmpeg.md
Compile FFmpeg on Ubuntu 16.04
View compile_ffmpeg.md

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.

Preparation

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

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
      |- 360p.m3u8
@SergeyKozlov
SergeyKozlov / ubuntu-raid.sh
Created Jan 23, 2018 — forked from umpirsky/ubuntu-raid.sh
Install Ubuntu on RAID 0 and UEFI/GPT system
View ubuntu-raid.sh
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D
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
SergeyKozlov / encoding-video.md
Created Nov 23, 2017 — forked from Vestride/encoding-video.md
Encoding video for the web
View encoding-video.md

Encoding Video

Installing

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
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
SergeyKozlov / rowdeleter.rb
Created Sep 26, 2017 — forked from noomerikal/rowdeleter.rb
RowDeleter for HBase Scan with TimeRange
View rowdeleter.rb
=begin
Usage: /bin/hbase shell rowdeleter.rb
=end
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.