Skip to content

Instantly share code, notes, and snippets.

View barbietunnie's full-sized avatar

Babatunde Adeyemi barbietunnie

View GitHub Profile
@barbietunnie
barbietunnie / create-read-only-postgres-user.md
Created September 27, 2023 14:49
How to create a read-only PostgreSQL user
View create-read-only-postgres-user.md
@barbietunnie
barbietunnie / git-permission-error.md
Created September 19, 2023 09:21
How to resolve git error: `Unable to append to .git/logs/refs/remotes/origin/master: Permission denied`
View git-permission-error.md
@barbietunnie
barbietunnie / redis-misconf-error.md
Created September 6, 2023 17:35
How to resolve MISCONF Redis is configured to save RDB snapshots error
View redis-misconf-error.md

How to resolve MISCONF Redis is configured to save RDB snapshots error

The error "MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error" occurs when Redis tries to save the database in the background but fails.

One of the scenarios where it's known to happen is when redis was recently upgraded by homebrew.

To resolve the issue, ssimply restart your redis instance:

View tmux-cheatsheet.markdown
@barbietunnie
barbietunnie / ansible-variable-precedence.md
Last active March 19, 2023 20:25
Ansible Variable Precedence
View ansible-variable-precedence.md

Ansible Variable Precedence

Here is the order of precedence from least to greatest (the last listed variables override all other variables):

  1. command line values (for example, -u my_user, these are not variables)
  2. role defaults (defined in role/defaults/main.yml) [1]
  3. inventory file or script group vars [2]
  4. inventory group_vars/all [3]
  5. playbook group_vars/all [3]
  6. inventory group_vars/* [3]
@barbietunnie
barbietunnie / config.py
Last active December 7, 2022 00:11
Working with relative paths in Python
View config.py
import os
ROOT_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
@barbietunnie
barbietunnie / nginx-headers-underscore.md
Created December 6, 2022 04:10
How to fix – NGINX not accepting headers with underscore
View nginx-headers-underscore.md

How to fix – Nginx not accepting headers with underscore

Although headers with underscore are perfectly valid according to HTTP standards, however NGINX does not support it by default. To enable NGINX to accept headers with underscore, add the following directive within the server block of your NGINX configuration.

underscores_in_headers on;

Validate and reload the configuration after making this change as follows:

@barbietunnie
barbietunnie / user-group-daemon.md
Created December 6, 2022 02:43
How to determine the user and group of a daemon in Ubuntu
View user-group-daemon.md
@barbietunnie
barbietunnie / django-secret-key.py
Created December 5, 2022 04:06
How to generate a Django `SECRET_KEY`
View django-secret-key.py
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
@barbietunnie
barbietunnie / file-contents-dump-ansible.md
Created November 25, 2022 12:09
How to dump file contents to console with Ansible
View file-contents-dump-ansible.md