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 / 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.

FROM debian:8.6
RUN apt-get update && \
apt-get install -y --no-install-recommends curl make && \
\
echo 'Setting up erlang related variables' && \
ERLANG_VERSION=19.1.3 && \
ERLANG_BASE=https://packages.erlang-solutions.com/erlang/esl-erlang && \
ERLANG_FLAVOUR=FLAVOUR_1_general && \
ERLANG_DEB=esl-erlang_$ERLANG_VERSION-1~debian~jessie_amd64.deb && \
@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 / list.md
Last active September 26, 2024 20:12
This is a small list of vulnerabilities, links and books which help to junior developers with learning security.

Security

This is a small list of vulnerabilities, links and books which help to junior developers with learning security. The knowledge came to me bit by bit. Accidentally I knew about "OWASP" after seven months of my work. I knew about the "ranbow table" when I was reading the "Learning NodeJs". More programmes don't know about the "HttpOnly" flag although they have more than year of experience of development. Why is this happening? This is not an article. I won't to explain your about "race condition" or other a specific vulnerability or something else... The goal of this list that you will see links and books which you can read. I want to save your time. Do you know what does "vulnerability scanner" mean? No? So you can read about it here. Now you hear about "vulnerability scanner", you read about "vulnerability scanner" and may be you will use it in the future. This is awesome! My goal was achieved!

OWASP

The Open Web Application Security Project (OWASP) is a 501(c)(3) worldwide not-for-profit cha

@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 / postgres_wal_backup.sh
Created February 12, 2018 18:08
Postgres WAL
PG_VERSION="9.5"
ETC_PG="/etc/postgresql/$PG_VERSION"
cd $ETC_PG/backups
rm -rf *
pg_basebackup --xlog -U postgres --format=t -D $ETC_PG/backups/