Skip to content

Instantly share code, notes, and snippets.

View 2minchul's full-sized avatar
๐Ÿ˜€

Colin (MinChul Lee) 2minchul

๐Ÿ˜€
View GitHub Profile
@2minchul
2minchul / update_trackers.py
Last active November 20, 2021 17:42
Update qBittorrent tracker list from url
import json
import os
import requests
trackers_list_url = 'https://newtrackon.com/api/stable'
qbt_host = 'http://localhost:8081'
custom_trackers = '''
http://open.acgnxtracker.com:80/announce
@2minchul
2minchul / main.go
Last active April 5, 2022 10:13
Golang TCP server
package main
import (
"encoding/hex"
"errors"
"flag"
"fmt"
"io"
"log"
"net"
@2minchul
2minchul / average.py
Created July 14, 2022 12:28
Get RGB average of PIL image
from PIL import Image
def get_rgb_average(img: Image) -> tuple:
histogram = img.histogram()
r = max(range(256), key=lambda x: histogram[x])
g = max(range(256), key=lambda x: histogram[256 + x])
b = max(range(256), key=lambda x: histogram[512 + x])
return r, g, b
@2minchul
2minchul / gcp_poxy.go
Created December 5, 2022 09:08
Use http proxy in golang gcs package
package main
import (
"context"
"crypto/tls"
"io"
"net/http"
"net/url"
"cloud.google.com/go/storage"
@2minchul
2minchul / example.py
Created March 17, 2023 16:00
Kakao ์šฐํŽธ๋ฒˆํ˜ธ ์„œ๋น„์Šค for python
from concurrent.futures import ThreadPoolExecutor, as_completed
from typing import Optional, List, Tuple, Dict
import requests
from bs4 import BeautifulSoup
def search_many_postcode(queries: List[Tuple[str, str]]) -> Dict[tuple, Optional[dict]]:
"""
:param queries: list of tuple(keyword, zipcode)
tls:tls_device_offload_set
tls:tls_device_decrypted
tls:tls_device_rx_resync_send
tls:tls_device_rx_resync_nh_schedule
tls:tls_device_rx_resync_nh_delay
tls:tls_device_tx_resync_req
tls:tls_device_tx_resync_send
mac80211:drv_return_void
mac80211:drv_return_int
mac80211:drv_return_bool
We can't make this file beautiful and searchable because it's too large.
subject
[PATCH v4 18/18] btrfs: only set QUOTA_ENABLED when done reading qgroups
[PATCH v4 17/18] btrfs: track data relocation with simple quota
[PATCH v4 16/18] btrfs: track metadata relocation cow with simple quota
[PATCH v4 15/18] btrfs: check generation when recording simple quota delta
[PATCH v4 14/18] btrfs: simple quota auto hierarchy for nested subvols
[PATCH v4 13/18] btrfs: record simple quota deltas
[PATCH v4 12/18] btrfs: inline owner ref lookup helper
[PATCH v4 11/18] btrfs: new inline ref storing owning subvol of data extents
[PATCH v4 10/18] btrfs: track original extent owner in head_ref
@2minchul
2minchul / pdf_convert.py
Created October 17, 2023 07:13
html to pdf converter streamlit example
import pdfkit
import streamlit as st
# Streamlit ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์„ค์ •
st.set_page_config(page_title="HTML to PDF Converter", page_icon="๐Ÿ“„")
st.title("HTML to PDF ๋ณ€ํ™˜๊ธฐ")
# HTML ํŒŒ์ผ ์—…๋กœ๋“œ
uploaded_file = st.file_uploader("๋ณ€ํ™˜ํ•  HTML ํŒŒ์ผ์„ ์—…๋กœ๋“œํ•˜์„ธ์š”", type="html")
import base64
import pyperclip
target_file_path = r'C:\Users\user\Desktop\project.zip'
def chunks(lst, n):
for i in range(0, len(lst), n):
yield lst[i:i+n]
if __name__ == '__main__':