Skip to content

Instantly share code, notes, and snippets.

View zh4n7wm's full-sized avatar
🎯
Focusing

Hydra zh4n7wm

🎯
Focusing
View GitHub Profile
@zh4n7wm
zh4n7wm / list-cognito.py
Last active April 12, 2024 08:20
list dataset records of aws cognito identity pool
import boto3
identity_pool_id = "us-east-1:xxxxx"
dataset_name = "dataset-name-xxx"
client_sync = boto3.client("cognito-sync")
client_identity = boto3.client("cognito-identity")
def get_dataset_detail(identity_id):
@zh4n7wm
zh4n7wm / decent_request.py
Created December 21, 2023 05:27 — forked from laixintao/decent_request.py
Send HTTP requests using python-requests with timeout, tcp reuse(session) and retry.
from requests.adapters import HTTPAdapter, Retry
from requests import Session
retries = Retry(
total=5, backoff_factor=1, status_forcelist=[502, 503, 504]
)
session = Session() # reuse tcp connection
session.mount("http://", HTTPAdapter(max_retries=retries))
session.mount("https://", HTTPAdapter(max_retries=retries))
@zh4n7wm
zh4n7wm / ping.go
Last active June 26, 2023 12:04
pinecone ping demo
package main
import (
"bytes"
"context"
"crypto/ed25519"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
@zh4n7wm
zh4n7wm / GitConfigHttpProxy.md
Created December 22, 2022 02:21 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

package main
import (
"fmt"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)
@zh4n7wm
zh4n7wm / tls-ca.go
Created April 23, 2022 09:41 — forked from ashee/tls-ca.go
golang tls with self-signed cert
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"net/http"
)
@zh4n7wm
zh4n7wm / mysql-tips.md
Created January 11, 2022 05:47
mysql tips

MySQL tips

reset password

跳过权限检查,让 root 没有密码就能进入 MySQL

sudo systemctl edit mysql
@zh4n7wm
zh4n7wm / vim-tips.md
Last active June 6, 2021 03:01
Vim Tips

neovim

install

brew install neovim

config

@zh4n7wm
zh4n7wm / podman-tips.md
Created March 4, 2021 09:29
podman tips