Skip to content

Instantly share code, notes, and snippets.

View shangjiyu's full-sized avatar

shangjiyu shangjiyu

  • AAA
  • Hangzhou|Jiaxing China
View GitHub Profile
@shangjiyu
shangjiyu / Netfilter-IPTables-Diagrams.md
Created October 12, 2022 03:01 — forked from nerdalert/Netfilter-IPTables-Diagrams.md
Linux NetFilter, IP Tables and Conntrack Diagrams

Linux NetFilter, IP Tables and Conntrack Diagrams

IPTABLES TABLES and CHAINS

IPTables has the following 4 built-in tables.

1) Filter Table

Filter is default table for iptables. So, if you don’t define you own table, you’ll be using filter table. Iptables’s filter table has the following built-in chains.

@shangjiyu
shangjiyu / iprange2cidr.awk
Last active May 13, 2022 23:26
iprange2cidr awk script
#
# Library with various ip manipulation functions
#
# convert ip ranges to CIDR notation
# str range2cidr(ip2dec("192.168.0.15"), ip2dec("192.168.5.115"))
#
# Credit to Chubler_XL for this brilliant function. (see his post below for non GNU awk)
#
function range2cidr(ipStart, ipEnd, bits, mask, newip) {
@shangjiyu
shangjiyu / cmcc-edu.sh
Created October 10, 2015 15:05
cmcc-edu login/logout shell script fork from http://www.openwrt.org.cn/bbs/thread-12494-1-1.html
#!/bin/sh
# cmcc auto login
# by Huson
# 2012-12-25
#export PATH=.:$PATH
#cd /root
# set var 18000=5h
@shangjiyu
shangjiyu / add_gargoyle_netfilter&itpables_modules.patch
Last active August 29, 2015 14:24
add_gargoyle_netfilter&itpables_modules.patch
Index: target/linux/generic/config-3.18
===================================================================
--- target/linux/generic/config-3.18 (revision 46316)
+++ target/linux/generic/config-3.18 (working copy)
@@ -4633,6 +4633,11 @@
# CONFIG_ZLIB_DEFLATE is not set
# CONFIG_ZLIB_INFLATE is not set
# CONFIG_ZNET is not set
+CONFIG_IMQ_NUM_DEVS=2
+# CONFIG_IMQ_BEHAVIOR_AA is not set
@shangjiyu
shangjiyu / add_xCloud-RY-1A_support.patch
Last active March 12, 2021 20:16
add_xCloud-RY-1A_support on openwrt trunk
Index: target/linux/ramips/base-files/etc/board.d/01_leds
===================================================================
--- target/linux/ramips/base-files/etc/board.d/01_leds (revision 45021)
+++ target/linux/ramips/base-files/etc/board.d/01_leds (working copy)
@@ -202,6 +202,12 @@
set_wifi_led "asus:blue:air"
set_usb_led "asus:blue:usb"
;;
+ ry-1a)
+ ucidef_set_led_default "power" "power" "dteam:red:power" "0"
@shangjiyu
shangjiyu / KiwiViewer and VES build log under ubuntu
Last active August 29, 2015 13:56
KiwiViewer and VES build log under Ubuntu
shangjiyu@jarvis:~/dev/ves/VES$ git pull
remote: Counting objects: 39, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 23 (delta 18), reused 14 (delta 9)
Unpacking objects: 100% (23/23), done.
From git://vtk.org/VES
613859e..d87a239 master -> origin/master
7e142d3..c0a6dc8 next -> origin/next
Updating 613859e..d87a239
Fast-forward
@shangjiyu
shangjiyu / VesBuildingOnWindows
Last active January 4, 2016 21:39
VES ANDROID BUILDING FOR WINDOWS
##Installing the Windows development environment
============================================================================================
#Download and install the Android SDK from here: http://developer.android.com/sdk/index.html
You should download and install the ADT Bundle for Windows(of course you can DIY). This will give you a .zip file. There is no executable installer.  
You will just have to unzip this into a directory.  For this example I unziped this file into D:\Android-sdk.
#Then the NDK http://developer.android.com/tools/sdk/ndk/index.html
#Need to get Java JDK as well