Skip to content

Instantly share code, notes, and snippets.

View aaronaddleman's full-sized avatar

Aaron Addleman aaronaddleman

View GitHub Profile
@aaronaddleman
aaronaddleman / gist:52c662c024aeee089595
Last active August 29, 2015 14:13
Show important methods for a ruby object
# Method 1
class Object
# Return only the methods not present on basic objects
def interesting_methods
(self.methods - Object.instance_methods).sort
end
end
# Method 2
Class.instance_methods(false)
@aaronaddleman
aaronaddleman / gist:9c6d1ee7c87b3a410bda
Created January 8, 2015 17:46
Instructions on how to install Passenger and host Ruby on Rails with either Virtualhost or RailsBaseURI
gem install passenger
port install apache2
export APXS=/opt/local/apache2/bin/apxs
passenger-install-apache2-module
@aaronaddleman
aaronaddleman / gist:86b6a299aa60f0f2f4c5
Created January 8, 2015 17:50
To host your rails app with either a virtual host or Alias method with RailsBaseURI /path/to/app/dir (Virtual host method)
# Virtual host method
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/public
</VirtualHost>
@aaronaddleman
aaronaddleman / gist:ecfc08de8cee4d7c9623
Created January 8, 2015 17:53
To host your rails app with either a virtual host or Alias method with RailsBaseURI /path/to/app/dir (Alias with Virtual host method)
# in shell
cd /somewhere/already
ln -s /rails_app/public /new_app
# in apache.conf
<VirtualHost *:80>
ServerName www.yourhost.com
DocumentRoot /somewhere/already
RailsBaseURI /new_app
</VirtualHost>
@aaronaddleman
aaronaddleman / apache.conf
Created January 9, 2015 16:13
Instructions on how to install Passenger and host Ruby on Rails with either Virtualhost or RailsBaseURI (Apache.conf)
LoadModule passenger_module /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /opt/local/lib/ruby/gems/1.8/gems/passenger-2.0.6
PassengerRuby /opt/local/bin/ruby
@aaronaddleman
aaronaddleman / port_mapping.sh
Last active August 29, 2015 14:18
bash function for mapping ports over jump host
# $1 = username
# $2 = left_port
# $3 = right_port
# $4 = final_port
function p2p {
ssh -At $1@hostone -L $2:localhost:$3 ssh -At hosttwo -L $2:localhost:$3 -At ssh hostthree -L $2:localhost:$4
}

Keybase proof

I hereby claim:

  • I am aaronaddleman on github.
  • I am addlema (https://keybase.io/addlema) on keybase.
  • I have a public key whose fingerprint is CADE E0FC 983A 45E7 03FF C7E0 BEA4 7B59 27AE 6EC9

To claim this, I am signing this object:

@aaronaddleman
aaronaddleman / keybase.md
Created January 14, 2018 04:02
keybase.md

Keybase proof

I hereby claim:

  • I am aaronaddleman on github.
  • I am aaronaddleman (https://keybase.io/aaronaddleman) on keybase.
  • I have a public key ASCC4jHeYgDuLdjPw0AjlFhvGm4rfymjua7e7shGfQZqwwo

To claim this, I am signing this object:

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.