Skip to content

Instantly share code, notes, and snippets.

@adriagalin
adriagalin / nginx-default-site.conf
Last active August 12, 2019 17:09
Nginx default configuration and default site configuration
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
root /usr/share/nginx/html;
index index.html index.htm;

Keybase proof

I hereby claim:

  • I am adriagalin on github.
  • I am adriagalin (https://keybase.io/adriagalin) on keybase.
  • I have a public key whose fingerprint is ED0B 6942 CD1C 615E 6B8E 1995 9EC7 7FFF 6BC8 7524

To claim this, I am signing this object:

@adriagalin
adriagalin / Go: Multistage Docker build
Last active May 14, 2018 07:12
Go Multistage Dockerfile builder
# Builder stage
FROM golang:1.9 AS builder
LABEL MAINTAINER "Team Name <team@email.com>"
# Install tools required to build the project
RUN go get github.com/golang/dep/cmd/dep
# Add ssh key to clone private repos
ARG SSH_PRIVATE_KEY
COPY ${SSH_PRIVATE_KEY} /root/.ssh/id_rsa

pid of running tcp app

lsof -wni tcp:3000

@adriagalin
adriagalin / Google-Cloud-SDK-commands.md
Last active March 21, 2018 16:46
Google Cloud SDK commands

Google Cloud SDK

Add new config

gcloud init

List configs

gcloud config configurations list
@adriagalin
adriagalin / docker-gc
Created February 6, 2018 14:51 — forked from osiyuk/docker-gc
free up disk space after docker garbage
#!/bin/bash
GARBAGE="/var/lib/docker/aufs/diff"
du -hd 1 $GARBAGE | sort -hrk 1 | head -25
find $GARBAGE -maxdepth 1 -name *-removing -exec rm -rf '{}' \;
@adriagalin
adriagalin / rails-postgres-bootstrap.md
Created February 5, 2018 18:03
Instructions to create a new app using Ruby on Rails, Postgresql and Twitter Bootstrap

Note: I'm using RVM as my ruby version manager, also yo could use rbenv

  • Check ruby version
ruby -v
  • To update ruby
rvm install ruby --latest OR rvm install ruby 2.5.0
@adriagalin
adriagalin / gist:c93ffd615359f22920bde899ef03f8d2
Created March 18, 2017 21:38 — forked from ruckus/gist:2293434
Basic setup of WAL-E for continuous archiving and recovery

WAL-E needs to be installed on all machines, masters and slaves.

How to install WAL-E

Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf is:

archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60
@adriagalin
adriagalin / install-comodo-ssl-cert-for-nginx.rst
Created June 7, 2016 14:06 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@adriagalin
adriagalin / move_to_rds.rb
Last active March 28, 2016 17:19 — forked from guenter/move_to_rds.rb
Move to RDS
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'