Skip to content

Instantly share code, notes, and snippets.

View adam-phillipps's full-sized avatar

Adam adam-phillipps

  • NGage
  • Salt Lake City, UT.
View GitHub Profile
1. sudo adduser adam
2.
password enter (anandjesse) or (anandjesse801) most likely the former
password enter
adam phillipps enter
enter
enter
enter
enter
y enter
[Wed Jun 10 22:19:42.739500 2015] [mpm_event:notice] [pid 21654:tid 139715067721600] AH00489: Apache/2.4.7 (Ubuntu) configured -- resuming normal operations
[Wed Jun 10 22:19:42.739580 2015] [core:notice] [pid 21654:tid 139715067721600] AH00094: Command line: '/usr/sbin/apache2'
[Wed Jun 10 23:43:47.690750 2015] [mpm_event:notice] [pid 21654:tid 139715067721600] AH00493: SIGUSR1 received. Doing graceful restart
[ 2015-06-10 23:43:47.7112 1911/7f3ef535e7c0 age/Wat/Main.cpp:1293 ]: Starting PassengerAgent watchdog...
[ 2015-06-10 23:43:47.7267 1914/7f23c3bc47c0 age/Hel/Main.cpp:957 ]: Starting PassengerAgent server...
[ 2015-06-10 23:43:47.7268 1914/7f23c3bc47c0 age/Hel/Main.cpp:234 ]: PassengerAgent server running in multi-application mode.
[ 2015-06-10 23:43:47.7287 1914/7f23c3bc47c0 age/Hel/Main.cpp:707 ]: PassengerAgent server online, PID 1914
[ 2015-06-10 23:43:47.7439 1921/7f3ab135c7c0 age/Log/Main.cpp:430 ]: Starting PassengerAgent logger...
[ 2015-06-10 23:43:47.7445 1921/7f3ab135c7c0 age/Log/Main.cpp:
@adam-phillipps
adam-phillipps / gist:056cbd35194ebf61752b
Created June 8, 2015 21:56
adam's sublime text 3 user profile
{
"always_prompt_for_file_reload": false,
"always_show_minimap_viewport": false,
"animation_enabled": true,
"atomic_save": false,
"auto_close_tags": true,
"auto_complete": true,
"auto_complete_commit_on_tab": false,
"auto_complete_cycle": false,
"auto_complete_delay": 50,
@adam-phillipps
adam-phillipps / huge_code.madeup
Created May 13, 2015 22:28
a huge chunk of code!
lots_of (stuff, &block){
code
code
code
code
code
code
code
code
code
adam-laptop:saws adam$ bundle exec rake db:drop db:create db:migrate
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
/Users/adam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `connect'
/Users/adam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `initialize'
/Users/adam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `new'
/Users/adam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/mysql2_adapter.rb:18:in `mysql2_connection'
/Users/adam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
/Users/adam/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
/Users/a
ubuntu@ip-172-31-43-171:/opt/saws$ passenger start -a 127.0.0.1 -e production
=============== Phusion Passenger Standalone web server started ===============
PID file: /opt/saws/tmp/pids/passenger.3000.pid
Log file: /opt/saws/log/passenger.3000.log
Environment: production
Accessible via: http://127.0.0.1:3000/
You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/documentation/Users%20guide%20Standalone.html#troubleshooting
===============================================================================
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: Gemfile
modified: Gemfile.lock
modified: app/models/contract.rb
modified: config/database.yml
modified: config/secrets.yml
447 git add Gemfile.lock app/controllers/contracts_controller.rb app/controllers/smash_clients_controller.rb app/models/contract.rb app/models/smash_client.rb app/views/smash_clients/_form.html.haml db/schema.rb db/migrate/20150415044644_add_instance_type_to_contracts.rb public/assets/
448 git status
449 git commit -m 'holy shit i did it'
450 git push
451 git push --set-upstream origin subclass-instances
452 git checkout master
453 git merge subclass-instances
454 git push origin/master
455 git push
# finds the best price and returns it + 20% with the region or AZ(i don't remember which)
def spot_shopper( image )
spot_prices = []
ec2 = self.smash_client.aws_client
tags = image.tags
all_zones.each do |az|
spot_prices << ec2.describe_spot_price_history(
start_time: (Time.now + 36000).iso8601.to_s,
instance_types: [tags.select{|t| t.key.eql? 'instance_types' }.first.value],
product_descriptions: [tags.select{|t| t.key.eql? 'product_descriptions' }.first.value],
[22, 31] in /home/ubuntu/saws/app/models/contract.rb
22: end
23: rescue => e
24: "error starting instance: #{e}"
25: end
26: byebug
=> 27: instance
28: end
29:
30: def stop_instances