Skip to content

Instantly share code, notes, and snippets.

@rxin
rxin / ramdisk.sh
Last active December 13, 2023 02:40
ramdisk create/delete on Mac OS X.
#!/bin/bash
# From http://tech.serbinn.net/2010/shell-script-to-create-ramdisk-on-mac-os-x/
#
ARGS=2
E_BADARGS=99
if [ $# -ne $ARGS ] # correct number of arguments to the script;
then
#!/bin/bash
FONTFILE=/usr/share/fonts/truetype/freefont/FreeSerif.ttf
TEXT="bladeRF_ATSC_Demo_TBM2"
VIDEOFILE="tbm_tdf_2.mp4"
OUTFILE="tbm_tdf_2.ts"
FILTERS="-vf drawtext=fontfile=${FONTFILE}:text=${TEXT}:x=100:y=50:fontsize=72:[email protected]:box=1:[email protected] -t 327"
VIDEO_CODEC="-vcodec mpeg2video -s hd720 -r 25"
VIDEO_QUALITY="-b:v:0 8M"
#!/bin/bash
FONTFILE=/usr/share/fonts/truetype/freefont/FreeSerif.ttf
TEXT="BladeRF_ATSC_Demo_%T_Ch1"
VIDEOFILE="-i /home/rtucker/Videos/Bike?Cam/2012-09-09-002-afternoon.AVI"
AUDIOFILE="-i /home/rtucker/Music/Track?N?Field/Marathon/04?-?Track?N?Field?-?Iso?Maha.mp3"
OUTFILE="udp://127.0.0.1:1234?pkt_size=188&buffer_size=65535"
FILTERS="-vf drawtext=fontfile=${FONTFILE}:text=${TEXT}:x=100:y=50:fontsize=72:[email protected]:box=1:[email protected]"
VIDEO_CODEC="-vcodec mpeg2video -s hd720 -r 30"
@DrPaulBrewer
DrPaulBrewer / rtlsdr-to-gqrx.c
Last active March 25, 2024 05:12
rtlsdr-to-gqrx SDR file format converter
#include <complex.h>
#include <stdio.h>
#include <stdlib.h>
// rtlsdr-to-gqrx Copyright 2014 Paul Brewer KI6CQ
// License: GNU GPL 3.0
//
// IQ file converter for Software Defined Radio Programs rtl_sdr, gqrx
// from rtl_sdr recording format -- interleaved unsigned char
// to gqrx/gnuradio .cfile playback format -- complex64
@rxseger
rxseger / top_block.py
Last active May 26, 2021 03:10
Software FM radio receiver with GNU Radio and Raspberry Pi GPIO volume/channel buttons
#!/usr/bin/env python
import threading
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
# GPIO pins
@rxseger
rxseger / pwr-nec-decoded.txt
Last active July 3, 2016 23:55
rtl_ir hand decoding
decoding NEC pulses for power down button (0x4d) of RTL remote
http://www.sbprojects.com/knowledge/ir/nec.php
pulse, pause = 0
pulse, pause pause = 1
received using rtl_ir https://github.com/librtlsdr/librtlsdr/pull/9
$ ./rtl_ir
press the power button on the RTL remote, shows pulses:
@rxseger
rxseger / crypt.c
Created August 14, 2016 06:02
crypt(3) command-line wrapper, compile with: cc crypt.c -o crypt -lcrypt
#include <stdio.h>
#include <crypt.h>
int main(int argc, char **argv) {
if (argc < 3) {
fprintf(stderr, "usage: %s key salt\n", argv[0]);
return -1;
}
char *result = crypt(argv[1], argv[2]);
if (!result)
@rxseger
rxseger / netbus.py
Last active September 7, 2016 06:07
open/close CD/DVD tray from Raspberry Pi GPIO via H-Bridge
#!/usr/bin/python
# open/close CD/DVD tray from Raspberry Pi GPIO via H-Bridge
import RPi.GPIO as GPIO
import time
import sys
import signal
GPIO.setmode(GPIO.BOARD)