Skip to content

Instantly share code, notes, and snippets.

View susemeee's full-sized avatar

Suho Lee susemeee

View GitHub Profile
/**
* ν™ˆνƒμŠ€ > 'μ‚¬μ—…μš©μ‹ μš©μΉ΄λ“œ λ§€μž…μ„Έμ•‘ 곡제 확인/λ³€κ²½' νŽ˜μ΄μ§€ λ‚΄μ˜ λ§€μž…μ„Έμ•‘ κ³΅μ œλŒ€μƒ μ—¬λΆ€λ₯Ό 일괄 '곡제' 둜 λ³€κ²½ν•˜λŠ” 슀크립트
* 일단 λͺ¨λ“ κ±Έ λ‹€ 곡제둜 변경해놓고, μ˜€ν”„λΌμΈ μ‚¬μš©μ²˜(μ†ŒλΉ„ν•œκ±°->식당,카페,λ“±)만 '뢈곡제' 둜 λ°”κΎΈλŠ” μˆœμ„œ
* '가맹점λͺ…' 이 where_keywords 쀑 ν•˜λ‚˜λ©΄ '곡제' 둜 λ³€κ²½ν•˜κ³  μ•„λ‹ˆλ©΄ κ·ΈλŒ€λ‘œ λƒ…λ‘”λ‹€.
* μ•„λž˜ μŠ€ν¬λ¦½νŠΈλŠ” 'ν† μŠ€νŽ˜μ΄λ¨ΌμΈ 'λ₯Ό 일단 곡제둜 바꿔놓고 κ·Έ μ™ΈλŠ” 뢈곡제인걸 ν™•μΈν•΄μ„œ 곡제둜 λ°”κΏˆ
*/
function execute() {
const where_keywords = [
'ν† μŠ€νŽ˜μ΄λ¨ΌμΈ  μ£Όμ‹νšŒμ‚¬',
];
@susemeee
susemeee / Caddyfile
Created August 7, 2024 13:59
The fastest way to setup Caddy + php-fpm + MySQL + WordPress using docker compose
<<site_domain>> {
root * /var/www/html
php_fastcgi wordpress:9000
file_server
encode gzip zstd
}
@susemeee
susemeee / supabase.ts
Created December 21, 2023 06:16
supabase-fetch-override-workaround
import { Database } from '@/lib/supabase-types'
import { createClient } from '@supabase/supabase-js'
export const SUPABASE_NEXTJS_CACHE_TAG = "supabase"
const supabaseUrl = process.env.NEXT_PUBLIC_SUPABASE_URL!
const supabaseKey = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!
export const client = createClient<Database>(
supabaseUrl,
@susemeee
susemeee / mongodb-log-rotation.md
Created April 13, 2023 04:56
MongoDB log rotation
mongosh

rs [direct: secondary] test> db.adminCommand( { logRotate : "server" } )

cd /var/log/mongodb

sudo -u mongodb gzip [[MONGODB_LOG_FILENAME]]
@susemeee
susemeee / psql.md
Created April 6, 2023 06:47
PostgreSQL Create new user with database
sudo vim /etc/postgresql/12/main/pg_hba.conf
host    <db_name>             <user_name>             0.0.0.0/0               password
🌞 Morning 22 commits β–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.9%
πŸŒ† Daytime 302 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 40.2%
πŸŒƒ Evening 377 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 50.1%
πŸŒ™ Night 51 commits β–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.8%
@susemeee
susemeee / MagicHole.js
Created November 3, 2020 11:07
MagicHole
window.MagicHole = new Proxy(function () { console.log('MagicHole:call', arguments); return window.MagicHole; }, {
get(target, name) {
console.log('MagicHole:get', name);
return window.MagicHole;
},
});
@susemeee
susemeee / initialize-linux.sh
Last active December 26, 2020 12:29
Script to initialize linux server
#!/bin/bash
# because I am too lazy to initialize linux server anymore
export DOTFILES_REPO_URL=https://github.com/susemeee/dotfiles.git
sudo apt update && sudo apt install -y zsh git htop git vim build-essential && git clone $DOTFILES_REPO_URL && cd dotfiles && ./install && cd ~
# tmuxconf
cd ~ && git clone https://github.com/gpakosz/.tmux.git && ln -s -f .tmux/.tmux.conf && cp .tmux/.tmux.conf.local .
$src = ".\goog"
$dest = ".\goog2"
$num=1
Get-ChildItem $src -Recurse -Include *.gif, *.jpg, *.jpeg, *.png, *.bmp, *.heic, *.heif, *.mov, *.mp4, *.webp, *.avi, *.tif, *.flv, *.mts | ForEach-Object {
$nextName = Join-Path -Path $dest -ChildPath $_.name
while(Test-Path -Path $nextName)
{
@susemeee
susemeee / hacker-ip.txt
Last active June 5, 2020 11:34
WordPress Hacker's IP address list
103.10.171.21
103.120.226.54
103.136.43.65
103.233.83.220
103.233.83.251
103.86.176.107
103.9.76.178
104.143.43.10
104.160.43.209
104.244.153.22