Skip to content

Instantly share code, notes, and snippets.

@h053698
h053698 / create-ec2-ssm-role.sh
Last active April 3, 2026 16:50
Create EC2 IAM role + instance profile and attach AmazonSSMManagedInstanceCore
#!/usr/bin/env bash
set -euo pipefail
# Create EC2 IAM role + instance profile and attach AmazonSSMManagedInstanceCore
# Usage:
# ./scripts/create-ec2-ssm-role.sh [ROLE_NAME]
# Example:
# ./scripts/create-ec2-ssm-role.sh AWSEC2SessionManagerRole
ROLE_NAME="${1:-AWSEC2SessionManagerRole}"
@h053698
h053698 / register.py
Created March 31, 2026 23:48
gpt autoregister
import argparse
import base64
import hashlib
import json
import random
import re
import secrets
import time
import urllib.error
import urllib.parse
@h053698
h053698 / grant-secret-read-role.sh
Created March 31, 2026 11:43
Grant Secret Manager Read Value
#!/usr/bin/env bash
set -euo pipefail
# Creates/updates CUSTOMER MANAGED IAM policy only (no prompts, no role attach)
# Improved policy name: AWSSecretsManagerAllowGetSecretValue
# Usage:
# ./scripts/grant-secret-read-role.sh
POLICY_NAME="AWSSecretsManagerAllowGetSecretValue"
ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
@h053698
h053698 / build-pymysql-layer.sh
Created March 31, 2026 06:40
Build PyMySQL Layer on AWS with Lambda
#!/usr/bin/env bash
set -euo pipefail
# Interactive script:
# ./build-pymysql-layer.sh
# Then type region when prompted (e.g., ap-northeast-2)
RUNTIME="python3.14"
LAYER_NAME="pymysql-layer"
WORKDIR="${HOME}/lambda-layer"
@h053698
h053698 / create.html
Created May 29, 2025 01:05
server django question
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>새로운 질문 만들기</title>
</head>
<body>
<script>
let choiceCount = 1;
function addChoice() {

On Resuming discord.py Development

It's been [6 months][og_gist] since I announced my departure from the ecosystem and a lot has happened during that time.

During the last 2 weeks, many contributors and I came together and saw the state of the Python Discord bot ecosystem was mostly on fire. After some contemplating, with the help of others, I came to the conclusion that development should resume. During these two weeks a lot of work was spent into catching up and implementing many things to the discord.py project and to eventually launch a v2.0 release. We're on a deadline but we got a lot of work done.

Why did you come back?

About three weeks ago, Discord [announced][decommission] that it would decommission API versions 6 and 7 on May 1st, 2022. While the current beta version, v2.0, is on version 9, the current stable version of discord.py, v1.7.3, is on version 7 of the API. This means that Discord's plan to decommission v6 and 7 will result in all bots on the stable version of discord.py ceasing

@h053698
h053698 / DiscordEmojiInfo.js
Last active May 4, 2021 01:50
Discord emoji information generator
var findModule = (item) => Object.values(webpackJsonp.push([[],{['']:(_,e,r)=>{e.cache=r.c}}, [['']]]).cache).find(m=>m.exports&&m.exports.default&&m.exports.default[item]!==void 0).exports.default;
findModule('sendMessage').sendMessage = (sendMessage => async(id, message, ...params) => {
if (message['content'].startsWith("getinfo <:") || message['content'].startsWith("getinfo <a:")) {
let arr = []
message.validNonShortcutEmojis.forEach(emoji => {
var emojiuse = message['content'].replace('getinfo ', '')
arr.push(` ${emojiuse}\n`)
arr.push(`Emoji \`${emoji.name}\` (${emoji.id})\n`)
arr.push(`Emoji Animated \`${emoji.animated}\` \n`)
arr.push(`Emoji Available \`${emoji.available}\` \n`)