Skip to content

Instantly share code, notes, and snippets.

@charsyam
charsyam / gist:cac98f862a3c9f16a0bc5862553d1d45
Created June 23, 2025 10:25
Redis 모니터링 생성 tasks.md
# Redis 모니터링 시스템 개발 Task 문서
## 📌 개요
- 본 문서는 Redis 모니터링 시스템 구축을 위한 Task를 상세하게 나눈 작업 목록입니다.
- 각 Task는 상태, 의존성, 인수 테스트 조건을 포함합니다.
---
## 🟧 A. 인증 및 보안 (AUTH)
# 모니터링 시스템
이 프로젝트는 FastAPI와 Celery를 사용한 모니터링 시스템입니다.
## 프로젝트 구조
```
.
├── app/
│ ├── __init__.py
@charsyam
charsyam / fastapi.py
Created July 24, 2022 08:09
FastAPI + aioredis simple settings
from fastapi import FastAPI
import aioredis
app = FastAPI()
async def redis_pool():
# Redis client bound to pool of connections (auto-reconnecting).
return aioredis.from_url(
"redis://localhost", encoding="utf-8", decode_responses=True
)
import boto3
import logging
logger = logging.getLogger('dag')
logger.setLevel(logging.INFO)
def get_url(bucket_name, obj):
return f"s3://{bucket}/{obj.key}"
#include <iostream>
#include <string>
#include <folly/ConcurrentSkipList.h>
static std::string makeRandomeString(int len) {
std::string s;
for (int j = 0; j < len; j++) {
s.push_back((rand() % 26) + 'A');
}
@charsyam
charsyam / timebased_otpcode_generator.go
Created January 13, 2021 13:54
Go Timebased OTP Code Generator
package main
import (
"crypto/rand"
"crypto/hmac"
"crypto/sha1"
"encoding/base32"
"time"
"fmt"
)
from thrift.protocol import TBinaryProtocol
from thrift.transport import TTransport
from schemas.singer.ttypes import LogMessage
fstream = open("./tf.log","rb")
transport = TTransport.TFramedTransport(TTransport.TFileObjectTransport(fstream))
protocol = TBinaryProtocol.TBinaryProtocol(transport)
transport.open()
#include "rocksdb/db.h"
#include <iostream>
int main(int argc, char *argv[]) {
rocksdb::DB* db;
rocksdb::Options options;
options.create_if_missing = true;
rocksdb::Status status = rocksdb::DB::Open(options, argv[1], &db);
std::cout << status.ok() << std::endl;
DAG=$1
START=$2
END=$3
run() {
CMD="airflow backfill $DAG -s $1"
$CMD
RET=$?
return $RET
}
#include <stdint.h>
#include <stdio.h>
#include <map>
#include <vector>
#include <memory>
#include <type_traits>
#include <utility>
#include <iostream>
#include <chrono>