Skip to content

Instantly share code, notes, and snippets.

View RyAndrew's full-sized avatar
🎯
Focusing

Andrew Ry RyAndrew

🎯
Focusing
View GitHub Profile
@RyAndrew
RyAndrew / gist:00636401f2171b0a229d3f9561680195
Created September 29, 2021 14:50
node request json body parser
//souce: https://blog.logrocket.com/forget-express-js-opt-for-these-alternatives-instead/
//usage
parsed = await req.requestBodyJson();
//utility fn
function requestBodyJson(req) {
return new Promise((resolve, reject) => {
let body = '';
@RyAndrew
RyAndrew / dockerfile-windows-apache-sqlsrv
Created February 10, 2021 09:31
dockerfile for apache + php + sqlsrv for SQL 2008 on windows server 2019
# escape=`
FROM mcr.microsoft.com/windows/servercore:1809-amd64
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
#https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.46-win64-VS16.zip
#https://www.apachehaus.com/downloads/httpd-2.4.46-lre323-x86-vs16.zip
RUN C:\Windows\System32\curl --location --output vc_redist.x64.exe -A "Chrome" "https://aka.ms/vs/16/release/vc_redist.x64.exe" ; `
Start-Process '.\vc_redist.x64.exe' '/install /passive /norestart' -Wait; `
@RyAndrew
RyAndrew / dockerfile-windows-apache
Last active February 10, 2021 09:30
dockerfile for basic apache on windows server 2019
# escape=`
FROM mcr.microsoft.com/windows/servercore:1809-amd64 as download
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV APACHE_VERSION 2.4.46
RUN C:\Windows\System32\curl --location --output apache.zip -A "Chrome" "https://www.apachelounge.com/download/VS16/binaries/httpd-2.4.46-win64-VS16.zip"
RUN Expand-Archive apache.zip -DestinationPath C:\ ; `

Letsrobot.tv / Run My Robot Overlay Guide

  • Both of these methods expect a PNG image with transparency to be the same size as your video feed ( 640x480 by default ). It is possible to blend images at different resolutions with alternate commands but beyond the scope of this document.

Static video overlay

  • Requires no modification to FFMPEG
  • Add overlayCommand and change the videoCommandLine in send_video.py:

staticOverlayCommand = '-f image2 -i /home/pi/runmyrobot/images/hud.png -filter_complex "[0:v]format=argb,geq=r=\'r(X,Y)\':g=\'g(X,Y)\':b=\'b(X,Y)\':a=\'0.7*alpha(X,Y)\'[overlay]; [1:v][overlay]overlay"'

@RyAndrew
RyAndrew / install.sh
Created June 30, 2019 20:32
letsrobot / runmyrobot / custom ffmpeg dynoverlay build script
#!/bin/bash
# Clear screen
printf "\ec"
echo -en "\ec"
echo
echo -e "\e[31m**************************************************"
echo -e "\e[31m* \e[39mYou are now about to install everything needed \e[31m*"
@RyAndrew
RyAndrew / hardware_custom.py
Created June 14, 2019 02:57
hardware_custom.py for custom sounds on letsrobot
import mod_utils
import hardware.motor_hat
# Example for adding custom code to the controller
from subprocess import Popen
module = None
def setup(robot_config):
global module
@RyAndrew
RyAndrew / setup.sh
Created May 5, 2019 20:49 — forked from jkatz/setup.sh
Install PostgreSQL 10 & pgAdmin 4 with Docker
#!/bin/bash
mkdir postgres
cd postgres
docker volume create --driver local --name=pgvolume
docker volume create --driver local --name=pga4volume
docker network create --driver bridge pgnetwork
@RyAndrew
RyAndrew / CompareHashes.php
Created January 15, 2019 21:03
Authorize.Net PHP API AIM SHA512 Signature HMAC Calculating Example
<?php
echo "<PRE style=\"font-size:24px\">";
$apiLoginId = '65M3HCNw3bp1';
$transactionId = '2018911514592302024';
$transactionAmount = '46.33';
$messageString = "^{$apiLoginId}^{$transactionId}^{$transactionAmount}^";
//Replace with your key!
@RyAndrew
RyAndrew / ffmpeg-jsmpeg-test.md
Created January 4, 2019 16:17 — forked from keijiro/ffmpeg-jsmpeg-test.md
FFmpegOut streaming test setup steps
@RyAndrew
RyAndrew / mebo video command.txt
Created December 31, 2018 17:37
lets robot mebo video + audio ffmpeg code
Open these urls to get the host and ports to use:
GET https://letsrobot.tv/get_websocket_relay_host/{Camera ID Numbers Here}
{"host":"letsrobot.tv"}
GET https://letsrobot.tv/get_video_port/{Camera ID Numbers Here}
{"mpeg_stream_port":661177}
GET https://letsrobot.tv/get_audio_port/{Camera ID Numbers Here}
{"audio_stream_port":881199}