Skip to content

Instantly share code, notes, and snippets.

@aktau
aktau / ffmpeg-interlace-test.sh
Last active October 28, 2023 14:26
ffmpeg detect interlacing
#!/bin/bash
# for a blogpost on this, check: http://www.aktau.be/2013/09/22/detecting-interlaced-video-with-ffmpeg/
# detect interlacing with the ffmpeg "idet" filter, the longer
# you let this run, the better, though it's never 100% accurate
# flags:
# -an = discard audio, we don't need it
# -f rawvideo = output raw video
@staltz
staltz / introrx.md
Last active April 29, 2024 09:25
The introduction to Reactive Programming you've been missing
@yohhoy
yohhoy / ffmpeg_tb.md
Last active April 10, 2023 07:36
time-base in FFmpeg

https://www.ffmpeg.org/doxygen/trunk/dump_8c_source.html#l00454

  • fps = st->avg_frame_rate
  • tbr = st->r_frame_rate
  • tbn = st->time_base
  • tbc = st->codec->time_base

AVStream::avg_frame_rate

Average framerate.

  • demuxing: May be set by libavformat when creating the stream or in avformat_find_stream_info().
  • muxing: May be set by the caller before avformat_write_header().
@alastairmccormack
alastairmccormack / SCTE35 Decoder
Last active December 27, 2019 23:39
SCTE-35 Parser/Decoder in Python
#!/usr/bin/python
'''
SCTE-35 Decoder
The MIT License (MIT)
Copyright (c) 2014 Al McCormack
@seyhunak
seyhunak / instructions.md
Last active August 29, 2015 14:09
Rails 4 - Sunspot - Solr - Tomcat

Instructions

Install OpenJDK

sudo apt-get -y install openjdk-7-jdk
sudo mkdir /usr/java
sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64 /usr/java/default

Install Tomcat

@lavalamp
lavalamp / The Three Go Landmines.markdown
Last active February 16, 2024 12:16
Golang landmines

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@montanaflynn
montanaflynn / BENCHMARK.md
Last active January 29, 2021 13:27
Kong Benchmark Setup

To reproduce Kong's benchmark please follow these instructions.

Create AWS Instances

Spin up three m3.medium EC2 ubuntu 14.04 instances with public DNS enabled and configure them for high network traffic by increasing these limits:

Added fs.file-max=80000 to /etc/sysctl.conf

Added the following lines to /etc/security/limits.conf

@dtoma
dtoma / epoll_server.py
Last active January 30, 2024 05:12
epoll tcp server in python
#!/usr/bin/env python
"""Simple server using epoll."""
from __future__ import print_function
from contextlib import contextmanager
import socket
import select
@oleksiiBobko
oleksiiBobko / tcp_server.c
Last active November 10, 2023 08:48
Simple socket server in C using threads (pthread library) Compiles on linux
/*
C socket server example, handles multiple clients using threads
Compile
gcc server.c -lpthread -o server
*/
#include<stdio.h>
#include<string.h> //strlen
#include<stdlib.h> //strlen
#include<sys/socket.h>

On Twitter the other day, I was lamenting the state of OCSP stapling support on Linux servers, and got asked by several people to write-up what I think the requirements are for OCSP stapling support.

  1. Support for keeping a long-lived (disk) cache of OCSP responses.

    This should be fairly simple. Any restarting of the service shouldn't blow away previous responses that were obtained. This doesn't need to be disk, just stable - and disk is an easy stable storage for most server