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 -xe | |
sudo apt-get -y update | |
sudo apt-get install -y tk8.6-dev libssl-dev sqlite3 libsqlite3-dev \ | |
gcc g++ make libpng-dev libxml2 \ | |
libxml2-dev libxslt1-dev python-dev \ | |
zlib1g-dev libbz2-dev \ |
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 -xe | |
yum -y update | |
yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel xz-libs gcc g++ make wget | |
# Install Python 2.7.8 | |
curl -o /root/Python-2.7.9.tar.xz https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tar.xz | |
tar -xf /root/Python-2.7.9.tar.xz -C /root | |
cd /root/Python-2.7.9 && ./configure --prefix=/usr/local && make && make altinstall |
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
{"Mappings": { | |
"TimeBasedAutoScale" : { | |
"weekend" : {"0":"off","1":"off","2":"off","3":"off","4":"off","5":"off","6":"off","7":"off","8":"off","9":"off","10":"off","11":"off","12":"off","13":"off","14":"off","15":"off","16":"off","17":"off","18":"off","19":"off","20":"off","21":"off","22":"off","23":"off"} | |
}, | |
"TimerBackendInstance1" : { | |
"Type": "AWS::OpsWorks::Instance", | |
"Properties": { | |
"Architecture" : { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch"]}, | |
"AutoScalingType" : "timer", |
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
#!/usr/bin/env python | |
""" | |
This is a script to create instances and set thier auto-scaling for eTech-Campus' | |
live OpsWorks Stack. The Stack is created using the CloudFormation template | |
is this directory. | |
Once the Stack and its single layer are created, | |
""" | |
import boto3 | |
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
def chunk(lst, size): | |
return [lst[i:i+size] for i in range(0, len(lst), size)] | |
#instances = my list of instancse | |
count = len(instances) | |
size = len(instances)/len(subnets) | |
num = len(instances)/size | |
_list = chunk(range(count), size) |
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 stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -qf dangling=true) |
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
<table> | |
<tr> | |
<td>First Name</td> | |
<td>Last Name</td> | |
</tr> | |
{% for student in students%} | |
<tr> | |
<td>{{student.first_name}}</td> | |
<td>{{student.last_name}}</td> | |
</tr> |
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
#!/usr/bin/env bash | |
#install all dependencies in a debian based system | |
sudo apt-get install -y python-distribute mysql-server mongodb libldap2-dev libsasl2-dev python-ldap libmysqlclient-dev python-dev unixodbc-dev libxml2-dev libxslt1-dev | |
#install pip to manage virtualenv | |
sudo easy_instal pip | |
#install a nice to use virtualenv utitlity | |
sudo pip install virtualenvwrapper | |
#this gist prints the git branch as well as the virtualenv name on the prompt | |
curl https://gist.githubusercontent.com/webiken/71aa48d381c231513f3e/raw/a7f10c73c1f48e7713eb7df00e83c37b6716970e/bash_profile > ~/.bash_profile |
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
# bash_prompt | |
# The various escape codes that we can use to color our prompt. | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[1;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" | |
LIGHT_GRAY="\[\033[0;37m\]" |
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
groupadd admins | |
adduser admin | |
usermod -g admins admin | |
vim /etc/sudoers | |
#we need to give the admins group PASSWORDLESS SUDO | |
#this is done by adding | |
# %admins ALL=(ALL) NOPASSWD:ALL | |
#now we set the hostname |
NewerOlder