Skip to content

Instantly share code, notes, and snippets.

@medwig
medwig / buildspec-terraform-symlinks.yml
Created April 23, 2019 13:29
Repair symlinks in AWS codepipeline
@peterwake
peterwake / aws_move.rb
Created December 11, 2018 16:06
AWS folder move using threading
# This is a sample class that you'll probably need
# to do a bit of work on for your own needs, but it
# will hopefully save you a lot of the headaches that we had
class AwsMove
FIVE_MB = 5 * 1024 * 1024
MAX_THREADS = 25
def move_folder(s3_client, old_key, new_key)
# strip preceding '/'
@pat
pat / LICENSE.txt
Last active February 4, 2023 21:02
Running Setup SQL scripts on an RDS instance within a VPC, via Terraform
The MIT License (MIT)
Copyright (c) 2018 Pat Allan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@dale3h
dale3h / jail.local
Created June 29, 2018 15:47
[fail2ban] Improved nginx-badbots
# Add to file: /etc/fail2ban/jail.local
[nginx-badbots]
enabled = true
port = http,https
filter = nginx-badbots
logpath = %(nginx_access_log)s
maxretry = 1
findtime = 604800
bantime = 604800
@korny
korny / sphinx.rb
Created June 13, 2018 23:21
Sphinx Homebrew formula for MySQL 5.7
class Sphinx < Formula
desc "Full-text search engine"
homepage "http://www.sphinxsearch.com"
url "http://sphinxsearch.com/files/sphinx-2.2.11-release.tar.gz"
sha256 "6662039f093314f896950519fa781bc87610f926f64b3d349229002f06ac41a9"
head "https://github.com/sphinxsearch/sphinx.git"
bottle do
sha256 "b890cf523db9777c7d125842fd6b0a53fe9a7a5a4cb816389ba6f5ee6483c78d" => :high_sierra
sha256 "55ce34bdedf13946fa614bde50839d93135eae720f1021e2c87807d04515ab18" => :sierra
@nruth
nruth / selenium.rb
Last active March 22, 2023 13:10
translating old capybara selenium/chrome preferences and switches to new
# load into test setup after `require 'capybara/rails'`
# some sources for below flags and profile settings
# https://stackoverflow.com/questions/43143014/chrome-is-being-controlled-by-automated-test-software/43145088
# https://sqa.stackexchange.com/questions/26051/chrome-driver-2-28-chrome-is-being-controlled-by-automated-test-software-notif
# http://stackoverflow.com/questions/12211781/how-to-maximize-window-in-chrome-using-webdriver-python
# update sources for new Options object
# https://github.com/SeleniumHQ/selenium/wiki/Ruby-Bindings
# https://github.com/teamcapybara/capybara/blob/master/lib/capybara/selenium/driver.rb
begin
@xenjke
xenjke / spec_helper.rb
Created January 20, 2017 08:25
RSpec Slack reporter/listener
require_relative 'spec_reporter'
RSpec.configure do |config|
#custom listener
if ENV['REPORT'] == 'slack'
config.reporter.register_listener Listener.new, :start, :example_started, :example_passed, :example_failed, :dump_summary
end
end
@davidderus
davidderus / .dockerignore
Last active March 3, 2024 10:15
Docker + Rails + Puma + Postgres + Nginx
.git
.gitignore
/doc
.yardoc
coverage
jsdoc
/tmp
/log
Dockerfile
Dockerfile.prod
@AJMaxwell
AJMaxwell / nginx-openssl_build.sh
Last active September 12, 2021 20:57
Install Nginx, OpenSSL, and ngx_pagespeed from source on Ubuntu 14.04
#!/bin/bash
##############################################################################################
## Install Nginx with OpenSSL, and ngx_pagespeed
##
## Author: Andrew Maxwell <[email protected]>
## Date: 2017/09/18
## Version: 0.3
##
## Disclaimer: I am not responsible for how you use this script. Do not assume this script
@joekr
joekr / Dockerfile-Nginx
Last active January 9, 2025 12:22
Kubernetes + Rails (NGINX & Unicorn) on GCE
# Set nginx base image
FROM nginx
# Copy custom configuration file from the current directory
COPY nginx.conf /etc/nginx/nginx.conf