Skip to content

Instantly share code, notes, and snippets.

View themactep's full-sized avatar

Paul Philippov themactep

View GitHub Profile
@themactep
themactep / ipcam-clock-set.pl
Created September 9, 2022 00:56 — forked from 667bdrm/ipcam-clock-set.pl
Simple clock synchronization for some chinese DVRs supporting CMS with json-like protocol. Includes some other API commands. Fork at https://gitlab.com/667bdrm/sofiactl
#!/usr/bin/perl
# latest release at https://gitlab.com/667bdrm/sofiactl
#
# Simple clock synchronization for some chinese HiSilicon based DVRs supporting CMS (Sofia software) with json-like protocol. Tested with:
#
# HJCCTV HJ-H4808BW (XiongMai, Hi3520, MBD6304T)
# http://www.aliexpress.com/item/Hybird-NVR-8chs-H-264DVR-8chs-onvif-2-3-Economical-DVR-8ch-Video-4-AUDIO-AND/1918734952.html
#
#
@themactep
themactep / get_ip.sh
Created September 4, 2022 03:17 — forked from LozanoMatheus/get_ip.sh
Get Linux IP without any tool
#!/usr/bin/env bash
## Get the primary and secundary IPs
awk '/\|--/ && !/\.0$|\.255$/ {print $2}' /proc/net/fib_trie
## Get only the primary IPs
awk '/32 host/ { print i } {i=$2}' /proc/net/fib_trie
@themactep
themactep / bug.js
Created March 8, 2010 22:39 — forked from maccman/bug.js
// Is this a JavaScript bug?
// Running the code below alert's "three".
var calls = ["one", "two", "three"]
for(var i in calls) {
var name = calls[i];
this[name] = function(){
alert(name);
}
}