Fixing Bower install issues



Bower Install Issues :

Accessing git Protocol issue:

When trying bower install to install dependencies listed in bower.json(can modify) file , sometimes following error is encountered.
github.com[0: 207.97.227.239]: errno=Connection timed out
To overcome this error a small change can be made in .gitconfig file in the user's home directory.
git config --global url."https://".insteadOf git://
Using this all git commands will perform a substitution of git:// to https://
nnn


SSL Certificate verification Isssue :

 If you encounter the following error during installing dependencies :


exit code of #128 error: server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none while accessing https://github.com/ 
If you have an older version of browser or OS version, this can be fixed by updating it.

Or you can run the following command to modify your git config file.



git config --global http.sslVerify false
This will mandate not to verify certificates for the packages downloaded.


Please feel free to leave comments over any similar issues faced.

Ember Js Installation on Ubuntu 14.04


Hello,

I faced few issues while installing it so listing down steps below incase it helps people :

Ember.js needs node.js and phantom js so we need to install them as well.

Installing NodeJs.

Follow the commands below :
sudo apt-get update
sudo apt-get install nodejs 
This should work straight forward, if not please check your internet connection. Then,
sudo apt-get install npm
 Above command will install nodejs successfully. But due to ubuntu packet mismatch it names it nodejs. Hence you need to use nodejs everywhere instead of node. Check installed version :
 nodejs --version
If you wish to avoid writing nodejs, you can create a symlink for the executable.
sudo ln -s /usr/bin/nodejs /usr/bin/node
Emberjs still uses node command internally so its better to create the above symlink.

Installing EmberJs and PhantomJs


npm install -g ember-cli
npm install -g phantomjs
Above commands will install ember and phantomjs and you can create ember projects from command line.
 ember new my-app
This might give some error if your system doesn't have git installed, install it using :
sudo apt-get install git
Then your project will be successfully created. More details can be found here .




Setting up wordpress in your local system


Easy Wordpress Installation for Novice in wordpress:

Download wordpress from http://wordpress.org/download/

Install Lamp/Wamp/Xampp any hosting server on your local machine and run the server.

Make sure the url http://localhost/ works and shows some page in browser.

Copy the downloaded wordpress folder to /var/www (for apache) or any other directory depending on the root of your server(i.e. the directory where your localhost points to)

Now you can hit the Url http://localhost/wordpress/ and it should work if you copied the code properly 

Assuming you have installed mysql (during installation of LAMP) or any database client, you can create a new database to be used for wordpress or you may want to use an existing one.    eg.Suppose i created a test database and hence will use it for wordpress. 

Now in the form you can follow instructions shown on page http://localhost/wordpress/ and configure the server and create title, give username, password to create wp-config.php .It will automatically create table in your selected database for you.

Or else you can just go to wp-config-sample.php and modify and rename it

After this when you hit the url again you should be able to see your blog site and the first post.

You can modify and create new post by going to http://localhost/wordpress/wp-admin

Using Pjax to make page navigation user friendly



Understanding this, requires a little knowledge of Javascript, Jquery and Ajax. Pjax is nothing more but an extension of Ajax with the support of push state.

First of let us understand what is page navigation, when ever user encounters a page link which may be a different page in the same site using , he is redirected to that page. It basically means content of the current page are removed and that page are loaded along with all the javacript and css, which may not be different from current page, (it may not be so if we take browser caching into consideration).

But again the point here is that using pjax this complete action can be avoided and only the required content which changes, could be loaded(which is exactly what happens in ajax), but with the difference that url will also change, and user understands this a different page, and he can use back and forward button as if the page has actually navigated.

You can see the complete working demo here.
Now how do we do it. Very basic and simplest method :
  • Include Jquery and Pjax file in your script files.
  • you can use normal href links, but in javascript you have to use jquery. eg.


    $('a').click(function(e){
     window.pjax.fetch($(this).attr('href'),'body#id');
    // body#id is the body element id where the content should be fetched to
    });



Also Note that the body id for pjax needs to be present in both the pages i.e. the current page, and the new page. Basically behind the scene the content of body#id from new page will replace content of body#id in the current page. That's it. Happy Pjaxing!!

Image downloading script


Download Multiple Images from a website in one go
   
Now this post will be a bit of technical, i was just trying to write a neat little script to download all the images from national geography photo contest images (and of course not wanting to do it manually).

So i developed a script in php, which would require you to have a working internet connection of course, and a apache server setup or anything similar (like tomcat may be) where you can run your php file on browser. In the file crawl.php i am going to share, you can even change the url to make it work for some similar url where images are hosted. The file also needs a basic php file simplehtmldom.php to be in the same folder.

The output will create a file a.txt with the link of images. Now you can use any downloader to get the images in required places.

I used :
wget  -i a.txt 
it will download all the links in the current folder.
Hope it was of some use, you can comment in case of any queries or clarifications.

Feeling Poetic


Not sure what to write, but started anyway thinking what is good for me, pursuing and going after what I am not interested in just because others are going after. No, i don't think so, why shouldn't i do what i like.
It's my life and i can do what ever i like.

I read a couple of blogs from my friends today including couple of stories , poems, articles etc. and I got highly motivated. I always liked writing but I am not sure why I have been pushing this hobby away. I always thought first read and lets be a man (i.e. earn a handsome salary) and love what you do. Now when I have got that , why should i run faster (if I am satisfied with my pace).

I am always satisfied with very small things, thinking there are people who don't get even this. Am I wrong to be satisfied? I don't thinks so. I have time to pursue my hobby, that's a good thing.

In general and also literally I like to walk slow, that way I notice the minute details people tend to often miss. I feel consistency and constant attitude is better than to just rush to things. I am very patient and feel that patience can earn you many things you never imagined. People always rush for things as if its the end of life. But I feel differently, I think let it pass there will be something else if not this, life is full of opportunity and if one passed another will come. But that does not mean I would completely neglect the first one, i will try to utilize and hone it but wouldn't die for it (i.e. to make so much effort that if it were not possible, i will go under depression).

I have always had conflicts and adjustments problems with the surroundings because people are generally impatient and like to see quick results as if the life will run out and they miss out the beauty of the life.
  
This all may seem philosophical but its how i feel everyday, and it applies to day to day and also literally. Sometimes I tend to confused at my thoughts and these are some serious stuff which can't be discussed with general friend.

So i think it's better to do what you feel good about rather that making yourself available for other even when you aren't enjoying any of it (and may be neither are they). So there is hardly any point in doing what you don't feel good about. I will try to be regular now. :P:D

Updating myself

Hi all

Many things have changed, I am writing a blog after a long (very long) gap, Few major changes in my life would be getting a job, moving to Bangalore and taking up the responsibility for my family. Pretty cool Huh..!!

What was on my mind these times..Started writing a book, or at least thought of and believe me wrote a paragraph (I need some compliment...i don't care if you disagree) and yeah what's always on my mind (girls ...lots of them).

Recently Saw a Play "Bikhre Bimb" enacted by a sole actor Arundhati Nag, She is a marvelous actor.
And for sure i loved it. I have always been fascinated with literature. Observing myself, and things around us I feel that the subject for a simple or a complex story could be the life (the human beings) itself. Each person has a beautiful story to tell , obviously it needs a pretty narration. There are so many threads and small details in life that we often tend to miss them in this fast life.


 I have the nasty habit of noticing people, how they react to things and thinking what must be going on in their mind at that particular time. And this makes me take valid guesses about some one's personalities and behavior.  I am good at approaching people and convincing them what i want to (At least i feel so..what's wrong in bragging :) .

Did you wonder why did i put the picture of a Sudoku cube above, Because life is like a cube if you know how to arrange pieces it looks beautiful otherwise you are gonna spend a lot of time sorting it out.

This update is long enough and i promise myself for the next update pretty soon.