Tác giả: khoinv.kpwzto
-
Moving server with docker, rsync
sudo docker ps #Show container id #chat service sudo docker exec -i {CONTAINER_ID} /usr/bin/mongodump –uri “mongodb://” –archive > /mnt/storage/mongodb.dump sudo docker exec -i {CONTAINER_ID} /usr/bin/mongorestore –uri “mongodb://” –archive –drop < /mnt/storage/mongodb.dump #database sudo docker exec -i {CONTAINER_ID} mysql -uhanda -p{PASSWORD} handa < /mnt/storage/database.sql #storage log sudo rsync -avh target_server:/var/www/storage/ /mnt/storage/
-
Increasing fs.inotify.max_user_watches for Docker images
Increasing fs.inotify.max_user_watches for Docker images TL;DR You can’t set those for an image during build time becasue Docker takes the sysctl configuration from the Host. So, set the config on your host machine. As in this link, to increase the maximum watchers, we need set fs.inotify.max_user_watches to a higher number in /etc/sysctl.conf. $ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf $ sudo sysctl -p So,…
-
mongodb dump – restore docker
Dump: sudo docker exec -i <container_name> /usr/bin/mongodump –uri “mongodb://” –archive > /mnt/storage/mongodb.dump Restore sudo docker exec -i <container_name> /usr/bin/mongorestore –uri “mongodb://” –archive < /mnt/storage/mongodb.dump
-
“ModuleNotFoundError: No module named ‘django’ in Python”
ModuleNotFoundError: No module named ‘django’ in Python # 👇️ in a virtual environment or using Python 2 pip install Django # 👇️ for python 3 (could also be pip3.10 depending on your version) pip3 install Django # 👇️ if you get permissions error sudo pip3 install Django pip install Django –user # 👇️ if you…
-
user sudo without password – root
Access root user. visudo tom ALL=(ALL) NOPASSWD:ALL
-
Mongo exit code
sudo rm -rf /tmp/mongodb-27017.sock sudo service mongod start
-
Policy in rails
Tìm hiểu Policy Objects trong Ruby on Rails Bài đăng này đã không được cập nhật trong 4 năm Đặt vấn đề Giả sử chúng ta có 1 ứng dụng đơn giản với 3 phân quyền như sau regular user: có thể xem được các dữ liệu public của clients moderator: có thể chỉnh sửa…
-
Nginx fopen crt ssl https setenforce permissive 403
restorecon /etc/nginx/ssl/bundle.crt Nếu bị permission deny file setenforce permissive
-
Lỗi Unresolvable dependency resolving [Parameter #0 [
$app ]] in class Illuminate\Support\ServiceProvider Unresolvable dependency resolving [Parameter #0 [ <required> $app ]] in class Illuminate\Support\ServiceProvider Cần fill construct cho container class UserService extends WebService { /** * userRepository * * @var UserRepository */ protected$userRepository; publicfunction__construct(UserRepository$userRepository) { $this->userRepository=$userRepository; } }