Skip to content

Instantly share code, notes, and snippets.

@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 / 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'
@adriagalin
adriagalin / tmux.cheat
Last active August 29, 2015 14:16 — forked from afair/tmux.cheat
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@adriagalin
adriagalin / deps.rb
Last active March 28, 2016 17:22 — forked from maxim/deps.rb
Print Ansible role dependencies
#!/usr/bin/env ruby
require 'yaml'
PLAYS_DIR = '.'
ROLES_DIR = './roles'
def deps_of(role)
dep_path = File.join(ROLES_DIR, "#{role}/meta/main.yml")
File.exists?(dep_path) ? (YAML.load_file(dep_path)['dependencies'] || []) : []