Skip to content
# provisioning a rails stack with
# - ngixn web server and reverse proxy
# - puma app server
# - redis
# - elasticsearch
# - Amazon RDS using etc for the SQL database
# installed on an AWS EC2 instance running Ubuntu 14.04 LTS
# fix locale.
# needed to remove login warning
View docs confused why we need `extern crate` and use both.txt
as a rust noob and coming from ruby
was confused why we need `extern crate` and `use` both ?
the `guessing-game` chapter has these two paragraphs:
The first thing we’ve done is change the first line. It now says
`extern crate rand`. Because we declared `rand` in our `[dependencies]`, we
can use `extern crate` to let Rust know we’ll be making use of it. This also
does the equivalent of a `use rand;` as well, so we can make use of anything
View debug-rails-app-written-by-other.txt
1. view paths ?
2. where are the layout and view file located ?
3. is the database.yml valid ?
sanity check: eyeball if it is running locally.
4. any "very" old libs and/or known security vulnerabilities ?
for (1) can delete a partial and see the stacktrace
something like
View Cargo.lock
name = "hello_world"
version = "0.0.1"
dependencies = [
"rand 0.3.14 (registry+",
name = "libc"
version = "0.2.10"
View example nginx config.txt
# rails config needs `force_ssl`
# example:
# Force all access to the app over SSL, use Strict-Transport-Security,
# and use secure cookies.
# config.force_ssl = true
# and rails needs some headers to be set, otherwise will be trapped in a redirect loop
# nginx config for headers:
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto https;
View running overcommit hooks.23-feb-2016.txt
git commit
/usr/local/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/overcommit-0.32.0/lib/overcommit/git_version.rb:12: warning: Insecure world writable dir /usr in PATH, mode 040777
Running pre-commit hooks
Check for trailing whitespace....................[TrailingWhitespace] OK
✓ All pre-commit hooks passed
/usr/local/opt/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/overcommit-0.32.0/lib/overcommit/git_version.rb:12: warning: Insecure world writable dir /usr in PATH, mode 040777
Running commit-msg hooks
Check subject line................................[SingleLineSubject] OK
View overcommit
  • add overcommit. to catch things like, long commit messages

    echo "2.3.0" > .ruby-version gem install overcommit overcommit --install overcommit --sign run overcommit --list (to see list of hooks) run overcommit --run (to test it out once)

    some interesting hooks to try out, but not enabled:

alias ip="dig +short"
alias localip="ipconfig getifaddr en0"
View https-client.js
#!/usr/bin/env node --trace-sync-io
// curl command to test:
// curl --insecure -X GET -v https://localhost:3000/
// something similar in node using the https module
// works with:
// strictSSL: false, // allow us to use our self-signed cert for testing
// rejectUnauthorized: false
// no need to add
View ruby_ping.rb
# let us say you want to check if a host is reachable
# sometimes you need to be behind a private VPN or the host is just down
# and you want to do this on your local-machine and on Heroku
# can open your terminal and use ping on your local
# And can get a bash shell on Heroku as well - by `heroku run bash`
# but there is no `ping` binary there
# ```bash
Something went wrong with that request. Please try again.