Copy remote folder to local
To copy a folder in the remote server to your local machine,
scp -r username@IPaddres:/remote/directory/path /local/folder/
In case you wish to copy in your current local directory
scp -r username@IPaddres:/remote/directory/path/ .
Related cards:
copy and paste in terminal
To copy code from the terminal use
- Cntrl + Insert
- Rightclick + copy text
To paste code into the terminal use
- Shift + Insert
- Rightclick + p
add sublime text option to the contextual menu
After installing sublime text, we must be able to open text files with it. Right click on a text file and you must see the option "open with sublime text". In case you don't , click Open with other applications and you should see Sublime text opti...
unable to run package setup for sublime text
I've encountered the following error after installing Sublimetext2 from source on my ubuntu machine. The error says
unable to run package setup with list of packages
in a dialog box when sublime text is opened.
The issue is because of missing...
/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf
Use following command and answer YES to enable dynamic updates:
sudo dpkg-reconfigure resolvconf
Do a system restart after that.
ssh login without password
Nothing new .. just a note to self about how easy this is
> ssh-keygen [Enter] [Enter] [Enter]
> ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote-host
> ssh user@remote-host
||= operator in Ruby
x ||= y is similar to x || x = y.
In the above statement, if x evaluates to logical true then assignment is not done.
If x evaluates to logical false only then the assignment is done.
Though the above two statements are similar, there are...
Retrieve SQL query in Rails 2.x
The method is construct_finder_sql(options) (lib/active_record/base.rb:1681) you will have to use send because it is private.
sql = Item.send :construct_finder_sql, :select => :all, :include => [:categories, :prices], :conditions => cond...
Adobe flash player installation in ubuntu chromium browser
For Chromium browser versions greater than 34, to use flash one must install Pepper flash.
For Ubuntu 14.04 or newer, run
sudo apt-get install pepperflashplugin-nonfree
sudo update-pepperflashplugin-nonfree --status
# to see what version of...
Passing objects using redirect_to
Scenario : You have some manipulation done in your controller action and redirect the user to another action after that. Now you want the output of the manipulation available in the page user is redirected to.
You can pass the object with redirec...
Fixing "uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)"
If you have to work with older versions of Rails, there might be discrepancy between the versions of Rails and Rubygems. Theats when you likely see the below message when you try to boot your rails app.
/home/lt-pc-528/.rvm/gems/ruby-1.8.7-p...