Skip to content
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
View ls-on-file-watch.js
"use strict";
const fs = require('fs'),
spawn = require('child_process').spawn,
fileName = process.argv[2],
spawnCmd = process.argv[3],
spawnArgs = process.argv.slice(4, process.argv.length);
console.log([typeof spawnArgs, spawnArgs]);
if (!fileName) {
View file-watcher.js
const fs = require('fs'),
fileName = process.argv[2];
if (!fileName) {
throw Error("need to specify file to watch!");
}, function() {
console.log("file '"+ fileName + "' just changed");
Something went wrong with that request. Please try again.