Skip to content

Instantly share code, notes, and snippets.

"""
python redis basic operations
---
sudo apt install redis
pip install redis
"""
from redis import Redis
@0x2a94b5
0x2a94b5 / minio_client.py
Created September 10, 2021 05:18
MinIO Python Client base operations
"""
Reference: https://docs.min.io/docs/python-client-api-reference.html
"""
from json import dumps
from os import environ, listdir
from minio import Minio
@0x2a94b5
0x2a94b5 / timestamp_to_datetime.py
Created June 1, 2022 06:46
converting 13-digit unixtime in ms to timestamp in python.
"""
converting 13-digit unixtime in ms to timestamp in python.
"""
from datetime import datetime
from pydantic import BaseModel, validator
class Timestamp(BaseModel):
@0x2a94b5
0x2a94b5 / guess_wodl.py
Last active November 15, 2022 07:18
Guess the crypto WODL in 6 tries.
"""
Crypto WODL
Guess the crypto WODL in 6 tries.
"""
import argparse
FILES = ['1173652193564069797.txt', '6907048048270523401.txt', '7603521794355887959.txt']
CHARACTERS = ['.', ',', '"', '’', '“', '”', '(', ')', '-']
@0x2a94b5
0x2a94b5 / backup_mysql.sh
Last active June 19, 2025 07:52
Automate MySQL database backups to run every Saturday
#!/bin/bash
# 获取脚本所在的目录
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
# 加载 .env 文件
source $SCRIPT_DIR/.env
# 检查是否加载成功
if [ -z "$DB_NAME" ]; then