Skip to content

Instantly share code, notes, and snippets.

View qsun's full-sized avatar
🎯
Focusing

Quan qsun

🎯
Focusing
  • open
  • Sydney NSW Australia
View GitHub Profile
@qsun
qsun / terraform-plan-vendcoin-ecs-v2.txt
Created July 31, 2025 08:30
SD-90 Vendcoin ECS Migration Terraform Plan (Updated with Fargate Spot)
null_resource.cleanup_pending_certs: Refreshing state... [id=4896404257609894632]
module.ppe-staging.random_password.laravel_key: Refreshing state... [id=none]
module.vendcoin.random_password.vendcoin_super_password: Refreshing state... [id=none]
module.mdb-production.random_password.mysql_password: Refreshing state... [id=none]
module.ppe-production.random_password.mysql_password: Refreshing state... [id=none]
random_password.staging-password: Refreshing state... [id=none]
module.locker-staging.random_password.mysql_password: Refreshing state... [id=none]
random_password.password: Refreshing state... [id=none]
module.billing-production.random_password.laravel_key: Refreshing state... [id=none]
module.ppe-staging.random_password.jwt_secret: Refreshing state... [id=none]
@qsun
qsun / terraform-plan-vendcoin-ecs.txt
Created July 31, 2025 02:04
SD-90 Vendcoin ECS Migration Terraform Plan
null_resource.cleanup_pending_certs: Refreshing state... [id=4896404257609894632]
random_password.staging-password: Refreshing state... [id=none]
random_password.password: Refreshing state... [id=none]
module.vendcoin.random_password.vendcoin_super_password: Refreshing state... [id=none]
module.billing-production.random_password.mysql_password: Refreshing state... [id=none]
module.mdb-production.random_password.mysql_password: Refreshing state... [id=none]
module.ppe-staging.random_password.jwt_secret: Refreshing state... [id=none]
module.sc-production.random_password.laravel_key: Refreshing state... [id=none]
module.billing-production.random_password.laravel_key: Refreshing state... [id=none]
module.billing-ng-production.random_password.mysql_password: Refreshing state... [id=none]
@qsun
qsun / finish.py
Created July 20, 2025 23:48
When claude code finishes the conversation, send a slack message to remind myself
#!/usr/bin/env python3
import json
import sys
import os
import requests
from urllib.parse import quote
from datetime import datetime
# ~/.claude/settings.json
'''
# Trying to make an appointment with someone as soon as possible.
import os
from datetime import datetime
from http.cookiejar import CookieJar
import requests
from bs4 import BeautifulSoup
notification_url = os.environ['IFTTT_WEBHOOK']
import serial
import aqi
def read_frame(ser):
bs = ser.read(2)
# print(['0x{:02x}'.format(x) for x in bs])
length = bs[0]*256+bs[1]
frame = ser.read(length)
pm1_0 = frame[0]*256+frame[1]
@qsun
qsun / use.c
Created January 11, 2019 14:12
mimic poll with IRQ (using C macro)
IT_WRAP(uart6_dma_in_progress, HAL_UART_Transmit_IT(&CLI_UART, (uint8_t *)(debug_log_str + debug_log_tail), len));
@qsun
qsun / kicad-jlc-smt-convert.py
Created August 26, 2018 10:51
convert kicad .pos SMT file into the one JLC uses.
import sys
import csv
import re
for filename in sys.argv[1:]:
print("Processing %s" % (filename,))
o_filename = filename + '-jlc.csv'
with open(filename, 'r') as i:
@qsun
qsun / deploy.sh
Created January 18, 2016 19:54
Deploy script for laravel
#!/bin/bash
set -e
set -x
/sbin/start-stop-daemon --stop --oknodo --pidfile /home/httpsreminder/queue.pid --retry=TERM/30/KILL/5
if [ -d httpsreminder.com ]; then
pushd httpsreminder.com
@qsun
qsun / index.go
Created July 27, 2015 07:16
Control max open dirs in Golang
// src/golang.org/x/tools/godoc/index.go, L993
// NewIndex creates a new index for the .go files provided by the corpus.
func (c *Corpus) NewIndex() *Index {
// initialize Indexer
// (use some reasonably sized maps to start)
x := &Indexer{
c: c,
fset: token.NewFileSet(),
fsOpenGate: make(chan bool, maxOpenFiles),
@qsun
qsun / flow.json
Last active August 29, 2015 14:14
flow
{
"days":[
{
"dateHuman":"Today",
"dateExact":"5 Feb 2015",
"stories":[
{
"title":"Sydney property prices climb even higher despite drop in activity over the summer holiday period",
"summary": "The combined value of houses and units increased 1.4 per cent over the month, growing just as values fell 1.2 per cent in Adelaide, 1.3 per cent in Darwin and 0.6 per cent in Perth.",
"url":"http://www.dailytelegraph.com.au/realestate/news/sydney-property-prices-climb-even-higher-despite-drop-in-activity-over-the-summer-holiday-period/story-fni0cly6-1227204906005",