Skip to content

Instantly share code, notes, and snippets.

View rtplv's full-sized avatar
💢

Ruslan Tupolev rtplv

💢
View GitHub Profile
@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
@rtplv
rtplv / php.md
Last active October 8, 2019 10:43
PHP env install guide

Установка PHP:

sudo add-apt-repository -y ppa:ondrej/php
sudo apt update
sudo apt install php7.3

Установка важных расширений необходимых для пакетов Composer:

@rtplv
rtplv / docker-compose.yml
Last active February 16, 2023 07:43
Небольшая шпаргалка для работы с Docker
version: '3.7'
services:
postgres:
build: ./postgres
restart: always
environment:
POSTGRES_PASSWORD: 12345
volumes:
- ./postgres/data:/var/lib/postgresql/data
@rtplv
rtplv / windows_soft.md
Last active August 19, 2019 09:31
Нужный софт для работы на винде (но лучше не надо - правда)