Skip to content

Instantly share code, notes, and snippets.

@henrikno
henrikno / server.py
Last active March 4, 2021 20:46
Python Multithreaded TCP server example
#!/usr/bin/python
import socket # Import socket module
from threading import Thread
def on_new_client(clientsocket, addr):
try:
while True:
msg = clientsocket.recv(1024)
if not msg:
@henrikno
henrikno / record-desktop.sh
Created May 1, 2012 18:09
ffmpeg record scripts
#!/bin/bash -x
INRES="1920x1200"
OUTRES="1280x720"
FPS="30"
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0 -f alsa -ac 2 \
-i default -vcodec libx264 -s "$OUTRES" \
-acodec libmp3lame -ab 128k -ar 44100 \
-threads 0 -f flv $1