This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# | |
# |