Skip to content

Instantly share code, notes, and snippets.

View crazygit's full-sized avatar

Crazygit crazygit

View GitHub Profile
@crazygit
crazygit / parseTransaction.go
Last active April 6, 2025 08:22
Parse Ethereum Transaction, Decode input data, Decode output data
package main
import (
"context"
"encoding/hex"
"fmt"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/ethclient"
@crazygit
crazygit / telegram_auto_checkin.py
Last active March 19, 2024 09:35
Telegram auto checkin script
from telethon import TelegramClient, events
import pathlib
# Remember to use your own values from my.telegram.org!
api_id = 12345
api_hash = '0123456789abcdef0123456789abcdef'
# Replace the checkin bot and text with yourown
checkin_at_bot_id = '@checkin_bot'
checkin_text = '/checkin'
@crazygit
crazygit / kubectl_config.md
Last active April 21, 2023 12:02
kubectl多配置文件管理

多集群的配置文件管理,可以在~/.kube/目录中,放置多个集群的配置文件,如

~/.kube/cluster_a.yaml
~/.kube/cluster_b.yaml
~/.kube/cluster_c.yaml

然后配置环境变量

@crazygit
crazygit / Vagrantfile
Created November 27, 2023 04:44
Setup K8S Cluster with Vagrant and Kubeadm
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# common config for master and node
config.vm.provision "shell", path: "init.sh"
config.vm.box = "gyptazy/ubuntu22.04-arm64"
config.vm.box_check_update = false
@crazygit
crazygit / aws-go-s3-download-upload-at-once.go
Created September 2, 2024 02:09
Implementing S3 File Transfer with Go: Download and Upload at Once
package main
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/dustin/go-humanize"