Skip to content

Instantly share code, notes, and snippets.

@hernan43
hernan43 / Makefile
Created May 26, 2011 13:54
My first Go application. A URL "shortener". Doesn't really shorten as good as a real one, but it served as a good test.
include $(GOROOT)/src/Make.inc
TARG=gourl
O_FILES = gourl.6
all:
make clean
make $(TARG)
@hernan43
hernan43 / http.go
Created May 27, 2011 10:27
Just pasted this in gist so I could print it up all colorized.
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// On App Engine, the framework sets up main; we should be a different package.
package moustachio
import (
"bytes"
"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() {
@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 / 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>

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 / 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
@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 / 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 / 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