Skip to content

Instantly share code, notes, and snippets.

@fjrti
fjrti / tcp.sh
Created February 23, 2024 08:28
#-----------------------------------------------------------|
# INTERFACE SETTINGS
# ==================
# Please understand these before changing them.
#-----------------------------------------------------------|
#load irc and ftp conntrack helpers if they exist
/sbin/modprobe ip_conntrack_irc &>/dev/null
/sbin/modprobe ip_conntrack_ftp &>/dev/null
import (
"net/http"
_ "net/http/pprof"
)
func main() {
go http.ListenAndServe("0.0.0.0:6001", nil)
/*
业务代码
#!/bin/bash
# Set the color variable
green='\033[0;32m'
# Clear the color after that
clear='\033[0m'
printf "The script was executed ${green}successfully${clear}!"
#!/bin/bash
# crictl -r unix:///run/containerd/containerd.sock pods
# kubectl get pod kata-1 -o jsonpath='{$.status.containerStatuses[0].containerID}'
# pod id = containerID of pause
# full-id: ctr -n k8s.io c ls
# pod_ip=172.16.102.68; for ns in $(ip netns ls | cut -f 1 -d " "); do ip netns exec $ns ip a | grep -q $pod_ip; status=$?; [ $status -eq 0 ] && echo "pod namespace: $ns" ; done
# TODO
#!/bin/bash
while getopts n:c: option
do
case "${option}"
in
n)nation=${OPTARG};;
c)code=${OPTARG};;
esac
done
#!/bin/sh
export PATH='/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin'
sleep 3
ip=`curl -SsL http://cip.cc/ | head -1 | awk '{print $3}'`
echo $ip | curl -F 'f:1=<-' -F 'id:1=4ATA' fjrti:fjrti@ix.io
new_ip=$ip
# install chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# install visual studio 2019
choco install -y visualstudio2019community
choco install -y visualstudio2019buildtools
choco install -y visualstudio2019-workload-manageddesktop
choco install -y visualstudio2019-workload-vctools
# install rustup
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