Skip to content

Instantly share code, notes, and snippets.

View peschuster's full-sized avatar
💭
I may be slow to respond.

Peter Schuster peschuster

💭
I may be slow to respond.
View GitHub Profile
@peschuster
peschuster / gstreamer_main.py
Last active November 9, 2025 19:40
Gstreamer player with HC-SR04
#!/usr/bin/env python3
# Install the following required packages before running this script:
# sudo apt update
# sudo apt install -y python3-gi gir1.2-gstreamer-1.0 gstreamer1.0-tools gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-gl gstreamer1.0-alsa fbset python3-rpi.gpio
#############################################################################
# CONFIGURATION
#############################################################################
@peschuster
peschuster / dmesg
Created October 8, 2019 19:37
Rock PI S Kernel Output (errors)
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.143-23-rockchip-g394d86b2b38b (root@f8d601a511aa) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Mon Aug 5 12:15:39 UTC 2019
[ 0.000000] Boot CPU: AArch64 Processor [410fd042]
[ 0.000000] Reserved memory: failed to reserve memory for node 'drm-logo@00000000': base 0x0000000000000000, size 0 MiB
[ 0.000000] On node 0 totalpages: 130560
[ 0.000000] DMA zone: 2040 pages used for memmap
[ 0.000000] DMA zone: 0 pages reserved
@peschuster
peschuster / BMD Smart Control Load Lable Set
Last active June 10, 2017 14:40
Blackmagic Smart Control Protocol
Client -> Server:
-----------------
BUTTON SDI_A:
-1 27
0 0
1 1
2 2
3 3
4 4
5 5
@peschuster
peschuster / vlc_stream.bat
Created April 19, 2016 13:04
Stream BMD Decklink/ATEM USB Video using VLC on Windows
@ECHO OFF
SET DIR=C:\Program Files (x86)\VideoLAN\VLC
SET DSHOW_SETTINGS=dshow:// :dshow-vdev="Decklink Video Capture" :dshow-adev="Decklink Audio Capture" :dshow-chroma="UYVY" :dshow-fps=50 --dshow-aspect-ratio="16:9"
SET VRATE=600
SET ARATE=128
SET VRATE10=6000
SET ARATE10=128
@peschuster
peschuster / gist:840e34347e040a85b930
Created April 2, 2015 12:28
TYPO3 6.2 fileResource migration to FAL
private function getFileContent($value) {
if (strpos($value, 'file:') === 0 && strlen($value) > 5) {
$uid = intval(substr($value, 5));
return \TYPO3\CMS\Core\Resource\ResourceFactory::getInstance()->getFileObject($uid)->getContents();
}
return $this->cObj->fileResource($value);
}
@peschuster
peschuster / iptables-from-bind.php
Last active August 29, 2015 14:01
Block ips captured in bind9 security log.
#! /usr/bin/php -q
<?php
$threshold = 50;
$count = array();
$files = glob('/var/log/named/security.*');
foreach ($files as $file) {
@peschuster
peschuster / CiscoDecoder.cs
Created January 12, 2013 23:16
Decoder for encrypted Cisco VPN passwords (in C#).
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
namespace CiscoPw
{
public class CiscoDecoder
{
public string DecodePassword(string encodedPassword)
@peschuster
peschuster / CiscoVpnClientWrapper.cs
Created July 8, 2012 11:23
Wrapper for Cisco VPN client command line
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
namespace CiscoVpnConnect
{
internal class CiscoVpnClientWrapper
{
private readonly string path;