Skip to content

Instantly share code, notes, and snippets.

@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'
#!/bin/sh
# 定义进出设备(IDEV 内网接口, ODEV外网接口)
IDEV="br-lan"
ODEV="pppoe-wan"
# 定义总的上下带宽
UP="7.52mbit"
DOWN="9.55mbit"
@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

/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
@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
@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")
@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]>
@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
@awakekat
awakekat / Gulp Jade Example
Created December 18, 2014 03:42
Example of Gulp Jade
//From http://stackoverflow.com/questions/25384796/can-i-set-gulp-livereload-to-run-after-all-files-are-compiled
var gulp = require('gulp');
var jade = require('gulp-jade');
var gutil = require('gulp-util');
var stylus = require('gulp-stylus');
var jeet = require('jeet');
var nib = require('nib');
var uglify = require('gulp-uglify');
var livereload = require('gulp-livereload');
#!/bin/bash
# usage ./notify.sh [path to folder] [command line to execute on change]
while true
do
set -e
inotifywait -q -r --exclude ".git|.idea" -e close_write,moved_to,create $1 > /dev/null
set +e
eval ${*:2}