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
## Create a SSH key | |
$ cd ~/.ssh/ | |
$ ssh-keygen -t rsa | |
## Stop asking for password on remote login | |
# add the public key to the authorized keys in the remote server | |
ssh user@server mkdir -p .ssh | |
# cat ~/.ssh/id_rsa.pub | ssh root@[your.ip.address.here] "cat >> ~/.ssh/authorized_keys" | |
cat ~/.ssh/id_rsa.pub | ssh user@server 'cat >> ~/.ssh/authorized_keys' |
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
## user_collectionrn (model) | |
class UserCollection < ActiveRecord::Base | |
# instead of delete a collection, mark it as archived, the find method will not return it | |
def archive | |
self.archived = true | |
self.save | |
end | |
def self.find_unarchived(id) |
NewerOlder