Skip to content

Instantly share code, notes, and snippets.

View utylee's full-sized avatar

utylee utylee

  • Raspi Association
  • London, GB
View GitHub Profile
@utylee
utylee / gist:eb6f0f076767872e276ec62d9a26e238
Created May 7, 2023 11:32
docker postgresql start command
docker run -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=sksmsqnwk11 -d -v ~/temp/docker_data/pgdata:/var/lib/postgresql/data -v ~/temp/docker_data/backup:/home/postgres -d postgres:14.7
docker update e5xxx --restart unless-stopped
@utylee
utylee / sudo root pyenv use python3 howto sudoer sudo visudo
Last active August 9, 2020 05:44
sudo root pyenv use python3 howto sudoer sudo visudo
add any necessary path (e.g., /app/pyenv/shims) to secure_path, and it will be passed to sudo commands.
Defaults secure_path = /app/pyenv/libexec:/app/pyenv/shims:/sbin:/bin:/usr/sbin:/usr/bin
more: define-path-environment-variable-sudo-commands
from: https://github.com/pyenv/pyenv/issues/79
for i in **/*flac;do ffmpeg -i "${i}" -c:a alac -vn "${i}";done
disk usage : df -h (-hs)
directory usage : du -h
du -h * ( 1 subdirectories )
@utylee
utylee / gist:afb173a5ea39eb5264ebf75c5fb95105
Created July 19, 2020 16:55
python datetime format timezone gmt utc kst correction
import datetime
#Sat, 18 Jul 2020 16:05:42 GMT
#fmt = '%a, %d %b %Y %H:%M:%S GMT'
fmt = '%d %b %Y %H:%M:%S'
dump_ts_str = datetime.datetime.strptime(server_time, fmt)
#dump_ts_str = time.strptime(server_time, fmt)
KST = datetime.timezone(datetime.timedelta(hours=9))
@utylee
utylee / git fork update
Created March 9, 2020 02:36
git fork update
git remote add upstream https://.../ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
git fetch upstream
git merge upstream/master
@utylee
utylee / git submodule update
Created March 8, 2020 03:22
git submodule update
git submodule update --remote --merge
for i in ./**/*flac;do ffmpeg -i "${i}" -vn -c:a alac "${i}.m4a";done
@utylee
utylee / gist:d5a956c15d18b74911712b467f0f82c0
Created March 6, 2020 12:26
ffmpeg subtitle extraction
ffmpeg -i "$i.mkv" -map 0:m:language:kor "$i.kor.srt"