Skip to content

Instantly share code, notes, and snippets.

View electric380v's full-sized avatar

Sergii Kh electric380v

  • UA
  • 13:13 (UTC +03:00)
View GitHub Profile
@electric380v
electric380v / bind-consul.sh
Created March 14, 2019 11:12
bind-consul.sh
sudo apt-get install bind9 bind9utils bind9-doc
wget https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip
/etc/bind/named.conf.options:
options {
directory "/var/cache/bind";
recursion yes;
allow-query { localhost; };
forwarders {
--web.listen-address=0.0.0.0:9100 --log.level=info --collector.logind --collector.systemd --collector.tcpstat --collector.ntp --collector.interrupts --collector.meminfo_numa --collector.processes --no-collector.bonding --no-collector.bcache --no-collector.arp --no-collector.edac --no-collector.infiniband --no-collector.ipvs --no-collector.mdadm --no-collector.nfs --no-collector.nfsd --no-collector.textfile --no-collector.wifi --no-collector.hwmon --no-collector.conntrack --no-collector.timex --no-collector.zfs
docker run \
--volume=/:/rootfs:ro \
--volume=/var/run:/var/run:ro \
--volume=/sys:/sys:ro \
# FROM node:10-alpine
FROM node:11.9.0-alpine as builder
WORKDIR /app
ENV ENV production
ADD . ./
RUN echo "--->>> install yarn" && \
yarn install && \
echo "--->>> Build project" && \
@electric380v
electric380v / Dockerfile
Last active February 11, 2019 12:17
web
### STAGE 1: Build ###
FROM alpine:latest
WORKDIR /app
COPY . .
RUN apk add --update yarn && \
yarn install && \
yarn run build && \
@electric380v
electric380v / mysql
Created February 7, 2019 22:23
mysql
docker run --name mysql \
-e MYSQL_USER=rob -e MYSQL_PASSWORD=123456 -e MYSQL_DATABASE=bookshelf \
-p 3306:3306 -d mysql/mysql-server:5.7
-v /var/lib/mysql
docker volume create crv_mysql
docker run \
-e MYSQL_ROOT_PASSWORD=my-secret-pw \
@electric380v
electric380v / .screenrc
Created January 29, 2019 23:44
.screenrc
# включаем utf8
defutf8 on
shell -$SHELL
#Выводим строку состояния
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{G}][%= %{= kW}%-w%{+b Yk} %n %t%?(%u)%? %{-}%+w %=%{G}][%{W}%m/%d %{W}%c%{G}]'
# huge scrollback buffer
# RemoteSubl
RemoteSubl starts as a fork of [rsub](https://github.com/henrikpersson/rsub) to bring `rmate` feature of TextMate to Sublime Text. It transfers files to be edited from remote server using SSH port forward and transfers the files back when they are saved.
Comparing to rsub, the followings are enhanced:
- support multiple files via `rmate foo bar`.
- use the same view when opening the same file twice.
- notify when connection lost.
- resume previous connection when it was lost.
@electric380v
electric380v / vagrant setup
Created January 20, 2019 20:31
Vagrant setup
# How to Install Vagrant in Debian Linux 64 bits
### First, we install Virtualbox
```
sudo apt-get install virtualbox
```
### Then, we install Vagrant
{
"builders": [{
"type": "virtualbox-iso",
"guest_os_type": "Debian_64",
"iso_url": "{{user `mirror`}}/current/amd64/iso-cd/debian-9.6.0-amd64-netinst.iso",
"iso_checksum": "{{user `iso_checksum`}}",
"iso_checksum_type": "{{user `iso_checksum_type`}}",
"output_directory": "output-debian-9.4-amd64-{{build_type}}",
"vm_name": "packer-debian-9.4-amd64",
"disk_size": "{{user `disk_size`}}",
@electric380v
electric380v / Installing SSHPASS
Created January 17, 2019 10:41
Installing SSHPASS
# Installing SSHPASS
[SSHPass](http://www.cyberciti.biz/faq/noninteractive-shell-script-ssh-password-provider/) is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.
## Installing on Ubuntu
apt-get install sshpass
## Installing on OS X