Created
March 19, 2016 06:28
-
-
Save tfitch/73986be9ba67fe83881a to your computer and use it in GitHub Desktop.
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
# Our .tmux.conf file | |
# Setting the prefix from C-b to C-a | |
# START:prefix | |
set -g prefix C-a | |
# END:prefix | |
# Free the original Ctrl-b prefix keybinding | |
# START:unbind | |
unbind C-b | |
# END:unbind | |
#setting the delay between prefix and command | |
# START:delay | |
set -s escape-time 1 | |
# END:delay | |
# Ensure that we can send Ctrl-A to other apps | |
# START:bind_prefix | |
bind C-a send-prefix | |
# END:bind_prefix | |
# Set the base index for windows to 1 instead of 0 | |
# START:index | |
set -g base-index 1 | |
# END:index | |
# Set the base index for panes to 1 instead of 0 | |
# START:panes_index | |
setw -g pane-base-index 1 | |
# END:panes_index | |
# Reload the file with Prefix r | |
# START:reload | |
bind r source-file ~/.tmux.conf \; display "Reloaded!" | |
# END:reload | |
# splitting panes | |
# START:panesplit | |
bind | split-window -h | |
bind - split-window -v | |
# END:panesplit | |
# moving between panes | |
# START:paneselect | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
# END:paneselect | |
# Quick pane selection | |
# START:panetoggle | |
bind -r C-h select-window -t :- | |
bind -r C-l select-window -t :+ | |
# END:panetoggle | |
# Pane resizing | |
# START:paneresize | |
bind -r H resize-pane -L 5 | |
bind -r J resize-pane -D 5 | |
bind -r K resize-pane -U 5 | |
bind -r L resize-pane -R 5 | |
# END:paneresize | |
# mouse support - set to on if you want to use the mouse | |
# START:mouse | |
setw -g mode-mouse off | |
# END:mouse | |
set -g mouse-select-pane off | |
set -g mouse-resize-pane off | |
set -g mouse-select-window off | |
# Set the default terminal mode to 256color mode | |
# START:termcolor | |
set -g default-terminal "screen-256color" | |
# END:termcolor | |
# enable activity alerts | |
#START:activity | |
setw -g monitor-activity on | |
set -g visual-activity on | |
#END:activity | |
# set the status line's colors | |
# START:statuscolor | |
set -g status-fg white | |
set -g status-bg black | |
# END:statuscolor | |
# set the color of the window list | |
# START:windowstatuscolor | |
setw -g window-status-fg cyan | |
setw -g window-status-bg default | |
setw -g window-status-attr dim | |
# END:windowstatuscolor | |
# set colors for the active window | |
# START:activewindowstatuscolor | |
setw -g window-status-current-fg white | |
setw -g window-status-current-bg red | |
setw -g window-status-current-attr bright | |
# END:activewindowstatuscolor | |
# pane colors | |
# START:panecolors | |
set -g pane-border-fg green | |
set -g pane-border-bg black | |
set -g pane-active-border-fg white | |
set -g pane-active-border-bg yellow | |
# END:panecolors | |
# Command / message line | |
# START:cmdlinecolors | |
set -g message-fg white | |
set -g message-bg black | |
set -g message-attr bright | |
# END:cmdlinecolors | |
# Status line left side | |
# START:statusleft | |
set -g status-left-length 40 | |
set -g status-left "#[fg=green]Session: #S #[fg=yellow]#I #[fg=cyan]#P" | |
# END:statusleft | |
#START:utf8 | |
set -g status-utf8 on | |
#END:utf8 | |
# Status line right side | |
# 15% | 28 Nov 18:15 | |
# START: statusright | |
set -g status-right "#[fg=cyan]%d %b %R" | |
# END:statusright | |
# Update the status bar every sixty seconds | |
# START:updateinterval | |
set -g status-interval 60 | |
# END:updateinterval | |
# Center the window list | |
# START:centerwindowlist | |
set -g status-justify centre | |
# END:centerwindowlist | |
# enable vi keys. | |
# START:vikeys | |
setw -g mode-keys vi | |
# END:vikeys |
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 | |
# Exit when any of these commands fail | |
set -e | |
# install docker according to https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
apt-get install -y linux-image-extra-$(uname -r) | |
apt-get install -y apt-transport-https ca-certificates | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' > /etc/apt/sources.list.d/docker.list | |
apt-get update | |
apt-get purge lxc-docker | |
apt-cache policy docker-engine | |
apt-get update | |
apt-get install -y docker-engine | |
wget https://releases.hashicorp.com/terraform/0.6.12/terraform_0.6.12_linux_amd64.zip | |
mkdir -p /usr/local/terraform/bin | |
unzip terraform_0.6.12_linux_amd64.zip -d /usr/local/terraform/bin | |
# setup steps for Artifactory and Jenkins | |
mkdir -p /var/opt/jfrog/artifactory | |
mkdir -p /home/vagrant/jenkins_home | |
chown vagrant:vagrant /home/vagrant/jenkins_home | |
# install the ChefDK for InSpec | |
curl https://omnitruck.chef.io/install.sh | bash -s -- -c current -P chefdk -v 0.11.2 | |
# install Node.js because it's nice to have around | |
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - | |
apt-get install -y nodejs | |
# custom bash setup | |
echo "export ARTIFACTORY_HOME=/var/opt/jfrog/artifactory" >> /etc/environment | |
echo "PATH=/usr/local/terraform/bin:$PATH" >> /etc/environment | |
echo 'eval "$(chef shell-init bash)"' >> /etc/environment | |
# install tmux - with screen conf file | |
apt-get install -y tmux |
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
{ | |
"variables": { | |
"iso_url": "http://releases.ubuntu.com/releases/trusty/ubuntu-14.04.4-server-amd64.iso", | |
"iso_checksum": "2ac1f3e0de626e54d05065d6f549fa3a", | |
"iso_checksum_type": "md5", | |
"headless": "true", | |
"version": "1.0.0", | |
"build_number": "1" | |
}, | |
"builders": [ | |
{ | |
"name": "vmware", | |
"type": "vmware-iso", | |
"vm_name": "trusty64", | |
"iso_url": "{{user `iso_url`}}", | |
"iso_checksum": "{{user `iso_checksum`}}", | |
"iso_checksum_type": "{{user `iso_checksum_type`}}", | |
"ssh_username": "vagrant", | |
"ssh_password": "vagrant", | |
"ssh_port": "22", | |
"ssh_wait_timeout": "30m", | |
"guest_os_type": "ubuntu-64", | |
"headless": "{{user `headless`}}", | |
"boot_wait": "10s", | |
"disk_type_id": 0, | |
"vmdk_name": "disk", | |
"http_directory" : "http", | |
"http_port_min" : 9001, | |
"http_port_max" : 9001, | |
"boot_command": [ | |
"<esc><esc><enter><wait>", | |
"/install/vmlinuz noapic ", | |
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", | |
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", | |
"hostname={{ .Name }} ", | |
"fb=false debconf/frontend=noninteractive ", | |
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", | |
"keyboard-configuration/variant=USA console-setup/ask_detect=false ", | |
"initrd=/install/initrd.gz -- <enter>" | |
], | |
"shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'devvm'|sudo -S sh 'shutdown.sh'", | |
"vmx_data": { | |
"memsize": "2048", | |
"numvcpus":"2", | |
"tools.upgrade.policy": "manual" | |
} | |
}, { | |
"name": "virtualbox", | |
"type": "virtualbox-iso", | |
"vm_name": "trusty64", | |
"iso_url": "{{user `iso_url`}}", | |
"iso_checksum": "{{user `iso_checksum`}}", | |
"iso_checksum_type": "md5", | |
"ssh_username": "vagrant", | |
"ssh_password": "vagrant", | |
"ssh_port": "22", | |
"ssh_wait_timeout": "10000s", | |
"guest_os_type": "Ubuntu_64", | |
"guest_additions_path": "VBoxGuestAdditions.iso", | |
"guest_additions_mode": "upload", | |
"headless": "{{user `headless`}}", | |
"boot_wait": "10s", | |
"http_directory" : "http", | |
"http_port_min" : 9001, | |
"http_port_max" : 9001, | |
"boot_command": [ | |
"<esc><esc><enter><wait>", | |
"/install/vmlinuz noapic ", | |
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", | |
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", | |
"hostname={{ .Name }} ", | |
"fb=false debconf/frontend=noninteractive ", | |
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", | |
"keyboard-configuration/variant=USA console-setup/ask_detect=false ", | |
"initrd=/install/initrd.gz -- <enter>" | |
], | |
"shutdown_command": "echo 'shutdown -P now' > shutdown.sh; echo 'devvm'|sudo -S sh 'shutdown.sh'", | |
"vboxmanage": [ | |
["modifyvm", "{{.Name}}", "--memory", "2048"], | |
["modifyvm", "{{.Name}}", "--cpus", "2"] | |
] | |
} | |
], | |
"provisioners": [ | |
{ | |
"type": "shell", | |
"scripts": [ | |
"scripts/vagrant-user.sh", | |
"scripts/vagrant-ubuntu-update.sh", | |
"scripts/vagrant-ubuntu.sh", | |
"scripts/vagrant-sshkey.sh", | |
"scripts/install_tools.sh", | |
"scripts/atb-deployments.sh", | |
"scripts/docker-pulls.sh" | |
], | |
"execute_command": "echo 'vagrant' | sudo -S sh '{{ .Path }}'" | |
}, | |
{ | |
"type": "file", | |
"source": "{{pwd}}/files/.tmux.conf", | |
"destination": "/home/vagrant/.tmux.conf" | |
} | |
], | |
"post-processors": [ | |
{ | |
"type": "vagrant", | |
"only": ["virtualbox"], | |
"output": "atb-deployments-{{user `version`}}_vbox.box" | |
}, { | |
"type": "vagrant", | |
"only": ["vmware"], | |
"output": "atb-deployments-{{user `version`}}_vmware.box" | |
} | |
] | |
} |
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 | |
# Exit when any of these commands fail | |
set -e | |
# prebake the Docker containers | |
docker pull jenkins:1.625.2 | |
docker pull jfrog-docker-reg2.bintray.io/jfrog/artifactory-registry | |
docker pull node:latest | |
docker pull tutum/hello-world:latest | |
docker pull tutum/haproxy:latest |
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 | |
# Exit when any of these commands fail | |
#set -e | |
# Request sudo password upfront | |
sudo -v | |
preinstall () { | |
mkdir -p /media/cdrom | |
} | |
virtualbox () { | |
# Install additional packages required by VirtualBox | |
apt-get -y install xserver-xorg xserver-xorg-core | |
# Install VirtualBox | |
mount -o loop ~vagrant/VBoxGuestAdditions.iso /media/cdrom | |
sudo sh /media/cdrom/VBoxLinuxAdditions.run #2> /dev/null | |
umount /media/cdrom | |
} | |
vmware () { | |
# Install VMware Tools | |
url="https://softwareupdate.vmware.com/cds/vmw-desktop/fusion/6.0.3/1747349/packages/com.vmware.fusion.tools.linux.zip.tar" | |
curl -L -o /tmp/com.vmware.fusion.tools.linux.zip.tar --url "${url}" | |
tar -xvf /tmp/com.vmware.fusion.tools.linux.zip.tar -C /tmp | |
rm -f /tmp/com.vmware.fusion.tools.linux.zip.tar | |
unzip /tmp/com.vmware.fusion.tools.linux.zip -d /tmp | |
rm -f /tmp/com.vmware.fusion.tools.linux.zip | |
sudo mount -o loop /tmp/payload/linux.iso /media/cdrom | |
tar -xzvf /media/cdrom/VMwareTools-9.6.2-1688356.tar.gz -C /tmp | |
sudo /tmp/vmware-tools-distrib/vmware-install.pl --default | |
umount /media/cdrom | |
rm -rf /tmp/payload | |
} | |
install () { | |
if lspci | grep -i vmware --silent; then | |
vmware | |
elif lspci | grep -i virtualbox --silent; then | |
virtualbox | |
else | |
echo "No tools found for your hypervisor." | |
fi | |
} | |
main () { | |
preinstall | |
install | |
echo "done" | |
} | |
main | |
exit 0 |
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 | |
# Exit when any of these commands fail | |
set -e | |
# Install vagrant SSH key | |
mkdir ~vagrant/.ssh | |
chmod 700 ~vagrant/.ssh | |
cd ~vagrant/.ssh | |
wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys | |
chmod 600 ~vagrant/.ssh/authorized_keys | |
chown -R vagrant:vagrant ~vagrant/.ssh |
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 | |
# Exit when any of these commands fail | |
set -e | |
# Update all existing packages | |
apt-get -y update | |
apt-get -y upgrade | |
# Reboot | |
reboot | |
# Sleep a while... | |
sleep 60 |
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 | |
# Exit when any of these commands fail | |
set -e | |
# Use bash in Ubuntu (default is dash) | |
dpkg-reconfigure bash | |
# Install necessary libraries for guest additions and VMware HGFS shares | |
apt-get -y install linux-headers-server build-essential dkms nfs-common | |
# Install wget (this is used in other provision scripts) | |
apt-get -y install wget curl unzip gzip |
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 | |
# Exit when any of these commands fail | |
set -e | |
# Setup sudo to allow no-password sudo for "admin" | |
groupadd -r admin | |
usermod -a -G admin vagrant | |
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers | |
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment