Linux
-
Backing up your docker volumes
Backing up your docker volumes https://github.com/soiqualang/docker-backup-volume How to backup your volume backup-volume.sh will create a new running docker container and mount the volume to the container. A docker cp will be run and the contents of the volume will be saved into a location determined by: $prefix/$volume/<timestamp>_$volume.tar.gz An example to run the command is the following: backup-volume.sh -v <volume_name> -p <prefix> backup-volume.sh ```bash #!/usr/bin/env bash # creates a backup of the docker volume while [ $# -gt 0 ]; do case "$1" in -v|-volume|--volume) volume="$2" ;; -p|-prefix|--prefix) prefix="$2" ;; -h|-help|--help) printf "--volume the name of the volume\n" printf "--mount the mount point of the volume\n" exit 1 ;; *) printf "***************************\n" printf "*…
-
Awesome Docker Compose
Awesome Docker Compose Danh sách các Docker Compose phổ biến Just pull and run =)) https://github.com/docker/awesome-compose Awesome Compose A curated list of Docker Compose samples. These samples provide a starting point for how to integrate different services using a Compose file and to manage their deployment with Docker Compose. Note: The following samples are intended for use in local development environments such as project setups, tinkering with software stacks, etc. These samples must not be deployed in production environments. Contents Samples of Docker Compose applications with multiple integrated services. Single service samples. Basic setups for different platforms (not production ready - useful for personal use). Samples of Docker Compose applications…
-
wttr.in | Check weather in terminal
wttr.in | weather app for the terminal https://github.com/chubin/wttr.in wttr.in — the right way to ~check~ curl the weather! wttr.in is a console-oriented weather forecast service that supports various information representation methods like terminal-oriented ANSI-sequences for console HTTP clients (curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers. Originally started as a small project, a wrapper for wego, intended to demonstrate the power of the console-oriented services, wttr.in became a popular weather reporting service, handling tens millions of queries daily. You can see it running here: wttr.in. Documentation | Usage | One-line output | Data-rich output format | Map view | Output formats | Moon phases |…
-
[Rclone] Config rclone to support diffie-hellman-group-exchange-sha256 diffie-hellman-group-exchange-sha1
[Rclone] Config rclone to support diffie-hellman-group-exchange-sha256 diffie-hellman-group-exchange-sha1 Err info haugiang@hg-nn-web:/$ rclone mount backup_sftp:/NongNghiep/ /gdrive2/ --allow-non-empty 2022/05/25 03:09:25 Failed to create file system for "backup_sftp:/NongNghiep/": NewFs: couldn't connect SSH: ssh: handshake failed: ssh: no common algorithm for key exchange; client offered: [curve25519-sha256 curve25519-sha256@libssh.org ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 diffie-hellman-group14-sha256 diffie-hellman-group14-sha1 ext-info-c], server offered: [diffie-hellman-group-exchange-sha1 diffie-hellman-group1-sha1] Fix Config rclone to support diffie-hellman-group-exchange-sha256 diffie-hellman-group-exchange-sha1 We have managed to opt-in those algorithms support and submitted a PR here: https://github.com/ncw/rclone/pull/3341 Note: since those algorithms are considered insecure, your also need to use the exisiting rclone flag --sftp-use-insecure-cipher to make them available for SSH handshake. My Example run Ok rclone mount backup_sftp:/mnt/array1/NongNghiep/ /backup_drive/ --allow-non-empty --sftp-use-insecure-cipher https://stackoverflow.com/questions/56968274/config-rclone-to-support-diffie-hellman-group-exchange-sha256-diffie-hellman-gro
-
Cài Docker Compose trên Ubuntu (Linux)
Cài Docker Compose trên Ubuntu (Linux) Lỗi Unable to locate package docker-compose-plugin Ban đầu mình cài với lệnh sudo apt install docker-compose-plugin, tuy nhiên bị lỗi sau: Unable to locate package docker-compose-plugin haugiang@hg-nn-web:/nongnghiep/docker/postgresql$ sudo apt-get update Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB] Get:3 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Get:4 http://archive.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB] Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2,570 kB] Get:6 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [1,810 kB] Fetched 4,632 kB in 7s (667 kB/s) Reading package lists... Done haugiang@hg-nn-web:/nongnghiep/docker/postgresql$ sudo apt-get install docker-compose-plugin Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package docker-compose-plugin haugiang@hg-nn-web:/nongnghiep/docker/postgresql$ sudo apt install docker-compose-plugin…
-
[Install SSL Certificate into Linux] Installing Certificate PFX into Unbuntu Linux
[Install SSL Certificate into Linux] Installing Certificate PFX into Unbuntu Linux Export Private Key and Certificate from PFX file Export the Private Key openssl pkcs12 -in domain.com.pfx -nocerts -out domain.com.pem -nodes Export the Certificate openssl pkcs12 -in domain.com.pfx -nokeys -out domain.com.crt -nodes Update the certificate update-ca-certificates Config Vhost SSL <VirtualHost *:443> DocumentRoot "/abc/xyzdir/" ServerName domain.com ErrorLog "logs/domain.com-error.log" CustomLog "logs/domain.com-access.log" combined SSLEngine On SSLCertificateFile "/usr/local/share/ca-certificates/domain.com.crt" SSLCertificateKeyFile "/usr/local/share/ca-certificates/domain.com.pem" # SSLCertificateFile "/opt/lampp/etc/ssl.crt/server.crt" # SSLCertificateKeyFile "/opt/lampp/etc/ssl.key/server.key" <Directory "/abc/xyzdir/"> AllowOverride All # Order Allow,Deny Allow from all # --New way of doing it Require all granted </Directory> </VirtualHost> References https://helloitsliam.com/2016/03/30/installing-certificate-pfx-into-debian-linux/
-
rclone – Fatal error: failed to mount FUSE fs
rclone - Fatal error: failed to mount FUSE fs Error info 2022/05/10 04:07:15 mount helper error: fusermount: option allow_other only allowed if 'user_allow_other' is set in /etc/fuse.conf 2022/05/10 04:07:15 Fatal error: failed to mount FUSE fs: fusermount: exit status 1 Fix rclone - Fatal error: failed to mount FUSE fs Remove --allow-other option # Origin rclone mount ssh_dcsrv:/work/DEV/longdt/Server_Backup/ /gdrive/ --allow-other --allow-non-empty # Become rclone mount ssh_dcsrv:/work/DEV/longdt/Server_Backup/ /gdrive/ --allow-non-empty References https://forum.rclone.org/t/any-way-around-fusermount-option-allow-other-only-allowed-if-user-allow-other-is-set-in-etc-fuse-conf/20625
-
rclone – couldn’t connect ssh: ssh: must specify HostKeyCallback
rclone - couldn't connect ssh: ssh: must specify HostKeyCallback Error info Fix rclone - couldn't connect ssh: ssh: must specify HostKeyCallback https://github.com/rclone/rclone/issues/3557#issuecomment-533618145 sudo curl https://rclone.org/install.sh | sudo bash References https://rclone.org/downloads/ https://github.com/rclone/rclone/issues/3557#issuecomment-533618145
-
Fix curl unable to establish ssl connection
Fix curl unable to establish ssl connection Sửa lỗi unable to establish ssl connection khi wget hay curl Fix unable to establish ssl connection Để sửa lỗi này thì chạy lệnh sau: /usr/sbin/update-ca-certificates --fresh Tham khảo https://www.linuxquestions.org/questions/slackware-14/wget-unable-to-establish-ssl-connection-while-downloading-libreoffice-from-slackbuild-4175642143/
-
Fix The repository … no longer has a Release file
Fix The repository ... no longer has a Release file? Run follow command apt-get dist-upgrade
-
Cài SSH Server và fix lỗi SSH Permission denied, please try again
Cài SSH Server và fix lỗi SSH Permission denied, please try again. Cài SSH Client và SSH Server Cài SSH Client sudo apt-get update sudo apt-get upgrade sudo apt-get install openssh-client Cài SSH Server sudo apt-get update sudo apt-get upgrade sudo apt install openssh-server Start SSH Server Theo hướng dẫn của người ta thì là vầy Open your terminal application Install the openssh-server package on Ubuntu, run: **sudo apt install openssh-server** Enable ssh server on Ubuntu, run: **sudo systemctl enable ssh** By default, firewall will block ssh access. Therefore, you must enable ufw and open ssh port Open ssh tcp port 22 using ufw firewall, run: **sudo ufw allow ssh** Congratulations. Now you have SSH…
-
[Sưu tầm] Auto Start LAMPP (XAMPP) at Startup in Ubuntu Linux
Hướng dẫn chỉnh tự động bật LAMPP khi khởi động Server Linux Creating a script to start XAMPP automatically in Ubuntu 18.04 or later Tạo file services để khởi động LAMPP, ở đây tui dùng vim để edit, bạn có thể dùng nano hay gì tùy sở thích của bạn =)) vim /etc/systemd/system/xampp.service Chép nội dung sau vào [Unit] Description=XAMPP [Service] ExecStart=/opt/lampp/lampp start ExecStop=/opt/lampp/lampp stop Type=forking [Install] WantedBy=multi-user.target Xong thì lưu lại và thoát thôi Instruct Ubuntu to execute LAMPP service at the startup systemctl enable xampp.service Sau khi xong thì khởi động lại máy thử, trong trường hợp của mình thì khởi động lại vẫn không được :') Mình…
-
Docker Export và Import Container
Docker Export và Import Container Docker liệt kê các container docker container ls Docker export container # Tạo một bản backup images từ container hiện tại docker commit -p 99a148f1a272 my_backup # Export container mình muốn (dùng id) docker save -o my_backup.tar my_backup Docker Import/Load Container # Restore docker load -i ~/my_backup.tar Tham khảo https://www.geeksforgeeks.org/backing-up-a-docker-container/ https://www.geeksforgeeks.org/restoring-a-docker-container/
-
[Sưu tầm] Cách cài đặt PrettyMaps
-
How to kill a process running on particular port in Linux?