This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '{for(i=1;i<=100;i++){a=i;if(i%3==0){a="Fizz"}if(i%5==0){a=gensub(/[0-9]+/,"","g",a);a=a"Buzz"}print a;}}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ### nmicic@cisco.com | |
| ### https://gist.github.com/nmicic/c04a9400ef39576e2d284aacf68bf99b ### | |
| function help_message { | |
| echo | |
| echo "NOTE1: Script may cause kernel panic or reboot of the host! High risk running in production!" | |
| echo "NOTE2: Script will clear dmesg. Please be aware! "man dmesg" for more info!" | |
| echo "NOTE3: To run script execute: $0 run" | |
| echo | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ver 0.3 | |
| ###### Please always collect 2x SSD before/after running this script! #### | |
| # additionally please collect: "cat /proc/ucad/ipsec/sa_table" from DPC card we investigate from all CPU's of that DPC | |
| read -r -d '' HELP_README << README_BEGIN_END | |
| # get to debug shell after cli test-commands password ... | |
| To run: | |
| cd /var/tmp | |
| cat > /var/tmp/ucad_proc.sh | |
| <copy/paste this script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### Ver 4.4 # 17th Oct 2022 | |
| ###Contact: nmicic@cisco.com | |
| ### NOTE script monitor for the following errors on DPC only | |
| ### ucam_cavecreek_dh_p1_sync()[2995]: cpaCyDhKeyGenPhase1() Failed with Status: -2! | |
| ### | |
| ### NOTE: Please copy/paste script from begin #!/bin/bash to the ###END | |
| ### NOTE: Please copy/paste script from begin #!/bin/bash to the ###END | |
| ### NOTE: Please copy/paste script from begin #!/bin/bash to the ###END | |
| read -r -d '' HELP_README << README_BEGIN_END |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| FILE=$1 | |
| tshark -nr $FILE -q -z io,stat,1,"COUNT(tcp)tcp","COUNT(tcp.analysis.retransmission)tcp.analysis.retransmission","COUNT(tcp.analysis.fast_retransmission)tcp.analysis.fast_retransmission","COUNT(tcp.analysis.spurious_retransmission)tcp.analysis.spurious_retransmission","COUNT(tcp.analysis.duplicate_ack)tcp.analysis.duplicate_ack","COUNT(tcp.analysis.lost_segment)tcp.analysis.lost_segment","COUNT(tcp.analysis.ack_lost_segment)tcp.analysis.ack_lost_segment","COUNT(tcp.analysis.rto)tcp.analysis.rto","COUNT(tcp.analysis.out_of_order)tcp.analysis.out_of_order","MIN(tcp.window_size)tcp.window_size","AVG(tcp.window_size)tcp.window_size","MAX(tcp.window_size)","COUNT(tcp.analysis.window_full)tcp.analysis.window_full","COUNT(tcp.analysis.zero_window)tcp.analysis.zero_window","MIN(tcp.analysis.ack_rtt)tcp.analysis.ack_rtt","AVG(tcp.analysis.ack_rtt)tcp.analysis.ack_rtt","MAX(tcp.analysis.ack_rtt)tcp.analysis.ack_rtt","MIN(tcp.analysis.initial_rtt)tcp.analysis.initial_rtt","AVG(tcp.analysis.initial_rt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DEBUG=1 | |
| test $DEBUG -ne 0 && set -vx | |
| trap "date;echo Got Signal;echo 3 > /proc/sys/vm/drop_caches&rm -rf /mnt/user/hd-raid/records/cdr/Tests/*;exit;" 0 1 2 3 13 15 | |
| mkdir -p /mnt/user/hd-raid/records/cdr/Tests/ | |
| test ! -d /mnt/user/hd-raid/records/cdr/Tests/ && echo "ERROR /mnt/user/hd-raid/records/cdr/Tests/ doesn't exist" && exit | |
| cd /mnt/user/hd-raid/records/cdr/Tests/ | |
| DAY=`date +%d` | |
| RNDDIR="$DAY"/"$RANDOM" | |
| mkdir -p $RNDDIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| PREVALLOC1=0 | |
| PREVALLOC2=0 | |
| PREVALLOC3=0 | |
| PREVALLOC4=0 | |
| PREVFREE1=0 | |
| PREVFREE2=0 | |
| PREVFREE3=0 | |
| PREVFREE4=0 | |
| #while [ 1 ]; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| cat << DONT_REMOVE_THIS_LINE_BEGIN_END_M > /tmp/Intel_ring_dump.tgz.base64 | |
| H4sIAAAAAAACA+xcDXRTVZ5/SVsaoCYRqlZReWgrRSE0bSnho9iUFF7Z4jBQ1Bmo | |
| aUhSyJAvk5dSRnbs2bSuj1in7jmuHs4cl9nZ4zozu37M6Aw6zrS1QMGPGWTOOMwy | |
| syKKJBaxrHxUEbL//333tTeveSi7jmf32FuSe+/v/r/u/37mvvuoD4pevzPiC250 | |
| emKB8FzurxDKIMyfN4/EENQxSVsrK8qqKsqryudZuTJredX8eRw/769hjDrEoqIr | |
| wvNcJBQSL0X3eeX/T0O9qv0DAU+k1bI59GXquHT7l1dY58ntX2Eth69KaP/KCoD4 | |
| sq/CAV/z9r+/rmGZXqcbyeu4JZwuC53NPJquod9F3FVcLqQK4ZMDn+V3rOUerpvK | |
| hZ4dmvoc//bhla9ssaz/4N5mVs5aQTomxE+YBalpqEHyDicRFKRzDYknuzGV+IZZ | |
| SLQaGhLLSxuko8KsU4Sgs1fqjxVIhxoS3mEh0TS0vx8LB/ZimbVX6DtaIAwMYIZQ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #NOTE: This just generate output. You have to paste back this into CLI and configure it! | |
| cli test-commands password ..... | |
| debug shell | |
| cli show task table facility sessmgr all | grep sessmgr | awk 'BEGIN{print "configure"} {if ($3<5000){print "no logging enable-debug facility sessmgr instance "$3 }} END{print "exit"}' | |
| exit | |
| #NOTE: This just generate output. You have to paste back this into CLI and configure it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "Impacted card is one where you see the line: ERROR: Qat is not responding. Please restart the device" | |
| ping bcast -c 2 -w 0.2 -b >& /dev/null | |
| IpNeighShowReach=( $( ip neigh show | grep 172.16 | grep REACHABLE | awk '{print $1}' | sort -n )) | |
| i=0;for IP in "${IpNeighShowReach[@]}";do i=$(( $i + 1 )); IPX[$i]=$IP;done;iLAST=$i; | |
| for ((i=1;i<=$iLAST;i++)); do | |
| IP=${IPX[$i]}; | |
| echo === $IP === | |
| grep $IP" " /etc/hosts | |
| ssh $IP 'grep -e "ERROR" -e "Qat is not responding" -e "Please restart the device" /proc/icp*/qat* /proc/icp*/heartbeat*' |
OlderNewer