Skip to content

Instantly share code, notes, and snippets.

Learning Hadoop


Learning Hadoop
  • Beijing, China
View GitHub Profile
cdarlint /
Created Apr 27, 2017 — forked from John07/
A small script to make recording http live streams (HLS, those streams that work on iOS devices) nicer on a Mac. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
# required: ffmpeg (e.g. from homebrew), terminal-notifier from
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
# Date format for the recording file name
DATE=`date "+%d-%m-%y_%H-%M"`
# start ffmpeg recording
cdarlint / decrypt.rb
Created Apr 27, 2017 — forked from refractalize/decrypt.rb
Decrypt HTTP Live Streaming TS files
View decrypt.rb
def read_m3u8(m3u8), 'r') do |file|
keyfile = nil
iv = 0
file.each_line do |line|
if line =~ /^#EXT-X-KEY:METHOD=AES-128,URI="(.*?)"(,IV=0x(.*))?/
keyfile = $1
if $2
iv = $3
cdarlint / 0_reuse_code.js
Created Feb 21, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
import sys, os
import shutil
from Crypto.Cipher import AES
def parse_m3u8_file(m3u8_file):
with open(m3u8_file, 'rb') as fp:
current_line = fp.readline().rstrip('\n')
while (current_line):
if current_line.startswith('#EXT-X-KEY'):