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 | |
# 检查用户是否提供了 inode 号作为参数 | |
if [ -z "$1" ]; then | |
echo "用法: $0 <inode_number>" | |
exit 1 | |
fi | |
inode_to_find="$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
#!/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. |
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
#!/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. |
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
#!/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. |
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
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}); |
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
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")) |
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
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")) |
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
// Sample run-pubsub is a Cloud Run service which handles Pub/Sub messages. | |
package main | |
import ( | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" | |
) |
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
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")) |
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
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() |
NewerOlder