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
| #!/usr/bin/env python | |
| # | |
| # usage: | |
| # conv2vmx-ovf.py some-vm.ovf | |
| # | |
| # ref: http://www.cnblogs.com/eshizhan/p/3332020.html | |
| # | |
| import sys | |
| fn = sys.argv[1] |
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 | |
| # Install dependencies | |
| # older ubuntus | |
| #apt-get install build-essential libsqlite3-dev ruby1.9.1-dev | |
| # xenial | |
| apt install build-essential libsqlite3-dev ruby-dev | |
| # Install the gem | |
| gem install mailcatcher |
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 | |
| # PATH TO YOUR HOSTS FILE | |
| ETC_HOSTS=/etc/hosts | |
| # DEFAULT IP FOR HOSTNAME | |
| IP="127.0.0.1" | |
| # Hostname to add/remove. | |
| HOSTNAME=$1 |
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 | |
| # Credits to: | |
| # - http://vstone.eu/reducing-vagrant-box-size/ | |
| # - https://github.com/mitchellh/vagrant/issues/343 | |
| aptitude -y purge ri | |
| aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide | |
| aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30 | |
| aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5 |
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
| #!/usr/bin/env bash | |
| # --------------------------------------- | |
| # Virtual Machine Setup | |
| # --------------------------------------- | |
| # Adding multiverse sources. | |
| cat > /etc/apt/sources.list.d/multiverse.list << EOF | |
| deb http://archive.ubuntu.com/ubuntu trusty multiverse | |
| deb http://archive.ubuntu.com/ubuntu trusty-updates multiverse |
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 | |
| apt-get -y install git bc | |
| git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt | |
| mkdir /etc/letsencrypt |
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
| get_latest_release() { | |
| curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
| grep '"tag_name":' | # Get tag line | |
| sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
| } | |
| # Usage | |
| # $ get_latest_release "creationix/nvm" | |
| # v0.31.4 |
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 | |
| # source: https://gist.github.com/francoisromain/58cabf43c2977e48ef0804848dee46c3 | |
| # and another script to delete the directories created by this script | |
| # project-delete.sh: https://gist.github.com/francoisromain/e28069c18ebe8f3244f8e4bf2af6b2cb | |
| # Call this file with `bash ./project-create.sh project-name` | |
| # - project-name is mandatory | |
| # This will creates 4 directories and a git `post-receive` hook. |
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
| I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables. | |
| What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding. | |
| Network configuration | |
| Here’s how it’s done: | |
| Create a virtual interface that serves as the gateway for your VMs: |
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
| import os | |
| import subprocess | |
| import boto.ec2 | |
| import itertools | |
| AWS_KEY = os.getenv('AWS_ACCESS_KEY') | |
| AWS_SECRET = os.getenv('AWS_SECRET_KEY') | |
| # Tweak as necessary for your infrastructure | |
| regions = ['us-east-1', 'us-west-1', 'eu-west-1'] |