This file contains hidden or 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
#add following lines in your .ssh/config | |
Host example.com | |
HostName example.com | |
User git | |
IdentitiesOnly yes |
This file contains hidden or 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
# compile iptables from source and install to /usr/local | |
mkdir -p /tmp/iptables | |
wget "http://www.netfilter.org/projects/iptables/files/iptables-1.4.21.tar.bz2" -qO- | tar --strip-components=1 -C /tmp/iptables -xvj | |
cd /tmp/iptables | |
./configure | |
make | |
make install | |
# set alternatives | |
sudo alternatives --install /sbin/iptables iptables.x86_64 /usr/local/sbin/iptables 100 \ |
This file contains hidden or 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 hidden or 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 | |
iptables -F | |
iptables -X | |
iptables -t nat -F | |
iptables -t nat -X | |
iptables -t mangle -F | |
iptables -t mangle -X | |
iptables -P INPUT ACCEPT | |
iptables -P FORWARD ACCEPT |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
dest_dir=/var/lib/container/archlinux | |
btrfs subvolume snapshot $docker_root/$subvolumes/$(docker inspect --format='{{.Id}}' $docker_image) $dest_dir | |
systemd-nspawn -D $dest_dir |
This file contains hidden or 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 hidden or 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
# Mandatory Files: copied from Centos7 ISO installer (minimal/full dvd) | |
# | |
# $ROOT/cdroot/.discinfo | |
# $ROOT/cdroot/LiveOS/squashfs.img | |
# $ROOT/cdroot/isolinux/boot.cat | |
# $ROOT/cdroot/isolinux/initrd.img | |
# $ROOT/cdroot/isolinux/isolinux.bin | |
# $ROOT/cdroot/isolinux/vmlinuz | |
# |