Skip to content

Instantly share code, notes, and snippets.

View tao12345666333's full-sized avatar
🎯
Focusing

Jintao Zhang tao12345666333

🎯
Focusing
View GitHub Profile
#!/usr/bin/env bash
set -Eeuo pipefail
# for real pushes, this would be "library"
targetOrg='trollin'
# https://github.com/tianon/dockerhub-public-proxy
publicProxy="$DOCKERHUB_PUBLIC_PROXY"
_curl() {
package main
import "fmt"
import "golang.org/x/sys/unix"
func DeviceFromPath(path string) {
var stat unix.Stat_t
err := unix.Lstat(path, &stat)
if err != nil {
fmt.Println(err)
@tao12345666333
tao12345666333 / deploy-APISIX-with-etcd.md
Created September 9, 2022 09:34
Deploy Apache APISIX with existing etcd

create Namespace

tao@moelove:~$ kubectl create ns apisix                 
namespace/apisix created 

deploy etcd

create a file named etcd.yaml.

@tao12345666333
tao12345666333 / convert_address.sh
Created February 10, 2023 04:27
It used to convert a string in the format XXXXXXXX:XXXX, where X is a hexadecimal digit, into the dotted-quad notation (e.g. A.B.C.D) and decimal port number format.
#!/bin/bash
address_string="$1"
# Split the string into IP address and port number parts
ip_hex="$(echo "$address_string" | cut -d : -f 1)"
port_hex="$(echo "$address_string" | cut -d : -f 2)"
# Convert the hexadecimal IP address to decimal
ip_dec=$(printf %d 0x$ip_hex)