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
FROM ubuntu:16.04 | |
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libncursesw5-dev libreadline-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev libxml2-dev libxslt-dev python3-dev python-setuptools firefox xvfb curl git && apt-get clean | |
ENV PYTHON_VERSION 3.5.2 | |
ENV PYTHON_DIR /usr/src/python | |
ENV PYTHON_PIP_VERSION 8.1.2 | |
# Build Python 3.5 | |
WORKDIR /tmp |
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
## download from http://apt.dockerproject.org/repo/pool/main/d/docker-engine/ | |
sudo apt-get install -y libapparmor1 aufs-tools ca-certificates | |
sudo dpkg -i shared/docker-engine_1.8.3-0-trusty_amd64.deb | |
sudo usermod -aG docker vagrant |
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
upstream app { | |
server unix:/home/deploy/apps/amoss_explorer/shared/tmp/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
root /home/deploy/apps/amoss_explorer/public; | |
server_name mtaylord.com | |
try_files $uri/maintenance.html $uri/index.html $uri @app; |
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
set nocompatible | |
set tabstop=2 | |
set shiftwidth=2 | |
set shiftround | |
set expandtab | |
set relativenumber | |
set scrolloff=8 | |
set number | |
set clipboard=unnamed | |
set showmatch |
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
aws ec2 describe-instances --profile USER | |
// UBUNTU AMI: ami-d05e75b8 | |
aws ec2 create-key-pair --key-name MyKeyPair --query 'KeyMaterial' --output text > MyKeyPair.pem | |
aws ec2 describe-security-groups --profile USER | |
aws ec2 run-instances --image-id ami-XXXXXXX --count COUNT --instance-type TYPE --key-name KEYNAME --security-groups SG --profile USER | |
aws ec2 terminate-instances --instance-ids ID | |
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 apt-get update | |
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev | |
cd | |
git clone git://github.com/sstephenson/rbenv.git .rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
exec $SHELL | |
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
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
openssl req \ | |
-newkey rsa:2048 -nodes -keyout files/nginx.key \ | |
-x509 -days 365 -out files/nginx.crt | |
- name: configure webserver with nginx and tls | |
hosts: webservers | |
sudo: True | |
vars: | |
key_file: /etc/nginx/ssl/nginx.key | |
cert_file: /etc/nginx/ssl/nginx.crt |
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
<IfModule mod_ssl.c> | |
<VirtualHost _default_:443> | |
ServerAdmin admin@example.com | |
ServerName your_domain.com | |
ServerAlias www.your_domain.com | |
DocumentRoot /var/www/html | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
SSLEngine on | |
SSLCertificateFile /etc/apache2/ssl/apache.crt |
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 index | |
params[:page] ? page = params[:page].to_i : page = 1 | |
sort = params[:sort] | |
if params[:tags] | |
stripped_tags = params[:tags].gsub(/\s+/, "") | |
tags = stripped_tags.split(",") | |
end | |
if page == 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
class Stack | |
BASE = "https://api.stackexchange.com/" | |
TAGS = "/2.2/tags" | |
ACCESS_KEY = ENV['STACK_KEY'] | |
WRITE_FILE_PAGE = File.expand_path("~/Desktop/tags.txt") | |
WRITE_ALL_FILE = File.expand_path("~/Desktop/all_tags.txt") | |
attr_reader :tags |