Skip to content

Instantly share code, notes, and snippets.

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
## 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
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;
@tylrd
tylrd / .vimrc
Last active January 13, 2016 14:09
set nocompatible
set tabstop=2
set shiftwidth=2
set shiftround
set expandtab
set relativenumber
set scrolloff=8
set number
set clipboard=unnamed
set showmatch
@tylrd
tylrd / EC2 commands
Last active January 13, 2016 13:58
ec2 things
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
@tylrd
tylrd / setup.sh
Last active September 14, 2015 23:36
ruby development environment
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
@tylrd
tylrd / setup.sh
Last active September 9, 2015 15:24
ansible
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
@tylrd
tylrd / default-ssl.conf
Last active July 20, 2019 17:39
setting up apache in ubuntu
<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
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
@tylrd
tylrd / stack.rb
Last active September 6, 2015 21:05
stack overflow
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