Skip to content

Instantly share code, notes, and snippets.

obj-m := client_example.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
#!/bin/bash
#==============================================
# Author: Ricky.K
# Description: Auto telnet and run command
#==============================================
echo "My own command..." &&
(sleep 1; echo "user"; \
sleep 1; echo "password"; \
sleep 1; echo "cd /usr/local"; \
sleep 1; echo "./test.sh"; \
#!/bin/sh
set -e
VERSION=LATEST
#If you prefer a specific version you can set it specifically
#VERSION=7.66.0
GPG_KEY_URL="https://daniel.haxx.se/mykey.asc"
GPG_KEY_PATH="/out/curl-gpg.pub"
#Do not escape the above variables in script below
#change last argument to -xeus for help with debugging
#! /bin/bash
# Usage: ./who_is_listening.sh <PORT>
echo "What process is listening to $1"
lsof -nP -i4TCP:$1 | grep LISTEN
#! /bin/bash
# Usage: ./who_is_listening.sh <PORT>
echo "What process is listening to $1"
lsof -nP -i4TCP:$1 | grep LISTEN
# 重置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
@fjrti
fjrti / service.yaml
Created August 11, 2021 13:11
k8s service yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-dp
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
#!/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"
@fjrti
fjrti / iptables.txt
Created March 22, 2021 12:04
iptables.txt
# 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
@fjrti
fjrti / tetris.sh
Last active February 20, 2022 01:41
#!/bin/bash
APP_NAME="${0##*[\\/]}"
APP_VERSION="1.0"
#颜色定义
iSumColor=7 #颜色总数
cRed=1 #红色
cGreen=2 #绿色
cYellow=3 #×××