Skip to content

Instantly share code, notes, and snippets.

View linuxkathirvel's full-sized avatar

Kathirvel Rajendran linuxkathirvel

View GitHub Profile
@linuxkathirvel
linuxkathirvel / flameshot-filename-automatically.md
Last active May 16, 2021 16:28
How to set filename automatically in Flameshot on Fedora 34 Workstation Gnome 40?

How to set filename automatically in Flameshot on Fedora 34 Workstation Gnome 40?

16_05_2021_21_57_1621182427

# Capture a region using the GUI, and have it automatically saved to your pictures folder when clicking the save button in GUI
flameshot gui -p /home/user/Pictures

References

https://flameshot.org/key-bindings/

@linuxkathirvel
linuxkathirvel / add-append-the-current-query-string-to-an-URL-in-a-django-template.md
Created May 12, 2021 03:20
How to add/append the current query string to an URL in a Django template?
@linuxkathirvel
linuxkathirvel / how-to-solve-mssql-ODBC-ssl-routine-ssl-choose-client_version-unsupported-protocol.md
Last active May 11, 2021 14:10
pyodbc.OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol] (-1) (SQLDriverConnect)')

How to solve pyodbc.OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [error:1425F102:SSL routines:ssl_choose_client_version:unsupported protocol] (-1) (SQLDriverConnect)') error?

This error due to openssl.

Steps

Open /etc/ssl/openssl.cnf and update these lines
[system_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT@SECLEVEL=1
@linuxkathirvel
linuxkathirvel / more-than-one-DNS-IPs-in-fedora-34.md
Last active May 11, 2021 00:21
How to assign more than one DNS IPs in Fedora 34 for OpenVPN connection?

How to assign more than one DNS IPs in Fedora 34 for OpenVPN connection?

Open /etc/systemd/resolved.conf file

sudo vim /etc/systemd/resolved.conf

Add DNS IPs with space separated. DNS variable will be commented default. We should uncomment it to enable

DNS=208.67.222.222 208.67.220.220

Save the file

@linuxkathirvel
linuxkathirvel / django-postgresql-debian-setup.md
Last active May 6, 2021 16:33
Django + PostgreSQL + Debian Setup

Django + PostgreSQL + Debian Setup

Install needed packages

sudo apt update -y
sudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl virtualenv redis-server sudo vim vim-nox htop tmux git -y

Restore PostgreSQL DB

sudo -iu postgres
psql -U django_user django_project_db < django_db_backup.psql
@linuxkathirvel
linuxkathirvel / network-default-is-not-active.md
Created May 5, 2021 12:19
How solve libvirt.libvirtError: Requested operation is not valid: network 'default' is not active?

How solve libvirt.libvirtError: Requested operation is not valid: network 'default' is not active?

virsh net-list --all
virsh net-autostart default
virsh net-start default
virsh net-list --all
@linuxkathirvel
linuxkathirvel / how-to-install-pyodbc-in-ubuntu.md
Last active October 12, 2022 20:30
How to install Pyodbc in Ubuntu?

These steps for Ubuntu 16.04 LTS

How to install Pyodbc in Ubuntu?

sudo apt-get install unixodbc-dev
pip install pyodbc

Install ODBC Driver for SQL Server

If the system have not ODBC driver, you will get below error.

pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)")
@linuxkathirvel
linuxkathirvel / custom-unique-error-message-to-django-model-form.md
Last active April 21, 2021 17:03
Custom unique error message to Django model form for already exists error

Custom unique error message to Django model form for already exists error

# forms.py
class Meta:
  error_messages = {
    'mobile': {
      'unique': _("Mobile number already exists."),
    },
    'email': {
 'unique': _("Email already exists."),
@linuxkathirvel
linuxkathirvel / but-it-only-supports-http-in-django.md
Last active July 27, 2023 10:16
How to fix "You're accessing the development server over HTTPS, but it only supports HTTP." in Django?

How to fix "You're accessing the development server over HTTPS, but it only supports HTTP." in Django?

Check the Django's site URL. It may have https.

Disable following variables in settings.py or .env

SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SECURE_SSL_REDIRECT = True