Blog Archives

start delayed job on reboot [sh script]

Short way: Making script run at boot time at Debian Manual Way: cd /etc/init.d && sudo nano delayed_job_script Paste following code to delayed_job_script: Note: change RAILS_ROOT and ENV variables according to your setup. #!/bin/sh RAILS_ROOT=”/home/deploy/apps/ProjectFolder/current” ENV=”production” case “$1” in start)

Tagged with: , ,
Posted in Ubuntu

Ubuntu Server Basic Libraries [ with SSL, nokogiri, postgress and nodjs ]

To install basic tools and nokogiri libraries sudo apt-get install git build-essential patch ruby-dev zlib1g-dev liblzma-dev sudo apt-get install -y libssl-dev libreadline-dev Uglifier required library sudo apt-get install nodejs Postgres required library sudo apt-get install libpq-dev Install and Setup Nginx

Tagged with:
Posted in Nokogiri, postgres, Ubuntu

Create and integrate SSL certificate in Rails app Using [ Godaddy + Nginx(1.8) + Puma + Ubuntu Server(14.04 LTS) ]

Login to your server by ssh and then: Create file YOUR_RAILS_APP_DIRECTORY/config/puma.rb Below is puma.rb file content: #!/usr/bin/env puma directory ‘/home/ubuntu/YOUR_RAILS_APP_DIRECTORY/public/’ rackup ‘/home/ubuntu/YOUR_RAILS_APP_DIRECTORY/’ environment ‘production’ daemonize true pidfile ‘/home/ubuntu/YOUR_RAILS_APP_DIRECTORY/tmp/pids/’ state_path ‘/home/ubuntu/YOUR_RAILS_APP_DIRECTORY/tmp/pids/puma.state’ stdout_redirect ‘/home/ubuntu/YOUR_RAILS_APP_DIRECTORY/log/puma.log’ threads 2, 5 bind ‘unix:///home/ubuntu/YOUR_RAILS_APP_DIRECTORY/tmp/sockets/puma.sock’ workers 2 Generate

Tagged with: , , ,
Posted in amazon, DNS, Godaddy, Nginx, production, Puma, Ruby on Rails, Ubuntu

rbenv install 2.2.1 ruby not working

After running this command: rbenv install 2.2.1 Faced error below: Installing ruby-2.2.1… BUILD FAILED (Ubuntu 14.04 using ruby-build 20150928-2-g717a54c) Inspect or clean up the working tree at /tmp/ruby-buil Install ‘libffi-dev’ package using command below, then above command will work: sudo

Posted in missing liberaries, Ruby on Rails, Ubuntu

Weka jar file placement and GUI runner in Linux/Ubuntu

Weeka instalation: 1. Download Weeka 2. Unzip the folder. 3. move into folder by using this command cd path/to/folder 4. move weka.jar file from that folder to /usr/share/java by using command below: sudo mv weka.jar /usr/share/java Weeka GUI runner: 1.

Tagged with: , , , ,
Posted in DataMining, MachineLearning, Ubuntu, Weka

install redis in ubuntu

wget tar xvzf redis-stable.tar.gz cd redis-stable make sudo apt-get install redis-server To check redis redis-cli ping

Posted in Redis

Connect to server using ssh and make password free enviornment

Connect to ssh server: $ ssh serverip -l username Enter user password: username@serverip’s password: change password command: $ passwd Password Free environment: Generate ssh-key: cd ~/.ssh ssh-keygen -t rsa append string in authorized_keys file[1]: ssh-copy-id -i ~/.ssh/ remote-host username@remote-host’s password:

Tagged with: ,
Posted in ssh, Ubuntu, Uncategorized

Ownership and permissions of files/folders Ubuntu

Ubuntu -> Change owner name: sudo chown owner_name -R www/

Posted in Ubuntu

Warning! PATH is not properly set up, /.rvm/gems/ruby-1.9.3-p448′ is not at first place

Warning! PATH is not properly set up, /.rvm/gems/ruby-1.9.3-p448′ is not at first place ————— /usr/lib/ruby/vendor_ruby/railties/lib/rails_generator/options.rb:32:in `default_options’: undefined method `write_inheritable_attribute’ for Rails::Generator::Base:Class (NoMethodError) Solution: 1. locate .bashrc 2. opened file “/home/[user_name]/.bashrc” 3. place this line at end of file [[ -s

Tagged with:
Posted in Ruby on Rails, Ubuntu

Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2) (Mysql2::Error)

1. Remove this line from config/database.yml production socket: /var/run/mysqld/mysqld.sock 2. Restart your Rails Server In my case command was: touch tmp/restart.txt 3. Start mysqld using command below: /etc/init.d/mysqld start

Tagged with:
Posted in Mysql, Ubuntu