Skip to content

Instantly share code, notes, and snippets.

View iRingil's full-sized avatar

Ringil iRingil

View GitHub Profile
@iRingil
iRingil / Nextcloud login loop error after Oracle Linux (Centos) system update
Last active September 24, 2025 04:09
Nextcloud login loop error after Oracle Linux (Centos) system update
chown nginx:nginx /var/lib/php/session/
chown root:nginx /var/lib/php/wsdlcache/
chown root:nginx /var/lib/php/opcache/

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

@iRingil
iRingil / Grafana Alert Template.md
Created August 15, 2024 10:09 — forked from gelldur/Grafana Alert Template.md
How to use Grafana Alerts with the Telegram
  • Template name: telegram.message
  • Content:
    {{- /* Telegram message to use: {{ template "telegram.message2" . }} */ -}}
    {{ define "__alerts_list" -}}
    {{ range . }}
    {{if ne (index .Labels "alertname") "" -}}
    {{ if eq .Status "firing" }}🔴{{ else }}🟢{{ end }}
        {{- if ne (index .Labels "severity") "" -}}
            <u><b>P{{ index .Labels "severity" }}</b></u> {{ end -}}
@iRingil
iRingil / django-postgresql-15.md
Last active November 3, 2025 15:15 — forked from axelbdt/django-postgresql-15.md
# Django and PostgreSQL 15, the rules have changed

Django and PostgreSQL 15, the rules have changed

Postgres 15 is just out, and while there is a lot to love about this new release, you're in for a surprise if you try to set it up with Django following tutorials like this one.

The reason is stated in the release announcement:

Remove PUBLIC creation permission on the public schema (Noah Misch) The new default is one of the secure schema usage patterns that Section 5.9.6 has recommended...

Provided your web app doesn't access your database as a superuser (it shouldn't) and uses a dedicated user, it is not allowed to use the public schema anymore. You have to create one for this specific user, and the next section will

@iRingil
iRingil / install_python.sh
Last active November 3, 2025 18:29
Installing Python 3.13.9 on Debian 13
#!/bin/bash
# 1. Checking rights
if [ "$EUID" -ne 0 ]; then
echo "This script must be run with sudo or as root."
exit 1
fi
# 2. Install ALL necessary dependencies for compilation
apt-get update
@iRingil
iRingil / install_prometheus_node_exporter.sh
Last active July 3, 2023 11:54
Installing Prometheus Node Exporter on Centos Stream 9 / Oracle Linux 9 (arm64)
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "This script must be run with sudo rights."
exit 1
fi
groupadd -f node_exporter
useradd -g node_exporter --no-create-home --shell /bin/false node_exporter
mkdir /etc/node_exporter
@iRingil
iRingil / install_prometheus.sh
Last active July 2, 2023 18:24
Installing Prometheus on Centos Stream 9 / Oracle Linux 9 (arm64)
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "This script must be run with sudo rights."
exit 1
fi
groupadd --system prometheus
useradd -s /sbin/nologin --system -g prometheus prometheus
mkdir /var/lib/prometheus
@iRingil
iRingil / delete_files_by_mask.sh
Last active July 2, 2023 04:58
Search and delete all files by mask on Linux
#!/bin/bash
read -p "Enter a filename pattern to search for and delete: " filename_pattern
sudo find / -name "$filename_pattern" -exec rm -rf {} \;