Skip to content

Instantly share code, notes, and snippets.

@DirkHeinke
DirkHeinke / gist:dfc14c8f0552212f1693
Last active August 21, 2021 14:05
gstreamer to twitch
# with sound and file
gst-launch-1.0 uridecodebin uri=file:///home/dirk/Videos/Clouds_67_Timelapse.mp4 ! video/x-raw,width=1280,height=720 ! queue ! x264enc threads=0 bitrate=400 tune=zerolatency key-int-max=30 ! queue ! flvmux name=flvmux ! queue ! rtmpsink location=rtmp://live-fra.twitch.tv/app/$APIKEY audiotestsrc ! faac ! flvmux.
@apparentlymart
apparentlymart / iptables-round-robin.sh
Last active August 30, 2023 21:45
round robin to three ports on the same host with iptables
# The following example shows a way to use iptables for basic round-robin load balancing, by redirecting
# packets two one of three ports based on a statistic counter.
#
# TCP packets for new sessions arriving on port 9000 will rotate between ports 9001, 9002 and 9003, where
# three identical copies of some application are expected to be listening.
#
# Packets that aren't TCP or that related to an already-established connection are left untouched, letting
# the standard iptables connection tracking machinery send it to the appropriate port.
#
# For this to work well, connections need to be relatively short. Ideally there would be an extra layer
-- Originally an Idris translation of copumpkin's Agda code:
-- https://gist.github.com/copumpkin/8758586
-- Extended using Matthew Brecknell's proof which only needs two properties:
-- https://gist.github.com/mbrcknl/bfaa72c2ec6ff32a2826
-- Proves that List reverse is completely specified by:
-- 1. f [x] = [x]
-- 2. f (xs ++ ys) = f ys ++ f xs
anonymous
anonymous / clfflame.nt.d
Created December 6, 2014 08:39
clfflame.nt
module clfflame;
import c.CL.cl;
import sys, std.(file, string, util, random, math, time, thread, channel, hashmap, png, macros.(switchover, where));
pragma(lib, "OpenCL");
alias NUMFUNS = 10; // functions implemented
alias numfuns = 3; // function set size, must be constant because compiled into shader
alias SPEED = 1.0;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MathieuDuponchelle
MathieuDuponchelle / mixit.py
Last active October 17, 2016 22:16
Gstreamer-editing-services used to make a fancy mixing script.
from gi.repository import GstPbutils
from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import GES
from gi.repository import GObject
import sys
import signal
def handle_sigint(sig, frame):
@dyoo
dyoo / unicode-name.rkt
Last active December 17, 2015 09:19
A function for getting the name of unicode code points
#lang racket/base
(provide unicode-name)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; We want to compute the table at compile-time, so that the result can be saved
;; by using raco make.
(require (for-syntax net/url
racket/base
@arvearve
arvearve / gist:4158578
Created November 28, 2012 02:01
Mathematics: What do grad students in math do all day?

Mathematics: What do grad students in math do all day?

by Yasha Berchenko-Kogan

A lot of math grad school is reading books and papers and trying to understand what's going on. The difficulty is that reading math is not like reading a mystery thriller, and it's not even like reading a history book or a New York Times article.

The main issue is that, by the time you get to the frontiers of math, the words to describe the concepts don't really exist yet. Communicating these ideas is a bit like trying to explain a vacuum cleaner to someone who has never seen one, except you're only allowed to use words that are four letters long or shorter.

What can you say?

@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no