Skip to content

Instantly share code, notes, and snippets.

View EBashkoff's full-sized avatar

Eric Bashkoff EBashkoff

View GitHub Profile
sudo lsof -i tcp:5000
ps aux | grep 5000
@EBashkoff
EBashkoff / single_test_run
Created February 17, 2017 21:08
Run single rake test in file
rake test TEST=test/controllers/api/respond/v1/leads_controller_test.rb TESTOPTS="--name='/test_title/'"
@EBashkoff
EBashkoff / copy-db-other-env.txt
Created January 16, 2017 19:57
Copy staging DB to QA
heroku pg:backups restore $(heroku pg:backups public-url -a doris-staging) DATABASE_URL -a doris-qa
@EBashkoff
EBashkoff / run_docker_img_locally.txt
Created November 22, 2016 21:38
Pull docker image from AWS and run it locally
1. Log into AWS TPHub Dev via move.okta.com.
2. Go to EC2 Container Service and find the realsuite-widgets-respond app - click on it.
3. Click on "Tasks" tab.
4. Click on the Task Definition.
5. Get the Docker Image Definition and copy it to the clipboard.
6. In your local terminal:
$ docker-machine stop
$ docker-machine start default
$ eval $(docker-machine env default)
$ docker run -p 80:8000 -e NODE_ENV='development' -e ENV_PROFILE='development' -e REALSUITE_URL='http://controllo.local' docker.moveaws.com:443/prosoft/prosoft-realsuite-widget:2.0.0.4340.71b6b8f
@EBashkoff
EBashkoff / remote_rmate.txt
Created November 16, 2016 13:20
Open local edit from remote terminal window.
ssh your_user_name_on_the_server@your_server_ip_address
Once you are logged in, you can write:
1 sudo apt-get install ruby
2 sudo gem install rmate
If the above commands were successful, you are again on your local machine. You will need to redo the next step every time you want to connect to your server, and locally edit a file. Now, we need to create a connection between our local machine and the server. If you are on Linux or OSX write:
ssh -i "<your pem file> -R 52698:localhost:52698 your_user_name_on_the_server_@your_server_ip_address
@EBashkoff
EBashkoff / dj_objects.txt
Created December 14, 2015 16:15
Get Objects from Delayed Job
Get a deserialized object from a delayed job:
1. Get the delayed_job record using the id: dj = DelayedJob.find(<id>)
2. Get the handler field from dj: dj.handler
3. Convert it from YAML: YAML.parse(dj.handler)
4. You can get the ruby objects that the delayed job was built with by converting that to_ruby and calling the object:
YAML.parse(dj.handler).to_ruby.user
YAML.parse(dj.handler).to_ruby.prospect
YAML.parse(dj.handler).to_ruby.agent
etc.