Skip to content

Instantly share code, notes, and snippets.

View Myuzu's full-sized avatar
🌊
rolling

Ivan Bolhar Myuzu

🌊
rolling
  • Kyiv, Ukraine
View GitHub Profile
@Myuzu
Myuzu / commands.md
Last active August 15, 2018 13:49
Зручні запити для PostgreSQL

Створити дамп:

pg_dump -Fc --no-acl --no-owner -U myuser mydb > mydb.dump

Створити зашифрований дамп (FF000000 приклад ідентифікатора публічного ключа):

pg_dump -Fc --no-acl --no-owner -U myuser mydb | gpg --encrypt --recipient FF000000 --cipher-algo AES256 --output mydb.dump.gpz
@Myuzu
Myuzu / nginx.conf
Last active December 23, 2015 18:49
Postgres, Erlang та Ruby на Ubuntu 13.04.
# Розмістити в /etc/monit/conf.d/nginx.conf
check process nginx with pidfile /var/run/nginx.pid
group www-data
start program = "/etc/init.d/nginx start"
stop program = "/etc/init.d/nginx stop"
if failed host localhost port 80 protocol HTTP then restart
if cpu is greater than 95% for 16 cycles then restart
@Myuzu
Myuzu / secure_random.ex
Last active August 7, 2022 20:09
Elixir ruby-like SecureRandom
# UPD from 2018:
# This gist was written for pre-1.0 version of Elixir and won't work on post-1.0 versions.
# You probably consider using something else!
defmodule SecureRandom do
@moduledoc """
Ruby-like SecureRandom module.
## Examples
# $HOME/.gitconfig
[includeIf "gitdir:~/work/new_project_dir/"]
path = ~/work/new_project_dir/.gitconfig-new_project