Thursday, November 21, 2013

How to deploy on Heroku

Pr-requisites:

1)Heroku account.
2)Working on RoR.

1) Install Heroku using
https://toolbelt.heroku.com/

2)Login to Heroku
Command: heroku login

3)Once logged in, go to your root file of your application.

4)Add a heroku key.
Command: heroku keys:add

5)Push your code.(considering you are on branch master)
Command: git push heroku master

6)

Saturday, November 16, 2013

Facing issues with ImageMagick

Error which I get is:

identify: no decode delegate for this image format `/tmp/stream20131115-12525-1jng9sh.png' @ error/constitute.c/ReadImage/552

What it means: It means that it does not recognize file type extension "png"

Solution:

I configure ImageMagick so that it is able to recognize png format.

What I did:

Checked the list of formats supported:

identify -list format

Found that jpeg and png were not there.

How to add them.

1) Download jpeg and png from http://www.imagemagick.org/download/delegaetes/
2)Execute "tar -xvf file_name.tar"
   Change directories to the newly created "file_name"
   Execute "./configure"
   Execute "make"
   Execute "make install"

Do the above for both jpeg and png.

3) Now we need to reconfigure ImageMagick:

Go to the folder where you have stored it.
 a) execute ./configure --with-jpeg=yes --with-jp2=yes -with-png=yes
 b) sudo make
 c) sudo make install

After this check whether it is there in DELEGATES.

execute
identify -list format

Both the formats should now be a part of format.

If the above gives error like:

“error while loading shared libraries: libjpeg.so.9: cannot open shared object file: No such file or directory”

execute :
sudo apt-get install libjpeg62


This would solve the problem. Enjoy.





Friday, November 15, 2013

Faced issue with LDAP while testing with Rspec in RoR application

Issue was with tmpdir.

Error:

Cannot guess tmpdir from the environment.  Please specify it.

How to solve this?

Well,

Just add a new variable to your bashrc (environment file in Ubuntu)

e.g.

  export TMPDIR=/tmp


And that's it. This would clear up.

Dont forget to source your bashrc file before running the tests.

For sourcing you do:

source ~/.bashrc

Enjoy!

Directory Tree of Ubuntu

Directory     Content
bin     Essential command binaries
boot     Static files of the boot loader
dev     Device files
etc     Host-specific system configuration
home     User home directories
lib     Essential shared libraries and kernel modules
media     Contains mount points for replaceable media
mnt     Mount point for mounting a file system temporarily
proc     Virtual directory for system information (2.4 and 2.6 kernels)
root     Home directory for the root user
sbin     Essential system binaries
sys     Virtual directory for system information (2.6 kernels)
tmp     Temporary files
usr     Secondary hierarchy
var     Variable data
srv     Data for services provided by the system
opt     Add-on application software packages

Thursday, November 14, 2013

Wednesday, November 13, 2013

What is TCP/IP

End to End connectivity, which specifies

How data is
1)formatted
2)addressed.
3)transmitted
4)routed
5)received
at the destination

It has 4 abstraction layers

1)Link Layer.
2)Internet Layer.
3)Transport Layer.
4)Application Layer.


How to use grep for checking whether files exists or not

1.
find /dir_path -type f -print | grep 'tmpdir' # that will show files what names contain tmpdir

Saturday, November 9, 2013

Git commands

1. 
# Get number of files added to the index (but uncommitted)
expr $(git status --porcelain 2>/dev/null| grep "^M" | wc -l)

# Get number of files that are uncommitted and not added
expr $(git status --porcelain 2>/dev/null| grep "^ M" | wc -l)

# Get number of total uncommited files
expr $(git status --porcelain 2>/dev/null| egrep "^(M| M)" | wc -l)
 
2. Great post
http://stackoverflow.com/questions/2452226/master-branch-and-origin-master-have-diverged-how-to-undiverge-branches
 

Monday, November 4, 2013

Installing Eclipse for Android Development

Steps

1. Install eclipse using Ubuntu Software Center.
2. Install the adt using the >>help>>install new software >> add url
https://dl-ssl.google.com/android/eclipse/
 
And click next>>next

3. Download Android SDK and set the path using preferences in Windows tab.