Wednesday, November 19, 2014

Change Date with Zone from terminal in linux

date command is used for display date in terminal

you can use --set attribute for set time with zone

date --set="Wed Nov 19 01:11:00 EST 2014"

cat few lines from file from terminal in linux

If you want to get 50 lines after line 7500 then you can get it by below command

sed -n '7500,+50p'  filename

So here 7500 is the line from where i want to get lines
and 50 is the number of lines which i like to read

Wednesday, October 1, 2014

Command to check which service used how much memory on Linux

Many linux users and new on linux users have an issue to know that which processes uses how much memory on his machine or on server, So they cant able to debug the memory issue on server

Here is the command which you can use to know that which services uses how much memory

ps -eo rss,pid,user,command --sort -size | awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' | egrep -v 0.00

One more thing that might helps if you found more memory usage
Here is Command for clear cache
sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"


Hope this helps !!

Cheers

wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory

If you get this error while install wkhtmltopdf on centos/fedora then install below packages

1. yum install libXext  libXrender  fontconfig  libfontconfig.so.1
2. yum install urw-fonts 

Hope this helps !!

cheers

Tuesday, September 23, 2014

Install Ruby and Capistrano without Rails

Below are the steps which you can follow to use capistrano deployment script to deploy any project
 
1. Install Curl
2. Install RVM by below curl (Ref: http://rvm.io/rvm/install)
   \curl -sSL https://get.rvm.io | bash -s stable   
3. source ~/.rvm/scripts/rvm
4. type rvm | head -n 1
5. rvm install 2.0.0
6. ruby -v
7. gem install capistrano (Ref: http://ryanflorence.com/deploying-with-capistrano-without-rails/)
8. gem install railsless-deploy

Friday, August 29, 2014

Gemset '' does not exist, 'rvm ruby-1.9.3-p547 do rvm gemset create ' first, or append '--create'.

I get one error while try to install ruby 1.9.3 with rvm 1.25.28

rvm install 1.9.3

Error: 
There was an error while trying to resolve rubygems version for 'latest'.
Halting the installation

rvm use 1.9.3

Error:
Gemset '' does not exist, 'rvm ruby-1.9.3-p547 do rvm gemset create ' first, or append '--create'.


To solve the above error
rvm use 1.9.3@newgemset --create --default

Hope this helps who install ruby 1.9.3 with rvm 1.25.28

Contact Me for any help regarding rails/nodejs/php/mysql

Name

Email *

Message *