Skip to content

Instantly share code, notes, and snippets.

@hernan43
hernan43 / batch_mkv_convert.sh
Created July 17, 2019 17:30
I record all of my Retroarch gameplay footage into a captures directory. It starts as MKV but I like to upscale(nearest neighbor) to 5x and re-encode using FFMPEG.
#!/bin/sh
FFMPEG=/usr/bin/ffmpeg
SCALE=5
MKV_FILES=`ls /mnt/captures/**/*.mkv`
for FILE in $MKV_FILES; do
DIRNAME=`dirname $FILE`
OUTPUT_FILENAME=$DIRNAME/`basename -s .mkv $FILE`.mp4

Optimizing the setup

Works with any Raspberry based system like Pi0/1/2/3 whatever revision, and also or CM3 8-)

Ok, lets save some RAM, some CPU, some Watts :D **

707919EE-FBCD-40C3-9A3C-7451C1C5974B.jpeg

1) personnaly, i don't need Samba so -----> OUT Launch Retropie config sudo ~/RetroPie-Setup/retropie_setup.sh

@hernan43
hernan43 / burn-cdi.sh
Last active April 10, 2022 21:04
CDI burning script first seen here https://ubuntuforums.org/showthread.php?t=1288517
#!/bin/sh
CDIIMG="$1"
cdirip "${CDIIMG}" -cdrecord
COUNTER="0"
MORE=true
while $MORE
@hernan43
hernan43 / soil_moisture_buzzer.ino
Created May 19, 2018 19:57
Basic soil moisture sensor(arduino)
int sensor_pin = A0;
int buzzer_pin = 2;
int output_value ;
void setup() {
pinMode(buzzer_pin, OUTPUT);
tone(buzzer_pin, 3500, 200);
Serial.begin(9600);
Serial.println("Reading From the Sensor ...");
@hernan43
hernan43 / annoy-o-bug.ino
Last active April 28, 2018 21:42
I took various bits and pieces from the included projects and combined them to create an Annoy-O-Bug that conserves power by using the ATTiny85's built in watchdog timer.
/*
ATTiny85 Annoy-O-Bug
This is equal parts:
https://create.arduino.cc/projecthub/arjun/programming-attiny85-with-arduino-uno-afb829
https://www.hackster.io/AlexWulff/the-annoy-o-bug-a-chirping-light-up-throwie-37e58a
https://github.com/sparkfun/H2OhNo/blob/master/firmware/WatchDogTest/WatchDogTest.ino
https://github.com/SpenceKonde/ATTinyCore
@hernan43
hernan43 / screenshot.png
Created April 5, 2018 16:31 — forked from ssokolow/screenshot.png
Simple script to streamline the process of updating a Retrode's firmware on Linux
screenshot.png

Live stream Xiaomi Ants Smart Camera via FFMPEG

This assumes you have a Xiaomi Ants Smart Camera that still has the open RTSP enabled. I think newer firmware might remove this capability. If you Google enough you can find instructions on how to downgrade.

FFMPEG

FFMPEG is where most of the magic happens. I use OSX and as such am a fan of using Homebrew to install free software. Here is my ffmpeg install command:

brew install ffmpeg --with-faac --with-fdk-aac --with-ffplay --with-fontconfig --with-freetype --with-frei0r --with-libass --with-libbluray --with-libcaca --with-libquvi --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-schroedinger --with-speex --with-theora --with-tools --with-webp --with-x265

@hernan43
hernan43 / sysctl.plist
Created May 7, 2013 14:45
This is to set the kernel settings so that you can use Postgres query logging
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>sysctl</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/sysctl</string>
<string>-w</string>
@hernan43
hernan43 / go_scp.go
Created April 1, 2013 21:59 — forked from jedy/go_scp.go
// https://blogs.oracle.com/janp/entry/how_the_scp_protocol_works
package main
import (
"code.google.com/p/go.crypto/ssh"
"crypto"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
@hernan43
hernan43 / gh.go
Created March 4, 2013 16:24
Just playing around with Go
package main
import (
"fmt"
"encoding/json"
"io/ioutil"
"net/http"
)
func main() {