This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file_names = Dir["db/migrate/*"] | |
file_names.each do |file_name| | |
lines = File.readlines(file_name) | |
lines[0] = lines[0].gsub('ActiveRecord::Migration', 'ActiveRecord::Migration[5.2]') | |
File.open(file_name, 'w') { |f| f.write(lines.join) } | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo su postgres -c psql template1 | |
template1=# ALTER USER postgres with PASSWORD 'password'; | |
template1=# \q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type f -exec grep -i "text_to_find" {} \; -print |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To uninstall ALL gems | |
for i in `gem list --no-versions`; do gem uninstall -aIx $i; done |