Display line numbers in GNU Nano text editor

These days developers go for heavy text-editors and IDEs like InteliJ, PyCharm, RubyMine, Sublime Text with much more extensions, Vim, Emacs, etc. However, in case of the later two they are not memory and processor heavy however they have very steep learning curves.

On the other hand, GNU Nano come as a life saver. It requires a few MB of RAM(say 3-4 MB) and uses very less CPU resource. Nano is a much powerful tool with much more features.

Continue reading

Advertisements

Simply Deploy React.js App to Heroku

If you have read my another post about creating a ToDo app in react you are good to go; if not see this post.

You know that React App is a single page application containing only static assets. So, you only need to setup a mechanism to serve your static assets like CSS, JS, HTML, IMAGE, etc. files when clients ask for. Either you can use market leader HTTP servers like Apache, Nginx, etc or simple Express server that runs in Node.js.

Continue reading

Some useful monit commands and configs

Config for Sidekiq

# Monit configuration for Sidekiq : myAPP

check process sidekiq_thepact_qa0
 with pidfile "/home/deployer/www/qa/shared/tmp/pids/sidekiq.pid"
 start program = "/bin/su - deployer -c 'cd /home/deployer/www/qa/current && /usr/local/rvm/bin/rvm default do bundle exec sidekiq --config /home/deployer/www/qa/current/config/sidekiq.yml --index 0 -e qa -d'" with timeout 30 seconds
stop program = "/bin/su - deployer -c 'cd /home/deployer/www/qa/current && /usr/local/rvm/bin/rvm default do bundle exec sidekiqctl stop /home/deployer/www/qa/shared/tmp/pids/sidekiq.pid'" with timeout 110 seconds
 group myapp-sidekiq-qa

Commands

reload configuration

$ sudo monit reload

start monit

$ sudo service monit start

 

Engineyard : Deployment : Passing multiple Environment variables to deploy hooks

Engineyard has made it easier to send environment variables to deploy hook when you execute the deployment command from client console. Environment variable is not the exact terminology to be used. EY sends it as configuration hash.  You may want/need to send environment variables in situations such as:

  • When you want to detect that this is the attempt when you want your seeds ( Data defined in seed.rb) to be committed to database.
  • When you want specific services or packages like Elastic Search to reindex the records

Continue reading