Skip to content

Instantly share code, notes, and snippets.

View Chaz6's full-sized avatar

Chris Hills Chaz6

View GitHub Profile
@Chaz6
Chaz6 / jnh_exception_packet_trace.rb
Created May 19, 2022 12:05 — forked from ytti/jnh_exception_packet_trace.rb
script to turn JunOS Trio exception capture into a 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
@Chaz6
Chaz6 / bash-path-vars
Created March 16, 2017 17:48 — forked from caruccio/bash-path-vars
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts