Skip to content

Instantly share code, notes, and snippets.

View invalidusrname's full-sized avatar
🤷‍♀️

Matt invalidusrname

🤷‍♀️
View GitHub Profile
@invalidusrname
invalidusrname / base_policy.rb
Last active April 3, 2019 20:05
Canner base policy
class BasePolicy < Canner::Policy
def fetch_roles
@current_user.roles
end
end

[APP NAME]

This is a short description of your app.

Getting Started

Requirements

Setup

@invalidusrname
invalidusrname / cert_checker.rb
Last active August 29, 2015 14:14
Check certs
require 'net/https'
url = "https://www.google.com"
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_PEER
http.start { |h| @cert = h.peer_cert }
@cert
@cert.not_after
@invalidusrname
invalidusrname / Puppetfile
Last active April 3, 2019 15:34
postgres 9.4 puppet variables
postgresql::globals::version: "9.4"
postgresql::globals::client_package_name: "postgresql-client-9.4=9.4.0-1.pgdg12.4+1"
postgresql::server::package_ensure: "9.4.0-1.pgdg12.4+1"
postgresql::major_version: &pg_major_version 9.4
@invalidusrname
invalidusrname / elixir_conf_2014.sh
Last active April 3, 2019 15:17
Elixir Conf 2014
http://www.youtube.com/watch?v=ptZHBePX0oI&variant=MP4_1080
http://www.youtube.com/watch?v=7l_fDU86pr4&variant=MP4_1080
http://www.youtube.com/watch?v=d5G3P2iosmA&variant=MP4_1080
http://www.youtube.com/watch?v=5LRDICEETRE&variant=MP4_1080
http://www.youtube.com/watch?v=3jMbzGv_6tA&variant=MP4_1080
http://www.youtube.com/watch?v=zNNGTiTArJw&variant=MP4_1080
http://www.youtube.com/watch?v=hxNalzuBbSw&variant=MP4_1080
http://www.youtube.com/watch?v=R_8ehmGTVbw&variant=MP4_1080
http://www.youtube.com/watch?v=XbD1Emhm31w&variant=MP4_1080
http://www.youtube.com/watch?v=VAa7YnZo0hU&variant=MP4_1080
@invalidusrname
invalidusrname / cleanup.sh
Last active April 3, 2019 15:08
capistrano cleanup across repos
for app in /var/repos/*; do if [ -f $app/Capfile ]; then cd $app; bundle; bundle exec cap deploy:cleanup -s keep_releases=2; fi; done;
@invalidusrname
invalidusrname / download_rubytapas.rb
Last active April 3, 2019 15:08 — forked from xpepper/download_rubytapas.rb
Old way of downloading rubytapas videos
username = ARGV[0]
pwd = ARGV[1]
target_path = ARGV[2]
unless ARGV.size == 3
puts "usage: ruby download_rubytapas.rb username password save_path"
exit(1)
end
target_path = File.expand_path(target_path)
@invalidusrname
invalidusrname / config.yml
Last active August 29, 2015 14:01
docker-registry config
# Set env vars for AWS_* when launching - this config will refer to them.
# To specify prod flavor, set the environment variable SETTINGS_FLAVOR=prod
# example launching with this config, in a docker image:
# docker run -p 5000:5000 -e SETTINGS_FLAVOR=prod -e AWS_KEY=X -e AWS_SECRET=Y -e AWS_BUCKET=images registry-image
common:
boto_bucket: _env:AWS_BUCKET
s3_access_key: _env:AWS_KEY
s3_secret_key: _env:AWS_SECRET
@invalidusrname
invalidusrname / expiring_certs.sh
Created April 18, 2014 20:56
get expiring certificates
for cert in `find /etc/ssl/certs | grep crt | sort`; do basename $cert; openssl x509 -noout -in $cert; openssl x509 -noout -in $cert -dates ; echo ''; done
@invalidusrname
invalidusrname / docker.sh
Created April 11, 2014 19:23
docker misc commands
# docker cleanup
docker ps -a | grep Exit | awk '{ print $1 }' | xargs docker rm
docker images | grep none | awk '{ print $3 }' | xargs docker rmi