To list the indexes for a specific table in the console, run the following command: ActiveRecord::Base.connection.indexes(:transactions)
Month: August 2016
Linux, get number (octal) file permission
To get the number (octal) file permission use the following: stat -c “%a” your.file
Capistrano, Rbenv, bundle: command not found
After running cap production deploy:restart Our remote Puma log would show the following: -su: bundle: command not found However, this was an active production server, so the bundler gem existed. After logging in and attempting to run a simple command, such as: bundle exec rails console The console would output the following: […]
Ubuntu – get parent PID (ppid) from child PID
To get the parent(s) of a pid, run the following command, where “123” equals the child pid: ps -o ppid=123
Ubuntu – Monitor current memory usage from command line
To watch your current memory usage in real time, run the following command: watch -n 5 free -m