This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo wget --no-check-certificate https://get.docker.io/builds/Linux/x86_64/docker-latest -O /usr/bin/docker | |
sudo chmod +x /usr/bin/docker | |
sudo groupadd docker | |
sudo usermod -a -G docker wyrls | |
sudo yum install bridge-utils lxc | |
sudo sysctl -w net.ipv4.ip_forward=1 | |
##/etc/sysctl.conf | |
sysctl net.ipv4.ip_forward=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvcreate --wipesignatures y -n thinpool arch -L 100G | |
lvcreate --wipesignatures y -n thinpoolmeta arch -L 1G | |
lvconvert -y --zero n -c 512K --thinpool arch/thinpool --poolmetadata arch/thinpoolmeta | |
cat <<EOF | tee /etc/lvm/profile/docker-thinpool.profile | |
activation { | |
thin_pool_autoextend_threshold=80 | |
thin_pool_autoextend_percent=20 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker_root=/var/lib/docker/btrfs | |
subvolumes=subvolumes | |
docker_image=aputs/archlinux | |
tar_file=/tmp/image.tar.gz | |
# tar | |
cd $docker_root/$subvolumes/$(docker inspect --format='{{.Id}}' $docker_image) | |
tar --exclude={'.','..'} -Pcvzf $tar_file .* * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
set -o pipefail | |
function list_tars { | |
ROOT=$1 | |
TAG=${2:-latest} | |
BASE=$(sed -e 's/.*{\(".*"\)}.*/\1/g' "${ROOT}/repositories" | sed 's/"//g' | awk -v RS=',' -F: '/^'${TAG}'/ {print $2}') | |
CUR=$BASE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TGZ=http://hkg.mirror.rackspace.com/archlinux/iso/2014.11.01/archlinux-bootstrap-2014.11.01-x86_64.tar.gz | |
ROOT=/var/lib/archlinux | |
TMPROOT=/tmp/archlinux | |
sudo mkdir -p ${TMPROOT} | |
wget "${TGZ}" -O- | sudo tar --strip-components=1 -C ${TMPROOT} -Pxzf- | |
sudo sed --in-place s/^#//g ${TMPROOT}/etc/pacman.d/mirrorlist | |
sudo btrfs subvolume delete ${ROOT} | |
sudo btrfs subvolume create ${ROOT} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Creates a SmartOS VM in VirtualBox (assuming you alread have VirtualBox installed) | |
# | |
# This script will: | |
# * Download the latest live ISO image of SmartOS | |
# * Create a VirtualBox VM, or update an existing VM with the latest ISO | |
# * Configure the VM with a zones disk, and boot it! | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
NoUpgrade = etc/passwd etc/group etc/shadow | |
NoUpgrade = etc/pacman.conf | |
NoExtract = usr/share/doc/* | |
NoExtract = usr/share/info/* | |
NoExtract = usr/share/man/* | |
NoExtract = usr/share/locale/[a-d,f-k,m-z]* | |
NoExtract = usr/share/locale/e[a-m,o-z]* | |
NoExtract = usr/share/locale/l[a-n,p-z]* | |
NoExtract = usr/share/locale/lo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Startup script for etcd | |
# | |
# chkconfig: 2345 20 80 | |
# description: Starts and stops etcd | |
. /etc/init.d/functions | |
prog="etcd" | |
ETCD_BIN=$(which etcd 2> /dev/null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import logging | |
from django.conf import settings | |
from django.core.exceptions import ImproperlyConfigured | |
from redis.sentinel import Sentinel | |
from django_redis.client import DefaultClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
control_c() | |
# run if user hits control-c | |
{ | |
echo -en "\n*** Ouch! Exiting ***\n" | |
exit $? | |
} |