Skip to content

Instantly share code, notes, and snippets.

View linuxkathirvel's full-sized avatar

Kathirvel Rajendran linuxkathirvel

View GitHub Profile
@linuxkathirvel
linuxkathirvel / disable-pdf-open-automatically-in-chrome.md
Last active April 21, 2021 04:26
How to disable PDF file opening in Chrome browser automatically?

How to disable PDF file opening in Chrome browser automatically?

Chrome Version: Version 90.0.4430.85 (Official Build) (64-bit)

Goto Settings->Privacy and Security->Site Settings->Additional Conent Settings->PDF Documents enable Download PDF files instead of automatically opening them in Chrome

@linuxkathirvel
linuxkathirvel / fedora-upgrade.md
Last active January 16, 2021 04:19
How to upgrade Fedora?

How to upgrade Fedora?

sudo dnf install dnf-plugin-system-upgrade
# Reboot the system after the above command completed.
sudo dnf system-upgrade download --refresh --releasever=33
sudo dnf system-upgrade reboot

# You can remove cached packages by executing 'dnf clean packages'
@linuxkathirvel
linuxkathirvel / fix-domain-name-provided-is-not-valid-according-to-RFC-1034_1035.md
Last active March 31, 2023 06:35
How to fix "DisallowedHost at / Invalid HTTP_HOST header:. The domain name provided is not valid according to RFC 1034/1035." error in Django?

How to fix "DisallowedHost at / Invalid HTTP_HOST header:. The domain name provided is not valid according to RFC 1034/1035." error in Django?

Solution

  • Don't add include proxy_params; in Django application's NGINX configuration file.
  • Cross-check the Django application's NGINX configuration. If include proxy_params; line added, remove it.
  • proxy_params(/etc/nginx/proxy_params) file have proxy_set_header Host $http_host; line already. It will override proxy_set_header Host $host;

Related notes

  1. Security configurations in Django while deploying on production
  2. How to fix ERR_TOO_MANY_REDIRECTS issue in Django+Gunicorn+NGINX?

References

@linuxkathirvel
linuxkathirvel / reduce-image-size-in-linux.md
Created December 16, 2020 17:05
Reduce image size in linux

Reduce image size in linux

convert source-image.jpg -quality 70% converted-image.jpg
@linuxkathirvel
linuxkathirvel / logrotate-parent-directory-has-insecure-permissions.md
Created December 7, 2020 08:00
error: skipping "/var/mail/kathirvel" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

error: skipping "/var/mail/kathirvel" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

Solution

For example: if you are going to configure the logrotate to /var/mail/kathirvel file, it will have the permissions like owner=kathirvel, group=mail. We should mention 'su username groupname' to non-root user's file. The configuration will be like below

/var/mail/kathirvel
{
        rotate 3
        su kathirvel mail
        maxsize 1M
 missingok
@linuxkathirvel
linuxkathirvel / how-to-execute-logrotate-every-hour.md
Last active December 7, 2020 07:36
How to execute logrotate every hour?

How to execute logrotate every hour?

The 'time based'(hourly, daily, weekly, monthly) and 'size' baesd execution frequencies are available in the logrotate.. Logrotate is configurated to run daily default. There is no option to run logrotate like every 5 minutes, 30 minutes. We can configure logrotate to like every 5 minutes, 30 minutes using manualy crontab entry.

Logrotate configuration file of /etc/logrotate.d/rsyslog

/var/log/syslog
{
        rotate 3
        maxsize 5M
@linuxkathirvel
linuxkathirvel / create-a-file-with-specific-size-in-linux.md
Last active November 30, 2020 13:10
How can I create a file with a specific size from a command line?
@linuxkathirvel
linuxkathirvel / memory-usage.md
Created November 30, 2020 10:10
How to Check Memory Usage Per Process on Linux?

How to Check Memory Usage Per Process on Linux?

ps -o pid,user,%mem,command ax | sort -b -k3 -r
@linuxkathirvel
linuxkathirvel / openvpn-connection-in-kde-plasma.md
Last active February 3, 2024 09:24
How to create OpenVPN connection in KDE Plasma using NetworkManager GUI with .ovpn file?

How to create OpenVPN connection in KDE Plasma using NetworkManager GUI with .ovpn file?

2020-11-18_13-59 2020-11-18_14-05 2020-11-18_21-45 2020-11-20_09-24 2020-11-18_21-48 2020-11-20_09-08 2020-11-20_09-10