Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# 检查用户是否提供了 inode 号作为参数
if [ -z "$1" ]; then
echo "用法: $0 <inode_number>"
exit 1
fi
inode_to_find="$1"
#!/usr/bin/python
#
# connect_entry Trace TCP IPv4 connect() entry and ip_route_output_flow().
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: connect_entry [-h] [-t] [-p PID]
#
# This traces TCP connection attempts and their associated routing calls.
# When ip_route_output_flow() is called by the same PID that called tcp_v4_connect(),
# the route return value is captured and displayed.
#!/usr/bin/python
#
# connect_entry Trace TCP IPv4 connect() entry and ip_route_output_flow().
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: connect_entry [-h] [-t] [-p PID]
#
# This traces TCP connection attempts and their associated routing calls.
# When ip_route_output_flow() is called by the same PID that called tcp_v4_connect(),
# the route return value is captured and displayed.
#!/usr/bin/python
#
# connect_entry Trace TCP IPv4 connect() entry and ip_route_output_flow().
# For Linux, uses BCC, eBPF. Embedded C.
#
# USAGE: connect_entry [-h] [-t] [-p PID]
#
# This traces TCP connection attempts and their associated routing calls.
# When ip_route_output_flow() is called by the same PID that called tcp_v4_connect(),
# the route return value is captured and displayed.
public class App
{
public static void main( String[] args )
{
Server server = new Server();
ServerConnector serverConnector = new ServerConnector(server, null, null, null, 0, 1,
new HttpConnectionFactory());
serverConnector.setPort(8080);
serverConnector.setIdleTimeout(120_000);
server.setConnectors(new Connector[]{serverConnector});
func main() {
http.DefaultClient.Timeout = 1 * time.Second
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
fmt.Println(request.RemoteAddr)
writer.WriteHeader(http.StatusOK)
})
http.HandleFunc("/inner", func(writer http.ResponseWriter, request *http.Request) {
//log.Println("recv req")
writer.WriteHeader(http.StatusOK)
writer.Write([]byte("outter"))
func main() {
http.DefaultClient.Timeout = 1 * time.Second
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
fmt.Println(request.RemoteAddr)
writer.WriteHeader(http.StatusOK)
})
http.HandleFunc("/inner", func(writer http.ResponseWriter, request *http.Request) {
//log.Println("recv req")
writer.WriteHeader(http.StatusOK)
writer.Write([]byte("outter"))
// Sample run-pubsub is a Cloud Run service which handles Pub/Sub messages.
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"os"
)
func main() {
http.DefaultClient.Timeout = 1 * time.Second
http.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
fmt.Println(request.RemoteAddr)
writer.WriteHeader(http.StatusOK)
})
http.HandleFunc("/inner", func(writer http.ResponseWriter, request *http.Request) {
//log.Println("recv req")
writer.WriteHeader(http.StatusOK)
writer.Write([]byte("outter"))
func main() {
ctx := context.Background()
c, err := monitoring.NewMetricClient(ctx)
if err != nil {
fmt.Println(err)
return
}
defer c.Close()
startTime := time.Now().UTC().Add(time.Hour * -20).Unix()
endTime := time.Now().UTC().Unix()