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
#!/bin/bash
sudo apt update
sudo apt install wget curl -y
wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt update
sudo apt install -y mongodb-org
@yuswitayudi
yuswitayudi / Running python with uwsgi module
Last active March 22, 2021 11:27
Example config uwsgi python with nginx
uwsgi -s :3017 --module run --callable app --enable-threads --processes 1
@yuswitayudi
yuswitayudi / RabbitMq monit
Created October 6, 2020 03:42
Monit config for RabbitMq service
check PROCESS rabbitmq with MATCHING rabbitmq
if failed port 5672 type tcp then restart
if changed pid then alert
start program = "/etc/init.d/rabbitmq-server start"
stop program = "/etc/init.d/rabbitmq-server stop"
[program:app_name]
directory=/home/user/path-app/
command=/home/user/path-app/app
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/supervisor/app_name/app_name.out.log
stdout_logfile=/var/log/supervisor/app_name/app_name.err.log
user=user
@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").
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~