Skip to content

Instantly share code, notes, and snippets.

Abacus Planning Group Inc.
Abbot Financial Management Inc.
Abbrea Capital LLC
Abdiel Capital Advisors LP
Abingworth LLP
Abner Herrman & Brock LLC
Abrams Bison Investments LLC
Abrams Capital Management L.P.
ABS Capital Partners V Trust
Academy Capital Management Inc. TX
@evanslai
evanslai / brctl_show.sh
Created November 6, 2020 09:19 — forked from PitBeast/brctl_show.sh
brforward convertion
brctl_showmacs () {
cat /sys/class/net/$1/brforward > /tmp/brforward ;
printf "port no\tmac addr\t\tis local?\tageing timer\n" ;
hexdump -v -e '5/1 "%02x:" /1 "%02x" /1 " %x" /1 " %x" 1/4 " %i" 1/4 "\n"' /tmp/brforward | awk '{ islocal = $3 ? "yes" : "no" ; printf "%3i\t%s\t%s\t\t%8.2f\n",$2,$1,islocal,$4/100 } ' ;
}
@evanslai
evanslai / firewall.user
Created December 10, 2019 02:11 — forked from anonymous/firewall.user
OpenWrt map-e (JPNE v6plus) において、割当ポート240個をちゃんと使わせるための設定。
## /etc/firewall.user
# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.
# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
@evanslai
evanslai / hfsc-shape.sh
Created November 21, 2019 13:30 — forked from bradoaks/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@evanslai
evanslai / recvRawEth.c
Created August 15, 2019 10:50 — forked from austinmarton/recvRawEth.c
Receive raw Ethernet frames in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <linux/ip.h>
@evanslai
evanslai / sendRawEth.c
Created August 15, 2019 10:50 — forked from austinmarton/sendRawEth.c
Send a raw Ethernet frame in Linux
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#include <arpa/inet.h>
#include <linux/if_packet.h>
#include <stdio.h>
@evanslai
evanslai / toUpperLower.sh
Created March 22, 2019 02:42
shell helper functions
* toUpperLower.sh
@evanslai
evanslai / .vimrc
Created November 27, 2018 10:33
vimrc
"https://github.com/amix/vimrc
set runtimepath+=~/.vim_runtime
source ~/.vim_runtime/vimrcs/basic.vim
source ~/.vim_runtime/vimrcs/filetypes.vim
source ~/.vim_runtime/vimrcs/plugins_config.vim
source ~/.vim_runtime/vimrcs/extended.vim
try
source ~/.vim_runtime/my_configs.vim
@evanslai
evanslai / README.md
Last active January 29, 2018 13:23 — forked from Jxck/README.md
libuv TCP server/client sample #lib

how to compile

$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices server.c -o server
$ gcc -g -Wall -I /path/to/libuv/include /path/to/libuv/uv.a -framework CoreServices client.c -o client
@evanslai
evanslai / c-macro_FILE_short.c
Created January 23, 2018 01:18
C: Make the predefined MACRO __FILE__ become short path
#include <string.h>
#define __FILENAME__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)