Skip to content

Instantly share code, notes, and snippets.

View tobypinder's full-sized avatar
📦
contained

Toby Pinder tobypinder

📦
contained
View GitHub Profile
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
anonymous
anonymous / stdlib.sh
Created June 20, 2017 00:17
aws_ecr_curl() {
login_cmd=$(aws ecr get-login)
username=$(echo "$login_cmd" | cut -d " " -f 4)
password=$(echo "$login_cmd" | cut -d " " -f 6)
endpoint=$(echo "$login_cmd" | cut -d " " -f 9)
args=("$@")
args_length=${#args[@]}
args_last=${args[$args_length-1]}
unset 'args[${args_length}-1]'
@makolesnik
makolesnik / browsermob_capybara_chrome.rb
Last active May 11, 2021 16:03
Testing response with browsermob-proxy, capybara/selenium and chrome
require 'capybara'
require 'capybara/dsl'
require 'browsermob/proxy'
require 'selenium-webdriver'
include Capybara::DSL
# Download browsermob-proxy.
# Set JAVA_HOME for browsermob proxy
@stevegrossi
stevegrossi / jmeter.rb
Last active March 19, 2018 16:16
Sample JMeter test plan using the ruby-jmeter gem
#!/usr/bin/env ruby
require 'ruby-jmeter'
test do
defaults domain: 'beta.stevegrossi.com'
cookies clear_each_iteration: true
@rkjha
rkjha / nginx-config-rails4-with-puma-ssl-version.conf
Last active November 2, 2023 11:57
Nginx config for rails 4 application using puma [ssl and non-ssl version]
upstream myapp_puma {
server unix:/tmp/myapp_puma.sock fail_timeout=0;
}
# for redirecting to https version of the site
server {
listen 80;
rewrite ^(.*) https://$host$1 permanent;
}
@traviskroberts
traviskroberts / gist:2830535
Created May 29, 2012 20:33
FactoryGirl Polymorphic Association
class Alert < ActiveRecord::Base
belongs_to :alertable, :polymorphic => true
end
class Region < ActiveRecord::Base
has_many :alerts, :as => :alertable
end
@jeffkreeftmeijer
jeffkreeftmeijer / README.textile
Created November 14, 2010 23:25
A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

FffuuuFormatter

A stupid RSpec formatter that prints FFFUUU instead of FFFFF. Heh.

Installation

Throw it in a file and run your specs like this:

$ rspec -r path/to/fffuuu_formatter.rb -f FffuuuFormatter spec/