Skip to content

Instantly share code, notes, and snippets.

View zh4n7wm's full-sized avatar
🎯
Focusing

Hydra zh4n7wm

🎯
Focusing
View GitHub Profile
@zh4n7wm
zh4n7wm / windows-tips.md
Created September 17, 2024 09:45
Windows Tips

disable CTRL+ALT+DELETE

refs: https://answers.microsoft.com/en-us/windows/forum/all/disable-ctrlaltdel-login-in-windows-10-home/cbc90186-114b-4720-a3aa-ba30c7b911f5

open Run, type Control Userpasswords2 and hit Enter to open the User Accounts Properties box. Open the Advanced tab, and in the Secure logon section, click to clear the Require users to press Ctrl+Alt+Delete check box if you want to disable the CTRL+ALT+DELETE sequence. Click Apply/OK > Exit.

If greyed out:

Run secpol.msc and hit Enter.

@zh4n7wm
zh4n7wm / aws-rds-failed.md
Created September 11, 2024 02:02
AWS RDS The vector database encountered an error while processing the request: The request was throttled because of insufficient resources on the database.

error message

botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the Retrieve operation: The vector database encountered an error while processing the request: The request was throttled because of insufficient resources on the database. (Service: RdsData, Status Code: 400, Request ID: b762f4a8-177c-4ba4-abd7-bd36b8fc17f4)

refs: https://repost.aws/questions/QUudolCeyiSDq_ZLmARgkIug/aurora-serverless-v2-the-request-was-throttled-because-of-insufficient-resources-on-the-database

action: Databases -> choose your RDS -> Connectivity & security -> RDS Data API , disable and then re-enable

@zh4n7wm
zh4n7wm / list-and-download-aws-s3-object-in-bucket.md
Created June 17, 2024 00:45
list and download the object in the aws s3 bucket

import json import pathlib

import boto3

def download_s3_obj_versions(_bucket, _key_prefix, _filename, is_save=True): client = boto3.client("s3")

_key = (pathlib.Path(_key_prefix) / _filename).as_posix()

@zh4n7wm
zh4n7wm / manifests.yaml
Created May 27, 2024 23:19 — forked from alexeldeib/manifests.yaml
crictl image cleanup
apiVersion: v1
kind: ConfigMap
metadata:
name: imagecleanupconfig
namespace: default
labels:
component: imagecleanup
data:
# removes all images unused by a running container
cronjobs: 0 0 * * * crictl rmi --prune 2>&1
@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 / gpu-tips.md
Last active May 25, 2024 01:17
gpu tips
@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"
)