Skip to content

Instantly share code, notes, and snippets.

@boone
boone / strip_nil_from_parameters.rb
Created June 1, 2012 18:08
Monkey patch for CVE-2012-2660 and CVE-2012-2694 on Rails 2.3.14
# Monkey patch for CVE-2012-2660 and CVE-2012-2694 on Rails 2.3.14
# put this file in your config/initializers directory
# comments/corrections: https://gist.github.com/2854095
# Strip [nil] from parameters hash
# based on a pull request from @sebbacon
# https://github.com/rails/rails/pull/6580
module ActionController
class Request < Rack::Request
@boone
boone / fix_sql_injection.rb
Created June 13, 2012 03:42
Monkey patch for CVE-2012-2695 on Rails 2.3.14
# Monkey patch for CVE-2012-2695 on Rails 2.3.14
# put this file in your config/initializers directory
# comments/corrections: https://gist.github.com/2921706
# Ruby on Rails SQL Injection
# based on a patch from @presidentbeef
# https://rubyonrails-security.googlegroups.com/attach/aee3413fb038bf56/2-3-sql-injection.patch?view=1&part=3
module ActiveRecord
class Base
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active November 15, 2024 09:51
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@boone
boone / fix_sql_injection_2.rb
Last active December 10, 2015 13:18
Monkey patch for CVE-2012-5664 on Rails 2.3.14
# Monkey patch for CVE-2012-5664 on Rails 2.3.14
# put this file in your config/initializers directory
# comments/corrections: https://gist.github.com/2921706
# Ruby on Rails SQL Injection
# based on a patch from @tenderlove
# https://rubyonrails-security.googlegroups.com/attach/23daa048baf28b64/2-3-dynamic_finder_injection.patch?view=1&part=2
module ActiveRecord
class Base
@pnc
pnc / observer.md
Last active August 9, 2024 08:35
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host
@silviorelli
silviorelli / gist:ad8e1d80bdc0245eb7e7
Created February 3, 2016 09:34
Install Ruby 1.8.7 on Mac OSX 10.11 El Capitan with rbenv
brew install apple-gcc42 openssl libyaml libffi
xcode-select --install
export CC=/usr/local/bin/gcc-4.2
export CFLAGS='-g -O2'
export RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
export CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl`
rbenv install 1.8.7-p375
@singledigit
singledigit / cognito.yaml
Last active August 14, 2024 09:14
Create a Cognito Authentication Backend via CloudFormation
AWSTemplateFormatVersion: '2010-09-09'
Description: Cognito Stack
Parameters:
AuthName:
Type: String
Description: Unique Auth Name for Cognito Resources
Resources:
# Creates a role that allows Cognito to send SNS messages
SNSRole: