Skip to content

Instantly share code, notes, and snippets.

View yuswitayudi's full-sized avatar
🎯
Listening port . . . . .

Yudi Tata yuswitayudi

🎯
Listening port . . . . .
View GitHub Profile
@yuswitayudi
yuswitayudi / mysql-docker.sh
Created July 7, 2021 09:31 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@yuswitayudi
yuswitayudi / backup_collection_mongo.sh
Created March 3, 2020 07:23 — forked from dungmanh88/backup_collection_mongo.sh
Dump multiple collections of a db in mongodb
#!/bin/bash
db=<db>
collection_list="<collection1> <collection2> <collection3>"
host=127.0.0.1
port=<port>
out_prefix=/Temp
for collection in $collection_list; do
echo $collection
out_dir="${out_prefix}/${db}_${collection}/"
@yuswitayudi
yuswitayudi / bash
Created January 30, 2020 09:06 — forked from panchicore/bash
solve perl: warning: Setting locale failed.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~