Skip to content

Instantly share code, notes, and snippets.

@BeanSecurity
BeanSecurity / getxkblayout.c
Last active October 5, 2019 13:56 — forked from fikovnik/getxkblayout.c
Get keyboard layout using X11
// compile with `gcc -I/usr/include getxkblayout.c -lX11 -lxkbfile -o /usr/local/bin/getxkblayout`
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <X11/XKBlib.h>
#include <X11/extensions/XKBrules.h>
int main(int argc, char **argv) {
Display *dpy = XOpenDisplay(NULL);
@BeanSecurity
BeanSecurity / rtsp-rtp-sample.py
Created February 19, 2019 08:13 — forked from raydrezack/rtsp-rtp-sample.py
Sample Python script to employ RTSP/RTP to play a stream from an IP-cam (from stackoverflow)
"""
http://stackoverflow.com/questions/28022432/receiving-rtp-packets-after-rtsp-setup
A demo python code that ..
1) Connects to an IP cam with RTSP
2) Draws RTP/NAL/H264 packets from the camera
3) Writes them to a file that can be read with any stock video player (say, mplayer, vlc & other ffmpeg based video-players)
Done for educative/demonstrative purposes, not for efficiency..!