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
# -*- coding: utf-8 -*- | |
from netaddr import IPNetwork | |
import click | |
@click.command() | |
@click.argument('cidr') | |
@click.option('--seperator', '-s', default=',', help='List seperator.') | |
@click.option('--file', '-f', default=False, help='txt file output path.') | |
@click.option('--range/--no-range', default=False, help='Output first and last IP Addresses') |
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 | |
#if use drive which if=ide, set root to /dev/sda1 | |
#if use drive which if=virtio, set root to /dev/vda1 | |
P9PATH=~/work/xxxx-repo/xxxx/test | |
~/work/qemu-run-arm64/qemu/aarch64-softmmu/qemu-system-aarch64 \ | |
-s -cpu cortex-a57 -machine virt \ | |
-trace enable=wd_dummy_v2_* \ |
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 | |
vip=172.21.15.128 | |
stime=15 | |
run_wrk_short() { | |
echo "==== short connection: with $1 task, $2 connection ==" | |
wrk2 -H "Connection: Close" -t $1 -c $2 -d 30s -R 30000 http://$vip --latency | |
sleep $stime | |
} |
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 | |
APP_NAME="${0##*[\\/]}" | |
APP_VERSION="1.0" | |
#颜色定义 | |
iSumColor=7 #颜色总数 | |
cRed=1 #红色 | |
cGreen=2 #绿色 | |
cYellow=3 #××× |
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
# Generated by iptables-save v1.6.1 on Mon Oct 26 11:55:22 2020 | |
*raw | |
:PREROUTING ACCEPT [5751065:1174679472] | |
:OUTPUT ACCEPT [5736441:1152388541] | |
:CILIUM_OUTPUT_raw - [0:0] | |
:CILIUM_PRE_raw - [0:0] | |
-A PREROUTING -m comment --comment "cilium-feeder: CILIUM_PRE_raw" -j CILIUM_PRE_raw | |
-A OUTPUT -m comment --comment "cilium-feeder: CILIUM_OUTPUT_raw" -j CILIUM_OUTPUT_raw | |
-A CILIUM_OUTPUT_raw -o lxc+ -m mark --mark 0xa00/0xfffffeff -m comment --comment "cilium: NOTRACK for proxy return traffic" -j NOTRACK | |
-A CILIUM_OUTPUT_raw -o cilium_host -m mark --mark 0xa00/0xfffffeff -m comment --comment "cilium: NOTRACK for proxy return traffic" -j NOTRACK |
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 | |
ISO=GoboLinux-016.01-x86_64.iso | |
IMG=sda.img | |
OUTIFACE=wlan0 | |
NETWORK_OPTS="-net nic,macaddr=E0:06:E6:CE:FF:EE,model=virtio -net tap,ifname=tap1,script=no" | |
KVM_OPTS="-enable-kvm -cpu host -daemonize" | |
BOOT_DRIVE="$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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: nginx-dp | |
labels: | |
app: nginx | |
spec: | |
replicas: 2 | |
selector: | |
matchLabels: |
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
# 重置kubeadm | |
echo "----------------重置系统环境--------------------" | |
sudo kubeadm reset | |
# 重置iptables | |
iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X | |
sudo sysctl net.bridge.bridge-nf-call-iptables=1 | |
# 重置网卡信息 | |
sudo ip link del cni0 |
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 | |
# Usage: ./who_is_listening.sh <PORT> | |
echo "What process is listening to $1" | |
lsof -nP -i4TCP:$1 | grep LISTEN |
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 | |
# Usage: ./who_is_listening.sh <PORT> | |
echo "What process is listening to $1" | |
lsof -nP -i4TCP:$1 | grep LISTEN |