I hereby claim:
- I am ytti on github.
- I am ytti (https://keybase.io/ytti) on keybase.
- I have a public key whose fingerprint is 91F0 68C8 5A1C 0C10 1AE0 BE2B E870 F16A 810A E277
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env ruby | |
## Example run: (omitting DST will show cost+path to all dsts) | |
## [ytti@eng0.dllstx09.us.to.gin.ntt.net ~/git/misc]% ./spf.rb r23.snjsca04.us.bb r20.frnkge04.de.bb | |
## --- | |
## r20.frnkge04.de.bb: | |
## cost: 155152 | |
## path: | |
## - r23.snjsca04.us.bb | |
## - r22.snjsca04.us.bb |
#!/usr/bin/env ruby | |
# this requires ruby2.0, if important I'll package this | |
require 'pty' | |
require 'expect' | |
require 'ipaddr' | |
require 'json' | |
require 'pry' | |
require 'pp' |
#!/usr/bin/env ruby | |
require 'ntt/junos/xmlssh' | |
require 'pry' | |
class GetTopology | |
HOST = 'r00.testtx09.us.bb' | |
COMMAND = 'show isis database detail' | |
attr_reader :nodes, :edges |
#!/usr/bin/env ruby | |
## 1) capture data => monitor np counter MDF_PUNT_POLICE_DROP np0 count 25 location 0/2/CPU0 | |
## | |
## 2) You'll need 'text2pcap' => sudo apt-get install wireshark-common | |
## | |
## 3) Run with file as argument: | |
## [ytti@lintukoto ~/tmp/ios-xr-npu-monitor-pcap]% ./xr2pcap.rb r04.miamfl02.us.bb.MDF_PUNT_POLICE_DROP.ioscap | |
## Input from: r04.miamfl02.us.bb.MDF_PUNT_POLICE_DROP.txt | |
## Output to: r04.miamfl02.us.bb.MDF_PUNT_POLICE_DROP.pcap |
#!/usr/bin/env ruby | |
# script to generate PCAP from Trio exception trace. Potentially you may need to change POP_BYTES variable. | |
# Trio exception trace allows you to capture things like broken packets (checksum error), to see who is sending them | |
# clogin junos-trio-box | tee exception_trace | |
# start shell pfe network fpc0 | |
# show jnh 0 exceptions terse | |
# debug jnh exceptions N discard ## get N from above command | |
# debug jnh exceptions-trace |
#!/usr/bin/env ruby | |
# your IP header | |
DATA = [0x4501, 0x0028, 0x87ea, 0x4000, 0x3006, 0x5bfd, 0xXXXX, 0xXXXX, 0xXXXX, 0xXXXX] | |
IS = DATA[5] # checksum on the packet | |
WANT = 0x5bfc # checksum you want | |
# output | |
# (here we can see that packet had ECN bit set, but had it not had, checksum would be correct) |
#!/usr/bin/env ruby | |
module NetMonte | |
STANDARD_DEVIATION = 2.5 | |
MINUTES = 365*24*60 | |
class Simulate | |
def initialize years, *networks | |
years.times do |year| |
module NetMonte | |
STANDARD_DEVIATION = 2.5 | |
MINUTES = 365*24*60 | |
class Simulate | |
def initialize(years, *networks) | |
years.times do |year| | |
nets = init_networks networks | |
roulette year, nets |
#!/usr/bin/env ruby | |
## 1) ssh asr9k | tee spp.capture | |
## 2) do spp/netio capture in asr9k | |
## 3) ./sppcapture.rb spp.capture | |
## 4) text2pcap spp.capture.packet spp.capture.pcap | |
## 5) open spp.capture.pcap | |
class SPPCapture | |
FILE_EXTENSION = 'packet' |