Skip to content

Instantly share code, notes, and snippets.

View buurzx's full-sized avatar
🎯
Focusing

Pavel Romanov buurzx

🎯
Focusing
  • Earth
View GitHub Profile
@buurzx
buurzx / site.conf
Created May 30, 2017 20:47 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@buurzx
buurzx / deploy.rb
Created June 20, 2017 20:02 — forked from noma4i/deploy.rb
Deploy Phoenix Elixir by mina
require 'mina/bundler'
require 'mina/git'
require 'mina/rbenv'
set :domain, 'your_domain.com'
set :deploy_to, '/home/deployer/app_name'
set :repository, 'git@github.com:user_name/app_name'
set :branch, ENV["brunch"] || 'master'
set :app_name, "app_name"
@buurzx
buurzx / erlang-release-init.d.md
Created June 23, 2017 12:54 — forked from ostinelli/erlang-release-init.d.md
Erlang Release init.d script

Erlang Release init.d script

If you have packaged your application into a release generated with Rebar, you might want to have the following:

  • The release started on system boot.
  • The VM monitored and restarted it if it crashes.

Use HEART

HEART is the Heartbeat Monitoring of an Erlang Runtime System. The purpose of the heart port program is to check that the Erlang runtime system it is supervising is still running, so that if the VM crashes or becomes unresponsive, it is restarted.

@buurzx
buurzx / github pre-hook
Last active September 29, 2017 08:37 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
The intention of this guide is to add a git hook in order to run rubocop on any ruby application you want to force yourself to follow the rules.
First you need to run the following commands, under the rails project directory:
```
$ touch .git/hooks/pre-commit
$ chmod +x .git/hooks/pre-commit
```
Next add the following code into your `.git/hooks/pre-commit` file:
```bash
@buurzx
buurzx / copy.go
Created October 10, 2017 13:06 — forked from r0l1/copy.go
Copy a directory tree (preserving permissions) in Go.
// CopyFile copies the contents of the file named src to the file named
// by dst. The file will be created if it does not already exist. If the
// destination file exists, all it's contents will be replaced by the contents
// of the source file. The file mode will be copied from the source and
// the copied data is synced/flushed to stable storage.
func CopyFile(src, dst string) (err error) {
in, err := os.Open(src)
if err != nil {
return
@buurzx
buurzx / client.go
Created October 25, 2017 07:06 — forked from kenshinx/client.go
golang socket server & client ping-pong demo
package main
import (
"log"
"net"
"strconv"
"strings"
)
const (
@buurzx
buurzx / frontend.md
Created November 16, 2017 13:16 — forked from sshkarupa/frontend.md
Тестовое задание на вакансию верстальщика

Нужно сверстать два макета. Сетка общая. При вестке необходимо придерживаться БЭМ методологии (в части именования классов). Будет будет плюсом, если это будет на gulp + jade + scss. Выложите результат в свой репозиторий на github и пришлите на него ссылку.

@buurzx
buurzx / Ansible install
Created January 24, 2018 12:48 — forked from dpalomar/Ansible install
Steps to install Ansible on Debian/Ubuntu
# base requirements
sudo apt-get update
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-setuptools python-dev libffi-dev libssl-dev git sshpass tree
sudo easy_install pip
sudo -H pip install cryptography
# sudo -H pip install ansible==2.1.1.0 if you don't need virtualenv
# virtualenv
@buurzx
buurzx / deploy.rb
Created January 26, 2018 16:17 — forked from natew/deploy.rb
Puma + Nginx + Capistrano
require 'bundler/capistrano'
require 'capistrano_colors'
load 'deploy/assets'
# ssh forwarding and shell
set :default_run_options, { :pty => true }
set :ssh_options, { :forward_agent => true }
set :scm_verbose, true
set :scm, :git
@buurzx
buurzx / docker-cleanup-resources.md
Created May 8, 2018 13:08 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm