Skip to content

Instantly share code, notes, and snippets.

@gabonator
gabonator / adam6050.js
Last active August 23, 2017 10:46
Advantech adam ASCII modbus UDP emulator for synology surveillance station (nodejs)
var dgram = require('dgram');
var server = dgram.createSocket('udp4');
server.on('listening', function () {
var address = server.address();
console.log('Advantech ADAM emulator running on UDP ' + address.address + ":" + address.port);
});
server.on('message', function (message, remote) {
var request = message.toString();
@667bdrm
667bdrm / dvr-alarm-server.pl
Last active May 16, 2021 17:43
Chinese DVR Alarm Server
#!/usr/bin/perl
#
# Simple log/alarm server receiving and printing to console remote dvr/camera events.
# future releases at https://gitlab.com/667bdrm/sofiactl
# Tested with:
#
# HJCCTV HJ-H4808BW
# http://www.aliexpress.com/item/Hybird-NVR-8chs-H-264DVR-8chs-onvif-2-3-Economical-DVR-8ch-Video-4-AUDIO-AND/1918734952.html
#
@trinne
trinne / Colorful Bash Prompt
Last active December 10, 2015 15:28
Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt"Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.pngA big thanks to \amethyst on Freenode
# Colorful Bash Prompt, inspired by "Extravagant Zsh Prompt"
# Screenshot: http://img.gf3.ca/d54942f474256ec26a49893681c49b5a.png
# A big thanks to \amethyst on Freenode
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then export TERM=xterm-256color
fi
if tput setaf 1 &> /dev/null; then
tput sgr0