Skip to content

Instantly share code, notes, and snippets.

View shmdt's full-sized avatar
💭
🇺🇦

Kovalenko Anton shmdt

💭
🇺🇦
View GitHub Profile
@shmdt
shmdt / database.yml.example mysql2
Created April 11, 2017 09:35 — forked from erichurst/database.yml.example mysql2
Rails 3 database.yml examples
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
upstream puma_<%= fetch(:nginx_config_name) %> { <%
flags = 'fail_timeout=0'
@backends = [fetch(:puma_bind)].flatten.map do |m|
etype, address = /(tcp|unix|ssl):\/{1,2}(.+)/.match(m).captures
if etype =='unix'
"server #{etype}:#{address} #{fetch(:nginx_socket_flags)};"
else
"server #{address.gsub(/0\.0\.0\.0(.+)/, "127.0.0.1\\1")} #{fetch(:nginx_http_flags)};"
end
end
@shmdt
shmdt / 1 Gist conventions
Created March 24, 2017 07:49 — forked from PavloBezpalov/1 Gist conventions
Deploy Rails 5.0.0.beta3 to VPS(Ubuntu 14.04.4 LTS). Nginx, Puma, Capistrano3, PostgreSQL, RVM.
<<APP>> change this variables
@shmdt
shmdt / pg_hba.conf
Last active March 24, 2017 07:43 — forked from slenderock/pg_hba.conf
# ubuntu: sudo nano /etc/postgresql/<< version >>/main/pg_hba.conf
# Позволяет любому пользователю локальной системы подключиться
# к любой базе данных, используя любое имя базы данных через
# доменные сокеты Unix (по умолчанию для локальных подключений).
#
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
# То же, но для локальных замкнутых подключений по TCP/IP.
@shmdt
shmdt / install_postgis_osx.sh
Created February 7, 2017 15:55 — forked from juniorz/install_postgis_osx.sh
Installing PostGIS on Mac OS X and Ubuntu
# Some good references are:
# http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x
# http://www.paolocorti.net/2008/01/30/installing-postgis-on-ubuntu/
# http://postgis.refractions.net/documentation/manual-1.5/ch02.html#id2630392
#1. Install PostgreSQL postgis and postgres
brew install postgis
initdb /usr/local/var/postgres
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start