Skip to content

Instantly share code, notes, and snippets.

@mamashin
mamashin / gist:afb0e31999b1615428dede37883ef186
Created March 23, 2017 08:15
tcpdump show only HTTP headers
tcpdump -i eth0 -A -s 10240 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)' | egrep --line-buffered "^........(GET |HTTP\/|POST |HEAD )|^[A-Za-z0-9-]+: " | sed -r 's/^........(GET |HTTP\/|POST |HEAD )/\n\1/g'
@baweaver
baweaver / ruby_books.md
Last active July 12, 2024 06:56
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

@joost
joost / force_non_ssl.rb
Last active January 26, 2017 02:01
Force non SSL Rails Concern. Inverse of force_ssl method. Accepts same options. Add to your app/controllers/concerns/ directory.
# Usage:
# In your (Application)Controller:
# include Concerns::ForceNonSSL
# force_non_ssl
#
# You can use the same options as with force_ssl.
# See: http://api.rubyonrails.org/classes/ActionController/ForceSSL/ClassMethods.html#method-i-force_ssl
#
# Code based on: https://github.com/rails/rails/blob/ab08519b1aed46dbd4b3e13932bbaddfe42d8315/actionpack/lib/action_controller/metal/force_ssl.rb
#
@trcarden
trcarden / gist:3295935
Created August 8, 2012 15:28
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@amardaxini
amardaxini / activesupportconcern.rb
Created May 4, 2011 07:07
Active support concern handling
# Test1
module M
def foo
puts "M"
end
end
module N
include M
def foo