Very easy example for cpu usage chart with d3.js
A Pen by CarterTsai on CodePen.
# http://wiki.openwrt.org/doc/devel/packages | |
include $(TOPDIR)/rules.mk | |
# PKG_NAME -The name of the package, as seen via menuconfig and ipkg | |
PKG_NAME:=bridge | |
# PKG_VERSION -The upstream version number that we're downloading | |
PKG_VERSION:=1.0.6 | |
# PKG_RELEASE -The version of this package Makefile | |
PKG_RELEASE:=1 |
#file /etc/init.d/6bridge | |
#!/bin/sh /etc/rc.common | |
START=46 | |
STOP=46 | |
start_service() { | |
local section="$1" | |
. /lib/functions/network.sh |
#!/bin/sh | |
# kill already process | |
PROC=`pgrep -f inotifywait` | |
if [ -n "${PROC}" ]; then | |
echo $PROC | xargs kill | |
fi | |
/usr/bin/inotifywait -e create,modify -mrq /home/my.file | while read line; do | |
path=`echo $line | /bin/awk '{print $1$3}'` |
#!/bin/bash | |
# Personal note : add rules to /etc/rc.local file so they will be loaded after booting up | |
# Change modemif to your network interface value | |
modemif=eth0 | |
iptables -t mangle -N ack | |
iptables -t mangle -A ack -m tos ! --tos Normal-Service -j RETURN | |
iptables -t mangle -A ack -p tcp -m length --length 0:128 -j TOS --set-tos Minimize-Delay | |
iptables -t mangle -A ack -p tcp -m length --length 128: -j TOS --set-tos Maximize-Throughput |
#!/bin/bash | |
# Usage: slackpost <token> <channel> <message> | |
# Enter the name of your slack host here - the thing that appears in your URL: | |
# https://slackhost.slack.com/ | |
slackhost=PUT_YOUR_HOST_HERE | |
token=$1 |
#!/bin/bash | |
# | |
if [ -z "$APIKEY" ]; then | |
echo "API Key for Redmine is required." | |
exit 1 | |
fi | |
mkdir -p doc/specs | |
cd doc/specs |
Very easy example for cpu usage chart with d3.js
A Pen by CarterTsai on CodePen.
/*! | |
* gulp | |
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev | |
*/ | |
// Load plugins | |
var gulp = require('gulp'), | |
sass = require('gulp-ruby-sass'), | |
autoprefixer = require('gulp-autoprefixer'), | |
cssnano = require('gulp-cssnano'), |
#Use the following command to retrieve the times of a Pings | |
# ping -c 100 www.google.co.uk | awk -F [=\ ] {'print $(NF-1)'} | grep -E "[0-9]" > pingTimes.dat | |
#Then use the following script to plot it with gnuplot | |
set terminal pdfcairo font "Gill Sans,9" linewidth 2 rounded fontscale 1.0 | |
set output "ping.pdf" | |
set ylabel "Time in milliseconds" | |
set xlabel "Number of Pings" |
--------------- FFMPEG command line | |
ffmpeg = child_process.spawn("ffmpeg", [ | |
"-i", rtsp , "-vcodec", "copy", "-f", "mp4", "-f", "segment", "-segment_time", recSeg, "-segment_wrap", 2, "-map", "0", "-segment_format", "mp4", "-reset_timestamps", "1", "-y", "plugins/security/videos/" + camName + "/rec-%01d.mp4" | |
], {detached: false}); | |
---------------- Node.JS streamer | |
// Stream mp4 video file based on URL request from client player. Accept request for partial streams | |
// Code attribution: https://github.com/meloncholy/vid-streamer/blob/master/index.js (MIT license) | |
var recStream = function (req, resp) { | |
var stream; |