Skip to content

Instantly share code, notes, and snippets.

@zparnold
zparnold / database.yml
Last active March 27, 2019 21:23
An extendable, DRY Rails database file
#chances are you use the same port and adapter everywhere
default: &default
adapter: mysql2
reconnect: true
port: 3306
#we use docker compose locally, so these settings stay the same
local: &local
<<: *default
username: root
@zparnold
zparnold / Dockerfile
Last active November 2, 2017 17:15
Ygrene Rails Base
FROM phusion/passenger-ruby23:0.9.26
#OS Level stuff
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
mysql-client build-essential memcached nodejs git pdftk chrpath libssl-dev libxft-dev \
libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev vim wget nano awscli less unzip zlib1g-dev libxslt-dev
#PhantomJS
RUN wget "https://s3-us-west-2.amazonaws.com/ygrene-public-artifacts/phantomjs-2.1.1-linux-x86_64.tar.bz2" && \
@zparnold
zparnold / user_data.sh
Created October 9, 2017 14:13
A script to bootstrap Bamboo master server and attach an EFS instance to it.
#!/bin/bash
#### SET VARS
BAMBOO_VERSION=6.2.1
EFS_DNS=YOUR_EFS_ID.efs.YOUR_AWS_REGION.amazonaws.com
AWS_S3_BUCKET=your-aws-bucket-name
#### INSTALL DEPS
yum update -y
yum install -y java-1.8.0 docker git
@zparnold
zparnold / Dockerfile
Created October 24, 2017 22:15
Ygrene Redirector
FROM nginx
ADD nginxconfd.txt /etc/nginx/conf.d/
@zparnold
zparnold / Dockerfile
Created November 14, 2017 04:19
Ygrene Scala Base
FROM tomcat:8
RUN mkdir -p /home/app
WORKDIR /home/app
@zparnold
zparnold / one_liner.sh
Last active May 6, 2024 13:14
A simply script to delete all failed pods from Kubernetes
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@zparnold
zparnold / run.rb
Created January 15, 2018 20:14
If run as root on a server it will update the Yum repos to the latest, and then cleans up after itself
require 'tempfile'
require 'fileutils'
require 'open3'
def edit_file(location, update_config)
temp_file = Tempfile.new('newConfig')
begin
File.open(location, 'r') do |file|
file.each_line do |line|
if line.include? "="
@zparnold
zparnold / ena_setup_on_ec2.sh
Created March 8, 2018 18:40
Run this script on Ubuntu to enable ENA support.
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
#you may get an error E: Failed to fetch https://sdkrepo.atlassian.com/debian/dists/stable/contrib/binary-amd64/Packages 404 Not Found
#don't worry, you can continue without harm
sudo apt-get install -y build-essential dkms
git clone https://github.com/amzn/amzn-drivers
sudo mv amzn-drivers /usr/src/amzn-drivers-1.5.1
sudo touch /usr/src/amzn-drivers-1.5.1/dkms.conf
echo 'PACKAGE_NAME="ena"
PACKAGE_VERSION="1.5.1"
@zparnold
zparnold / file.md
Created May 1, 2018 13:51
Notes for SIG Updates

SIG Apps

  • Ken Owens
  • Helm 2.9 stability release is out
  • Helm 3 proposal has been merged, come to the meeting to contribute
  • App Def working group
    • Labeling recommendations for various parts of Application Definition
    • Application CRD has been introduced to bring a more high-level view
    • There is also an apps survey result (come to the deep dive to find out)
    • There is a charter open for this SIG, look there for feedback
  • Beginning a discussion regarding developer tooling and how to make that experience better
@zparnold
zparnold / deploy.sh
Created June 28, 2018 17:08
Kubernetes Rails Deploy Script
#!/bin/bash
set -e
function getPods() {
local val='';
while [ true ]; do
val=`kubectl get pods -n ${NAMESPACE} --selector="name=${1}" -o $2`
if [[ $val != '' ]] || [[ $? -eq 0 ]]; then break; fi
done
echo "${val}"