Skip to content

Instantly share code, notes, and snippets.

set nu
filetype plugin indent on
syntax on
colo torte
set tabstop=2
set shiftwidth=2
set expandtab
(https://forums.docker.com/t/cleaning-up-docker-for-mac/17894)
ls -lh ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
docker run -it --rm -v /:/host alpine chroot /host /bin/sh -c 'dd if=/dev/zero of=/var/lost+found/zeroes; rm /var/lost+found/zeroes'
cd ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux
/Applications/Docker.app/Contents/MacOS/qemu-img convert -p -O qcow2 Docker.qcow2 Docker-slim.qcow2
mv Docker-slim.qcow2 Docker.qcow2
@vadikgo
vadikgo / run.sh
Last active September 2, 2016 07:49
Upgrade docker gitlab/gitlab-ce image with volumes data
#!/bin/sh
set -e
#pip install docker-replay
#docker-replay -p gitlab-ce
docker pull gitlab/gitlab-ce
docker stop gitlab-ce
docker create --volumes-from gitlab-ce \
--hostname 1753deeeb7fa \
@vadikgo
vadikgo / gitlab-gc.sh
Created February 7, 2017 13:30 — forked from pbabics/gitlab-gc.sh
Manual garbage collector for gitlab registry, it removes old revisions that are not referenced by any tag
#!/bin/bash
BASE_PATH=/var/opt/gitlab/gitlab-rails/shared/registry/docker/registry/v2/repositories
DRY_RUN=0
KEEP_LAST_IMAGES=10
RUN_GARBAGE_COLLECTOR=0
GITLAB_CTL_COMMAND=`which gitlab-ctl`
@vadikgo
vadikgo / Vagrantfile
Created February 9, 2017 12:43
Vagrant file with ansible dynamic inventory
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = [ "minio1", "minio2", "minio3", "minio4" ]
Vagrant.configure(2) do |config|
hosts.each_with_index do |name, num|
config.vm.define name do |machine|
machine.vm.box = "parallels/centos-7.3"
machine.vm.provider "parallels" do |v|
#!/bin/sh
# Detected container limits
# If found these are exposed as the following environment variables:
#
# - CONTAINER_MAX_MEMORY
# - CONTAINER_CORE_LIMIT
#
# This script is meant to be sourced.
#!/bin/sh
# =================================================================
# Detect whether running in a container and set appropriate options
# for limiting Java VM resources
#
# Usage: JAVA_OPTIONS="$(java-default-options.sh)"
# Env Vars evaluated:
# JAVA_OPTIONS: Checked for already set options
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="YOUR-ACCESSKEY"
S3SECRET="YOUR-SECRETKEY"
function putS3
{
path=$1
file=$2
aws_path=$3
class Ansible < Formula
include Language::Python::Virtualenv
desc "Automate deployment, configuration, and upgrading"
homepage "https://www.ansible.com/"
url "http://releases.ansible.com/ansible/ansible-2.3.0.0.tar.gz"
sha256 "299f3907cd566a20e163942fa82b6afc86ef89c2726ba503b90c1a651e82a458"
head "https://github.com/ansible/ansible.git", :branch => "devel"
bottle do