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 | |
cd /tmp | |
apt install -y libosinfo-bin osinfo-db osinfo-db-tools | |
LAST=$(curl -s https://releases.pagure.org/libosinfo/CHECKSUMS | grep 'osinfo-db-[0-9].*xz).*' | sort | tail -n1 | awk '{print $2}' | sed 's/(\|)//g') | |
SHA512=$(curl -s https://releases.pagure.org/libosinfo/CHECKSUMS | grep 'osinfo-db-[0-9].*xz).*' | sort | tail -n1 | awk '{print $4}') | |
echo "$SHA512 $LAST" >./chksha512.txt | |
rm -f ./$(basename $LAST).* | |
DBARCH=$(echo $LAST | sed 's/\.xz//g') | |
rm -f ./$DBARCH | |
curl -o $LAST https://releases.pagure.org/libosinfo/$LAST |
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 | |
[ -z $1 ] && S='.*' || S=".*$1.*" | |
for name in $(docker ps | sed '1d' | grep "$S" | awk '{if(NR>0) print $NF}'); do | |
echo "$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $name) $name" | |
done | |
exit 0 |
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 | |
[ -z $1 ] && S='.*' || S=".*$1.*" | |
for name in $(docker ps | sed '1d' | grep "$S" | awk '{if(NR>0) print $NF}'); do | |
echo "$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $name) $name" | |
done | |
exit 0 |
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 | |
# | |
# Reverse binary C headers files back | |
# | |
grep "0x.*" $1 | sed -E -e 's/\t//g'| tr -d "\r" | tr -d "\n" | xxd -r -p |
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
[Interface] | |
Address = 192.168.0.2/24 | |
PrivateKey = <ClientPrivateKey> | |
Table = off | |
#server1 - primary connection | |
[Peer] | |
PublicKey = <server1_PublicKey> | |
Endpoint = <ip-server1>:<port-server1> | |
AllowedIPs = 0.0.0.0/1, 128.0.0.0/1 |
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
# | |
# $mask : IPv4 dotted Subnetmask | |
# result: IPv4 slashed Subnetmask | |
# | |
mask="255.255.255.240" | |
x=$(echo $(IFS='.'; for b in $mask; do echo -ne $(echo "obase=2;$b" | bc); done) | sed 's/0//g'); echo ${#x} | |
# Example: | |
# ~ $ mask="255.255.255.240" |
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 | |
if [[ $1 =~ ^([0-9\.]+)/([0-9]+)$ ]]; then | |
IPADDR=${BASH_REMATCH[1]} | |
NETMASKLEN=${BASH_REMATCH[2]} | |
MODULUS=8 | |
NUM="10" | |
FORMAT='%s%i%s' | |
WORDS=4 | |
FS='.' |
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
rtr(config)#spanning-tree ? | |
backbonefast Enable BackboneFast Feature | |
etherchannel Spanning tree etherchannel specific configuration | |
extend Spanning Tree 802.1t extensions | |
loopguard Spanning tree loopguard options | |
mode Spanning tree operating mode | |
mst Multiple spanning tree configuration | |
pathcost Spanning tree pathcost options | |
portfast Spanning tree portfast options | |
pseudo-information L2GP/R-L2GP |