Skip to content

Instantly share code, notes, and snippets.

View buithehoa's full-sized avatar
🐢
Moving slowly ...

Bùi Thế Hòa buithehoa

🐢
Moving slowly ...
View GitHub Profile
sudo systemctl start/stop postgresql@<version>-<cluster>
rsync -az --info=progress2 /source/folder /destination
select * from some_table \x\g\x
@buithehoa
buithehoa / extract-a-tgz-file
Last active September 21, 2018 10:26
Extract a .tgz file
tar -xvzf /path/to/file.tgz
select count(*) from information_schema.tables where table_schema = database();
.sub('-', ' ').gsub(/[\:\[\]\"\'-.#]/, '').gsub(/[\/(\s)]+/, '-').downcase
find . -maxdepth 1 -type f \( -iname '1[6-9]*flac' -o -iname '2[0-9]*.flac' \) -exec rsync -az --info=progress2 {} /somewhere/out/there \;
docker logs --tail 10 docker_container_name_or_id
git log --pretty=oneline | grep 'comment text' | cut -d ' ' -f1 | xargs -n1 git revert --no-edit
mysqldump -u <username> -h <host> --password <database> > <file_name>.sql