Install the OpenSSL on Debian based systems
sudo apt-get install openssl
### ----------------------------------------------------------- | |
### THE NGINX ULTIMATE BAD BOT, BAD IP AND BAD REFERRER BLOCKER | |
### ----------------------------------------------------------- | |
### VERSION INFORMATION # | |
################################################### | |
### Version: V4.2021.06.2380 | |
### Updated: Tue Jun 15 09:09:44 SAST 2021 | |
### Bad Referrer Count: 7062 | |
### Bad Bot Count: 615 |
annotations: | |
nginx.ingress.kubernetes.io/ssl-passthrough: 'true' | |
nginx.ingress.kubernetes.io/backend-protocol: 'HTTPS' |
Địa chỉ file cấu hình: | |
/etc/nginx/passthrough.conf | |
``` | |
stream { | |
upstream nginxlb { | |
server IP1:PORT1 max_fails=3 fail_timeout=10s; # đổi IP PORT | |
server IP2:PORT2 max_fails=3 fail_timeout=10s; # đổi IP PORT | |
} |
# best practice: linux | |
nano ~/.pgpass | |
*:5432:*:username:password | |
chmod 0600 ~/.pgpass | |
# best practice: windows | |
edit %APPDATA%\postgresql\pgpass.conf | |
*:5432:*:username:password | |
# linux |
To add a SFTP-only user, you'll need to make sure your SSH config settings are correct, add a new user/group and set permissions for your new user. For step-by-step directions, see below. Omit sudo
if you're logged in as root.
Edit /etc/ssh/sshd_config
and make sure to add the following at the end of the file:
Match group filetransfer
ChrootDirectory %h
# | |
# CORS header support | |
# | |
# One way to use this is by placing it into a file called "cors_support" | |
# under your Nginx configuration directory and placing the following | |
# statement inside your **location** block(s): | |
# | |
# include cors_support; | |
# | |
# As of Nginx 1.7.5, add_header supports an "always" parameter which |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": [ | |
"logs:*" | |
], | |
"Effect": "Allow", | |
"Resource": "*" | |
} |
Override the entrypoint in docker-compose.yml for the MariaDB Docker container by adding:
entrypoint: mysqld_safe --skip-grant-tables --user=mysql
The start up the Docker Compose stack:
$> docker-compose up -d
Then login to the Docker container:
I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service
. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.
Overall, it's a fairly simple process consisting of the following few steps.
Open the service file with $ sudo vi /lib/systemd/system/{name}.service
Modify the [Service]
section: