This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# linux send h264 rtp stream: | |
gst-launch-1.0 -v ximagesrc ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000 | |
# Macos send h264 rtp stream: | |
gst-launch-1.0 -v avfvideosrc capture-screen=true ! video/x-raw,framerate=20/1 ! videoscale ! videoconvert ! x264enc tune=zerolatency bitrate=500 speed-preset=superfast ! rtph264pay ! udpsink host=127.0.0.1 port=5000 | |
# receive h264 rtp stream: | |
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" ! rtph264depay ! decodebin ! videoconvert ! autovideosink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* File....... IRanalyzer.pde | |
* Purpose.... Records up to 128 signal changes | |
* Author..... Walter Anderson | |
* E-mail..... [email protected] | |
* Started.... 18 May 2007 | |
* Updated.... 18 May 2007 | |
* | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <errno.h> | |
#include <unistd.h> //close() | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <sys/types.h>// select(), fd_set, FD_* macros |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Example on how to work with a non-blocking connect. Uses fixed input and | |
* should show all 3 situations we care about - a successful connect, a refused | |
* connect, and a timeout. | |
* | |
* (c) [email protected], [email protected] | |
*/ | |
#include <sys/types.h> | |
#include <sys/socket.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#thanks to https://winaero.com/blog/how-to-set-the-bios-date-in-virtualbox/ | |
if [[ -z ${1} || -z ${2} ]] | |
then | |
echo ${0} " Usage:" | |
echo " ${0} <vm-name> <time-offset>" | |
echo " Example: ${0} projectVM -36000000" | |
exit | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [[ -z $1 ]] | |
then | |
echo $0 " Usage:" | |
echo " ${0} <date>" | |
echo " Example: ${0} 1990-09-21" | |
exit | |
fi | |
past_secs=$(date --date ${1} +%s) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
File.open("your_file.md", 'r') do |f| | |
f.each_line do |line| | |
forbidden_words = ['Table of contents', 'define', 'pragma'] | |
next if !line.start_with?("#") || forbidden_words.any? { |w| line =~ /#{w}/ } | |
title = line.gsub("#", "").strip | |
href = title.gsub(" ", "-").downcase | |
puts " " * (line.count("#")-1) + "* [#{title}](\##{href})" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Snippet from https://www.binarytides.com/multiple-socket-connections-fdset-select-linux/ | |
*/ | |
#include <stdio.h> | |
#include <string.h> //strlen | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <unistd.h> //close | |
#include <arpa/inet.h> //close | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ares.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <netdb.h> | |
#include <stdarg.h> | |
#include <string.h> | |
#include <ctype.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script parses file info generated by ffmpeg and, if the first stream is an audio stream, moves to file to from | |
# $1 to $2 | |
# https://www.computerhope.com/unix/bash/read.htm | |
find $1 -maxdepth 1 -type f -print0 | | |
while IFS= read -r -d '' line | |
do | |
ffmpeg -i "${line}" 2>&1 | grep --color=always "Stream #0:0[()a-z]*: Audio" > /dev/null |