Skip to content

Instantly share code, notes, and snippets.

@changtimwu
changtimwu / tdhcp.sh
Created February 12, 2015 10:02
test dnsmasq's DHCP function
killall dnsmasq; rm /var/lib/misc/dnsmasq.leases ;dnsmasq --log-dhcp -C /etc/dnsmasq.conf -k -d
@changtimwu
changtimwu / apppktport.csv
Last active August 29, 2015 14:14
kernel packet port /proc
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
8 08:44:52:67:99:ef DHCP
9 04:g5:9a:69:99:33 DHCP
@changtimwu
changtimwu / govreport_supervision_html5.md
Last active August 29, 2015 14:12
hsr supervision html5
We couldn’t find that file to show.

Study the Protocol High-availability Seamless Redundancy Protocol (HSR)

HSR is a Layer 2 redundancy protocol for Ethernet. HSR adds a header to each frame, and duplicates the frame, sending it along two directions of a ring. Nodes in the ring pass the frame along the ring, using the header to discard duplicates.

Example traffic

@changtimwu
changtimwu / aa.md
Last active August 29, 2015 14:11
aa
Protocol For Key length Version
SSL/TLS Web Access 1024 TLS 1.2
SSH CLI Access 1024 SSH v2
Digest/Encryption Algorithm For Key length Version
MD5 SNMP Authentication 128 N/A
SHA1 SNMP Authentication 160 N/A
DES SNMP Encryption 128 N/A
# ttycli.sh
cd /usr/local/nodeprjs/swixcore/lib
while true
do
check_swixcore
if [ "$?" -gt "0" ]; then
sleep 5
break
fi
#logger "CLI: swixcore not connectable. Wait next round"
@changtimwu
changtimwu / reactincoff.coffee
Last active August 29, 2015 14:10
reactjs in coffeescript
R.fieldset className:"form-group #{ex_className}",
R.legend className:"scheduler-border", item.name
R.div className:"table-responsive",
R.table className:"table table-hover",
R.tbody null,
for d_items, key in item.dynamic_item
console.log d_items
R.tr null,
for i of d_items
d_item = d_items[i]
@changtimwu
changtimwu / tzinput.coffee
Created November 22, 2014 06:14
reference code for timezone processing
fs = require 'fs'
tzfn = 'assets/conti_zones.json'
#tzfn = '/usr/local/nodeprjs/swixweb/assets/conti_zones.json'
tzfstr = fs.readFileSync( tzfn).toString()
tzdb = JSON.parse tzfstr
list_all_timezones = (tznam)->
tzs=[]
for region,cities of tzdb