Skip to content

Instantly share code, notes, and snippets.

View tao12345666333's full-sized avatar
🎯
Focusing

Jintao Zhang tao12345666333

🎯
Focusing
View GitHub Profile
@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)
@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.

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)
#!/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() {
@tao12345666333
tao12345666333 / nginx.conf
Last active September 7, 2019 01:45
多个vue前端项目使用同一域名nginx配置
upstream api {
server localhost:6663;
}
server {
listen 80;
server_name moelove.info;
charset utf-8;
root /www/moelove;
index index.html index.html;
@tao12345666333
tao12345666333 / Python3.6-build-on-CentOS7.txt
Created June 22, 2017 04:15
Python3.6 source code build on CentOS 7.3
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_dbm _gdbm _lzma
_sqlite3 _tkinter readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
so.
sudo yum install gdbm-devel tk-devel xz-devel sqlite-devel readline-devel bzip2-devel ncurses-devel zlib=devel
@tao12345666333
tao12345666333 / MovingTheCtrlKey.sh
Created August 28, 2015 15:43
Moving the Ctrl key to Caps Lock
setxkbmap -layout "$(setxkbmap -print | awk -F + '/xkb_symbols/ {print $2}')" -option ctrl:nocaps
@tao12345666333
tao12345666333 / gist:bc4544836af6f619be5a
Created September 26, 2014 10:59
隐藏Web类APP的browser bar
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
# Conky settings #
background no
update_interval 1
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
double_buffer yes
no_buffers yes
@tao12345666333
tao12345666333 / Regex-match-Chinese.py
Created July 23, 2014 15:03
正则表达式匹配中文
import re
nickname = raw_input('Please input your nickname > ')
if not re.search(u'^[\u4e00-\u9fa5a-zA-Z0-9]+$', unicode(nickname,'utf8')):
print 'Your nickname format is error, please try again !'
else:
print 'Hello %s'% nickname