Skip to content

Instantly share code, notes, and snippets.

View jledet's full-sized avatar

Jeppe Ledet-Pedersen jledet

View GitHub Profile
# Maintainer: Martin Hundebøll <[email protected]>
pkgname=tio
pkgver=1.33
pkgrel=1
pkgdesc="The simple TTY terminal I/O application"
url="http://tio.github.io/"
makedepends=('meson')
arch=('x86_64' 'i686')
license=('GPLv2')
source=("https://github.com/tio/tio/releases/download/v$pkgver/$pkgname-$pkgver.tar.xz")
@jledet
jledet / http_204_return.py
Created October 20, 2014 11:09
HTTP 204 Return
#!/usr/bin/env python2
import BaseHTTPServer
HOST='10.0.0.202'
PORT=80
class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(s):
s.send_response(204)
@jledet
jledet / testvideo.sh
Last active August 29, 2015 14:07
Generate synchronized testvideo
#!/bin/bash
# Lenght in seconds
LENGTH=300
if [[ $# -lt 1 ]]; then
echo "usage: $0 <output-file>"
exit
fi
@jledet
jledet / gist:d6ceebbdbd5ca58977e8
Last active August 29, 2015 14:06
GST server/client
Client:
gst-launch-1.0 -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96, sprop-parameter-sets=(string)\"Z2QAH6zZQFAFuwEQAAADABAAAAMDCPGDGWA\=\,aOvssiw\=\"" ! rtpjitterbuffer latency=3000 ! rtph264depay ! avdec_h264 ! autovideosink
Server:
gst-launch-1.0 -v filesrc location=/home/jlp/Videos/big_buck_bunny_720p_h264_1mbit.mov ! qtdemux ! queue ! rtph264pay ! udpsink host=127.0.0.1 port=5000
Client with audio:
gst-launch-1.0 -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, payload=(int)96, sprop-parameter-sets=(string)\"Z2QAH6zZQFAFuwEQAAADABAAAAMDCPGDGWA\=\,aOvssiw\=\"" ! rtpjitterbuffer latency=3000 ! rtph264depay ! avdec_h264 ! autovideosink udpsrc port=5001 caps="application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)6, streamtype=(string)5, profile-level-id=(string)2, mode=(string)AAC-hbr
@jledet
jledet / gist:a575171a72f0f1db8797
Last active August 29, 2015 14:05
Silence python
#!/usr/bin/env python2
from __future__ import print_function
import sys
class shutup(object):
def __enter__(self):
self.stdout = sys.stdout
sys.stdout = self
@jledet
jledet / offsetbits.c
Created June 2, 2012 08:36
Extract offset bits from bit field
#include <stdint.h>
#include <stdio.h>
#include <inttypes.h>
uint32_t get_offset_bits(uint8_t *data, uint32_t offset, uint32_t count)
{
int shft;
uint32_t ret, byte;
byte = offset / 8;
@jledet
jledet / lzo_header.txt
Created November 2, 2011 15:19
LZO header
/*
* All fields are big endian byte order.
* Magic: 9 bytes (0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a)
* Version: 2 bytes
* Lib version: 2 bytes
* Version needed: 2 bytes
* Method: 1 byte
* Level: 1 byte
* Flags: 4 byte
@jledet
jledet / gist:1280935
Created October 12, 2011 11:10
ftp-client wscript
#!/usr/bin/env python
# encoding: utf-8
APPNAME = 'ftp-client'
VERSION = '1.0'
top = '.'
out = 'build'
modules = ['../libcsp/', '../libio']
@jledet
jledet / gist:1280899
Created October 12, 2011 10:43
libcsp wscript
#!/usr/bin/env python
# encoding: utf-8
import os
APPNAME = 'csp'
VERSION = '1.0'
top = '.'
out = 'build'