Skip to content

Instantly share code, notes, and snippets.

View aguereca's full-sized avatar

Armando Guereca aguereca

View GitHub Profile
# Homebrew has done away with options in all of their core formulas
# discussion on this change here: https://github.com/Homebrew/homebrew-core/issues/31510
# Instead, Use the last version of the homebrew forumla that still supported them.
# the formula is here: https://raw.githubusercontent.com/Homebrew/homebrew-core/90e6931235a333899bd2572353ca065bd5535452/Formula/ffmpeg.rb
# install it like this:
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/90e6931235a333899bd2572353ca065bd5535452/Formula/ffmpeg.rb \
--with-aom \
--with-chromaprint \
@n-sviridenko
n-sviridenko / mount-nfs.sh
Created December 29, 2017 12:04
NFS for OSX on minikube
#!/usr/bin/env sh
HOST_PATH=$(pwd)
GUEST_PATH=/usr/app
HOST_EXPORT="${HOST_PATH} -network 192.168.99.0 -mask 255.255.255.0 -alldirs -maproot=root:wheel"
if ! grep -q "$HOST_EXPORT" /etc/exports; then
echo $HOST_EXPORT | sudo tee -a /etc/exports
sudo nfsd restart
fi
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@hiwonjoon
hiwonjoon / python-ffmpeg.py
Last active November 26, 2023 16:11
ffmpeg and ffprobe subprocess call in python; extract specific frame at some timepoint, extract duration of a video
import subprocess
import datetime
import numpy as np
THREAD_NUM=4
def get_video_info(fileloc) :
command = ['ffprobe',
'-v', 'fatal',
'-show_entries', 'stream=width,height,r_frame_rate,duration',
@jmealo
jmealo / openresty-nchan-redis-luarocks.sh
Last active January 4, 2020 22:51 — forked from wojons/openresty-luarocks.sh
OpenResty + LuaRocks + Nchan + Redis (with password, graph and bloom modules)
#!/bin/sh
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential git curl \
unzip
git clone https://github.com/RedisLabsModules/password.git /tmp/password
git clone https://github.com/RedisLabsModules/rebloom.git /tmp/rebloom
git clone https://github.com/RedisLabsModules/redis-graph.git /tmp/redis-graph
@mikz
mikz / luarocks.rb
Created August 21, 2016 12:26
LuaRocks Homebrew Formula
require 'formula'
class Luarocks < Formula
homepage 'https://rocks.moonscript.org/'
stable do
url 'https://github.com/keplerproject/luarocks/archive/v2.3.0.tar.gz'
sha256 '92c014889ec6a09c4bb492df6b7f7be784110d6abe031e16418342781ca5c5ce'
end
@Brainiarc7
Brainiarc7 / ffmpeg-howto-localfiles-manipulation.md
Created July 25, 2016 13:43
This is a standard how-to for FFmpeg's usage with local files and streams. Small hand-book detailing common encode scenarios in a standard workflow.

Standard FFmpeg How-to

Table of Contents

* Generic Syntax

* Main Options

* Encoding :
@wojons
wojons / openresty-luarocks.sh
Last active October 31, 2017 23:34 — forked from yagop/openresty-luarocks.sh
OpenResty + LuaRocks + Nchan
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential
wget https://github.com/openresty/stream-lua-nginx-module/archive/v0.0.1.tar.gz \
-O /tmp/stream-lua-nginx-module-0.0.1.tar.gz
mkdir /tmp/stream-lua-nginx-module-0.0.1
tar xzvf /tmp/stream-lua-nginx-module-0.0.1.tar.gz -C /tmp/stream-lua-nginx-module-0.0.1
@jeoliva
jeoliva / gist:a3c4ef62b7f52926d0f339b395c0cd0c
Last active November 29, 2024 12:22
Get Keyframe interval (GOP size) of a stream/video using ffprobe
ffprobe -of compact -select_streams v -show_packets [VIDEO_FILE OR STREAM_URL] | grep K$ | awk 'BEGIN{FS="|";last=-1}{split($5,a,"="); if(last != -1) {print "Keframe pos: " a[2] ", Interval: " a[2]-last " seconds"} else {print "Keyframe: " a[2]}; last=a[2]}'
#!/usr/bin/env elixir
defmodule Committer do
defstruct [:name, :email]
def list(repo) do
repo
|> from_repo
|> Stream.unfold(fn str ->
case String.split(str, "\n", parts: 2, trim: true) do