Skip to content

Instantly share code, notes, and snippets.

View PavloBezpalov's full-sized avatar

Pavlo Bezpalov PavloBezpalov

View GitHub Profile
@PavloBezpalov
PavloBezpalov / .rubocop.yml
Created June 19, 2019 14:01
Rubocop settings that helps
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.4
DisabledByDefault: true
Exclude:
- db/**/**
- bin/*
# Prefer &&/|| over and/or.
@PavloBezpalov
PavloBezpalov / system_test_driven_by_headless_chrome.rb
Created March 14, 2018 12:26 — forked from juno/system_test_driven_by_headless_chrome.rb
Rails 5.1 System Test driven by headless chrome.
driven_by(
:selenium,
using: :chrome,
screen_size: [1400, 900],
options: {
desired_capabilities: {
chromeOptions: {
args: %w[headless disable-gpu],
prefs: {
'modifyheaders.headers.name' => 'Accept-Language',
@PavloBezpalov
PavloBezpalov / git_flow.md
Last active November 2, 2018 20:20
Pivotal Git Flow

Git Flow

Working on stories

  1. Start story in pivotal tracker and copy it id (STORY_ID).

  2. Checkout development branch and pull from remote

@PavloBezpalov
PavloBezpalov / install.sh
Created September 19, 2017 14:49 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
0 */12 * * * certbot -q renew --renew-hook "service nginx reload"
@PavloBezpalov
PavloBezpalov / 1 setup vps
Last active January 31, 2021 12:10
Deploy Rails 5.1.1 to VPS(Ubuntu 16.04.2 LTS). Nginx mainline + pagespeed, Puma with Jungle, Capistrano3, PostgreSQL 9.6, RVM, Certbot
root# apt-get update
root# apt-get upgrade
// dependencies for Ruby
root# apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev \
libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev \
libpcre3-dev unzip
// Node.js v7
root# curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
@PavloBezpalov
PavloBezpalov / nginx.conf
Last active May 31, 2017 08:09
Nginx 1.11+ SSL A+
# ADD TO HTTP OR SERVER BLOCK
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
ssl_ecdh_curve prime256v1:secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off; # Requires nginx >= 1.5.9
ssl_stapling on; # Requires nginx >= 1.3.7
ssl_stapling_verify on; # Requires nginx => 1.3.7
@PavloBezpalov
PavloBezpalov / 01_postfix_installer.md
Created November 4, 2016 15:13 — forked from solusipse/01_postfix_installer.md
Postfix + Dovecot + Postgresql + Postfixadmin + Roundcube

Postfix Installer

Following script may be used for configuring complete and secure email server on fresh install of Debian 7. It will probably work on other distributions using apt-get. After minor changes you'll be able to use it on other Linux distros.

Usage

  1. Run postfix.sh script.
  2. Configure postgres to allow connections.
  3. Configure postfix admin. Remember to set these:
@PavloBezpalov
PavloBezpalov / deploy.rb
Created October 7, 2016 12:23
Updating capistrano repository url
namespace :git do
task :update_repo_url do
on roles(:all) do
within repo_path do
execute :git, 'remote', 'set-url', 'origin', fetch(:repo_url)
end
end
end
end
@PavloBezpalov
PavloBezpalov / 1. ELK.install
Last active January 5, 2024 16:14
ELK Stack with Rails (Elasticsearch, Logstash, Kibana) on Ubuntu VPS
INSTALL JAVA
$ sudo apt-get update && sudo apt-get install default-jre
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
$ sudo apt-get update && sudo apt-get install elasticsearch
$ sudo update-rc.d elasticsearch defaults 95 10
$ sudo service elasticsearch restart
$ sudo service elasticsearch status