Skip to content

Instantly share code, notes, and snippets.

# 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
@yanunon
yanunon / 6bridge
Created October 7, 2012 04:42
Openwrt config file for TP-Link WR703N
#file /etc/init.d/6bridge
#!/bin/sh /etc/rc.common
START=46
STOP=46
start_service() {
local section="$1"
. /lib/functions/network.sh
@ysugimoto
ysugimoto / filewatch.sh
Created October 9, 2012 10:38
inotifywait file watching handler
#!/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}'`
@deepesh-agarwal
deepesh-agarwal / net_priority.sh
Last active February 10, 2022 15:57
Linux Traffic Prioritization Script
#!/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
@dopiaza
dopiaza / slackpost
Created September 5, 2013 12:33
Post a message to a Slack channel
#!/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
@t-yuki
t-yuki / 1_2_export_redmine_wiki.bash
Last active April 2, 2019 05:25
1. a script to grab redmine wiki pages in markdown format and convert to standard markdown link format. 2. Makefile to convert markdown to sphinx reST.
#!/bin/bash
#
if [ -z "$APIKEY" ]; then
echo "API Key for Redmine is required."
exit 1
fi
mkdir -p doc/specs
cd doc/specs
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* 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'),
@Noktec
Noktec / gnuplot.gnu
Created February 8, 2014 12:28
Plot Pings with Gnuplot
#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"
@deandob
deandob / gist:8943268
Created February 11, 2014 20:19
Streaming MP4 to HTML5 clients
--------------- 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;