Skip to content

Instantly share code, notes, and snippets.

DROP SCHEMA public CASCADE;
CREATE SCHEMA public;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO public;
@sungmin-park
sungmin-park / show-context.sh
Last active May 8, 2023 15:02
docker show context
#!/bin/sh -e
docker build --tag show-docker-files --file - . <<EOF
FROM ubuntu
RUN apt-get update && apt-get install -y ncdu
COPY . /build-context
EOF
docker run -it --rm show-docker-files ncdu /build-context
#!/bin/sh -e
if [ $# -eq 0 ] ; then
echo "usage> $0 [movie files] ..." >&2
exit 1
fi
for TARGET in "$@"
do
RESULT=${TARGET%.*}.png
ffmpeg -i "$TARGET" -vframes 1 "$RESULT"
@sungmin-park
sungmin-park / android-generate-keystores.md
Created May 28, 2021 01:28 — forked from henriquemenezes/android-generate-keystores.md
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"
#!/bin/sh -e
sed -i.bak \
-e 's/DEFINER=[^ ]* / /' \
-e 's/SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;/ /' \
-e 's/SET @@SESSION.SQL_LOG_BIN= 0;/ /' \
-e 's/SET @@GLOBAL.GTID_PURGED='';/ /' \
-e 's/SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;/ /' "$1"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=hex(b):01,00,00,00,00,00,00,00
@sungmin-park
sungmin-park / load_submodules.py
Created December 7, 2018 06:11
import flask blueprints
import pkgutil
import sys
def load_submodules(module) -> None:
for finder, name, is_pkg in pkgutil.iter_modules(module.__path__):
module_name = f"{module.__name__}.{name}"
if module_name not in sys.modules:
module = finder.find_module(module_name).load_module()
print(f" * import {module.__name__} - Ok")
#!/bin/sh
if [ -z "$1" ]
then
echo "usage> $0 DATABASE" >&2
exit 1
fi
# Cannot use pipe. Pipe produces an empty backup file when pg_dump has errors.
FILE_NAME="$1-`date +"%Y%m%d-%H%M%S"`.sql"
#!/bin/sh
if [ "$#" -ne 3 ]; then
echo "Usage: $0 host id pass"
exit 1
fi
openssl s_client -connect $1:993 -quiet << EOF
a1 LOGIN $2 $3
a5 LOGOUT
EOF