Skip to content

Instantly share code, notes, and snippets.

@gabonator
gabonator / camera.md
Created June 4, 2016 13:48
Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Cheap chinese IP camera with H264 encoding based on Hisilicon 8M (Hi3518E) chip

Video stream url for VLC/DVR:

  • rtsp://192.168.1.93:554/user=admin&password=&channel=&stream=.sdp?real_stream--rtp-caching=100

Telnet access

  • telnet 192.168.1.10 23
  • Localhost login: root
  • Password: xmhdipc
@jpillora
jpillora / sshd.go
Last active June 16, 2025 14:55
Go SSH server complete example - Read more here https://blog.gopheracademy.com/go-and-ssh/
// A small SSH daemon providing bash sessions
//
// Server:
// cd my/new/dir/
// #generate server keypair
// ssh-keygen -t rsa
// go get -v .
// go run sshd.go
//
// Client:
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active May 20, 2025 13:11
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@cbmd
cbmd / default.conf
Created December 9, 2012 21:13
nginx config - dynamic virtual hosts
server {
index index.php;
set $basepath "/var/www";
set $domain $host;
# check one name domain for simple application
if ($domain ~ "^(.[^.]*)\.dev$") {
set $domain $1;
set $rootpath "${domain}";
@joaopizani
joaopizani / .rtorrentrc
Created August 27, 2012 22:29
A reasonable rtorrent setup that Just Works®
# Default session directory. Make sure you don't run multiple instances with the same dir.
session = ~/torrent/session
# Maximum and minimum number of peers to connect to per torrent.
min_peers = 50
max_peers = 400
# Same as above but for seeding completed torrents (-1 = same as downloading)
min_peers_seed = 20
@jsimmons
jsimmons / spsc.c
Created July 9, 2012 01:08
Single producer single consumer lock-free on FIFO
#include <pthread.h>
#include <stdio.h>
#define PRODUCER_COUNT 1
#define CONSUMER_COUNT 1
#define THREAD_COUNT (PRODUCER_COUNT + CONSUMER_COUNT)
#define QUEUE_SIZE 64
// Let's go the easy way and keep a gap between head and tail when full.