Skip to content

Instantly share code, notes, and snippets.

View rtplv's full-sized avatar
💢

Ruslan Tupolev rtplv

💢
View GitHub Profile
@rtplv
rtplv / authenticator.sh
Created September 30, 2025 05:41 — forked from 1vank1n/authenticator.sh
Certbot + Yandex.DNS (Яндекс Коннект). Manual validation hooks. Analogue https://eff-certbot.readthedocs.io/en/stable/using.html#pre-and-post-validation-hooks
#!/bin/bash
# Get your TOKEN https://yandex.ru/dev/api360/doc/concepts/access.html
# Need access level for app "directory:manage_dns"
YANDEX_TOKEN="<paste your yandex token>"
ORG_ID="<paste your org id>"
# Strip only the top domain to get the zone id
DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)')
SUBDOMAIN=$(expr match "$CERTBOT_DOMAIN" '\(.*\)\..*\..*')
@rtplv
rtplv / ansible-github.yml
Created September 15, 2025 10:24 — forked from jvanderaa/ansible-github.yml
Example playbook for cloning a private git repository with Ansible.
---
hosts: all
tasks:
- name: add github ssh key
copy: >
src=files/id_rsa.github
dest=/root/.ssh/id_rsa.github
owner=root
group=root
@rtplv
rtplv / daemon.json
Created June 24, 2025 09:53 — forked from b4tman/daemon.json
docker registry mirrors (/etc/docker/daemon.json) + podman (/etc/containers/registries.conf)
{
"registry-mirrors" : [
"https://cr.yandex/mirror",
"https://dockerhub.timeweb.cloud",
"https://huecker.io",
"https://noohub.ru",
"https://dcr-px.ru",
"https://mirror.gcr.io",
"https://quay.io",
"https://registry.access.redhat.com",
@rtplv
rtplv / jwtRS256.sh
Created November 11, 2021 16:31 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@rtplv
rtplv / redis-autostart-osx.md
Created October 30, 2020 18:09 — forked from subfuzion/redis-autostart-osx.md
redis auto start OS X

Install with Homebrew

brew install redis

Set up launchctl to auto start redis

$ ln -sfv /usr/local/opt/redis/*.plist ~/Library/LaunchAgents

/usr/local/opt/redis/ is a symlink to /usr/local/Cellar/redis/x.y.z (e.g., 2.8.7)

@rtplv
rtplv / curl.md
Created August 28, 2020 09:28 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@rtplv
rtplv / laravel_pg_array.md
Created August 4, 2020 22:00
Postgres array, Laravel workaround
/**
 * Превращает массив PHP, в массив Postgres
 * @param array $pgArray
 * @return Expression
 */
static function createPgArray(array $pgArray): Expression
{
    $pgArray = json_encode($pgArray, JSON_UNESCAPED_UNICODE);
 $pgArray = "'".preg_replace("#^\[(.*)\]$#", '{\1}', $pgArray)."'";
@rtplv
rtplv / change_id_column
Created July 5, 2020 11:45 — forked from scaryguy/change_id_column
How to reset ID column of a PostgreSQL table to let auto incrementation begin from 1?
# See your sequence name inside psql console with \ds command.
ALTER SEQUENCE seq RESTART WITH 1;
# Update sequence
UPDATE table_name SET id=nextval('seq');
@rtplv
rtplv / git-bash-in-webstorm.md
Created March 10, 2020 11:51 — forked from sadikaya/git-bash-in-webstorm.md
git bash inside Webstorm terminal

Go to File -> Settings -> Tools -> Terminal and change Shell path based on the the installed git version.

for 64bit:

"C:\Program Files\Git\bin\sh.exe" --login -i

for 32bit:

"C:\Program Files (x86)\Git\bin\sh.exe" --login -i