Script for Nginx/Openresty to restore up-to-date source IP addresses of visitors from Cloudflare
Set params like NGINX_BIN_PATH
and CLOUDFLARE_CONFIG_PATH
echo "NGINX_BIN_PATH=/usr/bin/openresty" > /etc/cloudflare-real-ip-update.env
init_worker_by_lua_block { | |
prometheus = require("prometheus").init("prometheus_metrics") | |
metric_requests = prometheus:counter( | |
"nginx_http_requests_total", | |
"Number of HTTP requests", | |
{"host", "status"} | |
) | |
metric_latency = prometheus:histogram( | |
"nginx_http_request_duration_seconds", |
This DayZ Watchdog script to check server availability
With the release of DayZ 1.24, a server for Linux appeared, this is undoubtedly very cool, but the implementation was in an experimental state for a very long time, which is why some problems crop up when trying to run modified community servers.
At the time of writing, there was a problem with the scheduled restart of the modified server based on an event from messages.xml
. Details at https://feedback.bistudio.com/T179734
Important
These are instructions for a non-system user; for a root user you can adapt them yourself if necessary
#!/usr/bin/env bash | |
# Download telegram stickers and convert to PNG/GIF | |
# | |
# Dependecies: | |
# - jq, curl | |
# - https://www.ffmpeg.org/ | |
# - https://pngquant.org/ | |
# - http://www.lcdf.org/gifsicle/ | |
# - https://github.com/ed-asriyan/lottie-converter |
#!/usr/bin/env bash | |
# GitLab API Pagination | |
# Fetches paginated data from GitLab API using curl and jq | |
# | |
# Usage: | |
# - export SOURCE_GITLAB_URL, SOURCE_GITLAB_TOKEN for first GitLab instance | |
# - export TARGET_GITLAB_URL, TARGET_GITLAB_TOKEN for second GitLab instance | |
# - use api::src <path> [args] or api::dst <path> [args] to work with GitLab API | |
# |
#!/usr/bin/env bash | |
set -euo pipefail | |
# Mirrors repositories with groups while maintaining nesting | |
# between two GitLab instances | |
# | |
# Limited to 100 groups/repositories per request, | |
# if you need more, you need to update this script! | |
# As an example of pagination implementation | |
# https://gist.github.com/WoozyMasta/03c4c532669f43dca0de11087f24d077 |
#!/usr/bin/env bash | |
set -euo pipefail | |
# Recursive change GitLab projects feature visibility settings | |
: "${GITLAB_HOST:?}" | |
: "${GITLAB_TOKEN:?}" | |
: "${GITLAB_GROUP_ID:?}" | |
gitlab() { |