Skip to content

Instantly share code, notes, and snippets.

@richashworth
richashworth / pandoc-md-to-docx
Last active July 9, 2018 03:08
pandoc command to convert GitHub markdown (.md) to MS Word (.docx)
pandoc --to=docx -o document.docx wiki.md
@fijiwebdesign
fijiwebdesign / inotifywait-cmd.sh
Last active May 28, 2016 04:36
Inotifywait watch files and run command
#!/bin/bash
# inotifywait-cmd.sh
#
# Example:
# inotifywait-cmd.sh test/ 'phpunit --verbose test/ModelReferencesTest.php'
#
# Requires: https://github.com/thekid/inotify-win on windows
#
# author: Gabe LG <[email protected]>
@lanceliao
lanceliao / luci-lighttpd-openwrt.md
Last active February 26, 2020 15:43
Configure LUCI on lighttpd

###Install

opkg install lighttpd lighttpd-mod-cgi

###Configgure

修改/etc/lighttpd/lighttpd.conf

  1. static-file.exclude-extensions = (".php", ".pl", ".fcgi")改成static-file.exclude-extensions = (".php", ".pl", ".fcgi", ".lua")
@nullivex
nullivex / ifb_wondershaper.sh
Created July 13, 2014 18:32
Wondershaper implementation that uses IFB for ingress rate limiting
#!/bin/sh
# Wonder Shaper
# please read the README before filling out these values
#
# Set the following values to somewhat less than your actual download
# and uplink speed. In kilobits. Also set the device that is to be shaped.
# All config needs to be done in /etc/config/wshaper
#. /lib/functions.sh

/etc/config/easycwmp

config local
	option interface wlan0
	option port 7547
	option ubus_socket /var/run/ubus.sock
	option date_format %FT%T%z
	option username bob
@dsaenztagarro
dsaenztagarro / usb_devices_virtualbox.md
Last active June 30, 2023 08:56
USB devices on VirtualBox
Host commands
VboxManage list usbhost
VBoxManage controlvm usbattach <uuid>|<address>
VBoxManage controlvm usbdetach <uuid>|<address>
Vagrantfile
#!/bin/sh
# 定义进出设备(IDEV 内网接口, ODEV外网接口)
IDEV="br-lan"
ODEV="pppoe-wan"
# 定义总的上下带宽
UP="7.52mbit"
DOWN="9.55mbit"
@pichuang
pichuang / network
Last active January 1, 2024 14:58
OpenWrt /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config interface 'lan1'
option ifname 'eth0.1'
option proto 'static'
@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;
@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"