This bugged me for some time before I finally looked for the solution. Turns out it was pretty simple. Before pasting the text, do the following set :paste Once you have pasted your text set :nopaste I know this can get inconvenient if you do a lot of copy pasting (which probably you shouldn’t). This […]Read more "Disable auto indent feature when pasting text in vim"
Today I found a really helpful and intuitive resource that you can use to understand crontab syntax. This site clearly tells you when a particular command set in cron will be executed. https://crontab.guru/ Really handy! Isn’t it! Caio!Read more "Crontab – Understand cron syntax with this Interactive resource"
Recently I created a Rails 4 application and deployed it to an Ubuntu system using Capistrano. As I had to make few tweaks and try couple of options, I thought I should document the process here so I could refer to it later when needed. This post is for providing pointers on deploying Rails 4 […]Read more "Deploying Rails 4 app with Passenger and Apache using Capistrano, Rbenv"
Sometimes while working on rails applications and running them on different ports, I end up getting ‘Address already in use’ error when starting a new application. Usually you can look for the processes with ps and grep the ones you are looking for. But if you are unable to find the process with ps or […]Read more "Address already in use errors – Find and kill process"
While working on one of our projects which uses SVN for version control, I had to merge in some changes from trunk to the branch. I did this as explained below: First checkout the branch where you want to merge revisions from trunk svn co http://svn_repo_url/project/branches/branch my_branch cd my_branch svn log -v –limit 100 # […]Read more "SVN – Merge trunk revisions into branch"
When you want to recursively copy files from one directory to another, use find and pipe its output to cpio. find . -name ‘*.jpg’ | cpio -pdm /path/to/<dest_dir> This will find all files with extension ‘jpg’ and copy them to <dest_dir> directory. cpio -pdm copies files to destination directory and also creates the directory structure. […]Read more "Linux – Copy files recursively preserving directory structure"
rbenv is a great tool which enables you to install and pick a ruby version for your application. It is light weight and works by inserting a directory of shims at the front of the PATH Install Homebrew – a great package manager: ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” Install rbenv – manage different versions on […]Read more "Install rbenv and ruby"