Setup git with SSH on windows

1) Download  git from https://git-scm.com/downloads git download

2) Install Git and when asked choose Use Git from the Windows Command Prompt option –

git from cmd

3) Set HOME variable to your user directory like C:\users\your-username-here . Run the command bellow by replaying your-username-here with your computer username via CMD or RUN ( Win + R)

 setx HOME C:\users\your-username-here

4) check if everything is OK so far by running git --version in CMD. If it prints back the version of git then everything is good so far.

5) Open Git Bash from Start>All apps>Git>Git Bash and run

ssh-keygen

Keep the default filename (just press enter when it ask for filename to keep the default one) and provide a password for the key file. You have to provide the password every time you want to push any changes to git servers. You can also leave it empty for no password. Then you do not need to enter any password in future for pushing changes.

7) For GitHub: Go to https://github.com/settings/keys and click New SSH Key. For Bitbucket go to Bitbucket settings  and select SSH Keys under Security and click Add key.

6) Press Win + X and select Command Prompt to run command prompt (cmd) and run –

clip < .ssh/id_rsa.pub

This will copy the public key to your clipboard. Now paste it to the key field of GitHub or Bitbucket page you opened at step 7.  

7) Now press Add SSH key (GitHub) or Add key (Bitbucket) and from now on you can clone using SSH address of your git repo and push with SSH encryption.

Advertisements

Day 2: CMake for Beginner

CMake was always out of my comfort-zone. I always wanted to understand it but never could. Because I rarely write C/C++ code, I never had the push to understand CMake.

From CMake’s website –

CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.

So in short, CMake help you compile your source code independent of your compilation environment.

Here is a simple CMake file –

And the source file –

Run CMake

Now to compile hello.c file to executable file we just need to run in the terminal-

cmake . && make

The first command

cmake .

create make file and other configuration files. And the second command

make

create the executable file.

To run the executable file we have to run ./hello in the terminal. This will print

Hello World!

If we want to generate build files inside a particular folder like bin folder then we can run-

mkdir bin && cd bin && cmake .. && make
Tagged , , , ,

Day 1 : Starting My Journey

I wrote my first code in 2005 in my paper notepad at the age of 15. I got hold of a Computer Programming book from my uncle that time. When I read the book, I got so exited to find my new love. I can still remember my first program. It was in QBASIC and it take year as input and print if it is a leap year or not.

From that time I kept learning every languages I get hold on. But never thought about learning one language properly and then learn algorithms and design patterns. I know almost everything but in my own way. I understand them and can describe them in simple terms but If anyone ask me to give the exact answer, then I can’t do that.

A few day’s ago I found a Github repository Coding Interview University by Googley as Heck. In my scattered programming life without any proper guidance this list is godlike. And from today I am going to follow it religiously.

I may have lost my way, I may lost so much time trying to find my position. But I believe I can still achieve my childhood dream of being a Software Engineer at Google.

And HERE I COME Google Developers … 😀

Tagged , ,

Pixel, Made by Google

Today Google announced Pixel phones. I was so exited about the announcement not because of new hardware ( I don’t have the capability to buy new device in my current financial condition) but because of what Google has to offer.

Sadly after watching the presentation, I think I wasted time and mobile data ( I’m currently at home without broadband connectivity).

Although I knew it was their hardware event, but I was hopping to see the Allo and Duo integration, probably as iMessage and FaceTime alternative. But sadly Google is losing its way. We don’t want 4 applications (Allo, Duo, Hangouts and Messenger) to do one thing, communicate with friends and family. If you want to make it simple for users then remove those confusions and complexities. I don’t want to open a new app and search for my friend and then initiate video call on duo while chatting in Allo!

I’m the only one in my friend circle that force everyone to install and try new things. I made them like Google Photos, I made them like Hangouts ( until Google removed SMS merging feature, another bad decision), but I can’t even make anyone to install Allo or Duo on their phone! When they asked, can Allo do this or that (insert the first thing latest instant messenger app can do, anything ) ? I have to say, no they are working on that and then leave silently.

Good job Google, you made me hate myself for loving you, I can’t just say I do not love you anymore in front of the people I used to force them to love you 😐

Tagged , , ,

Prepare eclipse for PHP (PSR standard)

If we want to follow PSR standard which I strongly recommend for PHP, there  is a built-in configuration in eclipse PDT, such as 4 space instead of tab, Opening braces for classes, methods and control structures (for, if, switch etc). Selecting this option will format code to PSR-2 standard when using Source>format to auto-format the source code by right clicking the .php file or project folder.

PSR-2 coding style

PSR-2 coding style

PSR-2 also states that,

All PHP files MUST use the Unix LF (linefeed) line ending.

To do that we need to change eclipse setting as follows, if you are using Windows.

Unix LF (linefeed) line ending

Unix LF (linefeed) line ending

And

Lines SHOULD NOT be longer than 80 characters; lines longer than that SHOULD be split into multiple subsequent lines of no more than 80 characters each.

So change eclipse as shown below-

line boundary

I hope this post will help someone. Thanks

 

 

Tagged , , ,

First ever bicycle ride with ACC

I have brought my bicycle about a month ago. Though I wanted to go for a ride but never made it. Riding alone is boring.

Here at Chittagong I found a bicycle riding team named “Adventure Club of Chittagong” or “ACC“. They have a Facebook group which I get to know when someone referred me to their group from BDCyclists‘s Facebook group. BDCyclists is a very well-known cycling group here in Bangladesh.

But my timing with them was very poor. I have missed their every meeting for  about 20+ days for  random reasons.

But on 1st Jan, 2014 (The first day of the year) I somehow managed to meet with some of them for a ride. That was their 4th Crab Ride and my First EVER. They used to go to Naval Beach and eat Crab fry and then came back.

Naval Beach, Chittagong

Naval Beach, Chittagong, Bangladesh

The ride was planned to be started at 3 PM from Akhtaruzzaman Center, Agrabad, Chittagong. The place is about 9 km from my living place. So I have to bike there to meet with them. When I have reached there I thought they have already started the ride without me and then Leo Ismail Hossain called me on my mobile and received me. Then I talked with some of the riders and then started my ride.

I was the slowest rider among all of them. But I enjoyed my ride . Sometime I was so tired that I wanted to give up and took some rest, drank a glass of water. Not carrying water with me was a big mistake. We learn from our mistake. And as for me, From now on, I’ll always carry a bottle of water with me while riding.

Bicycle

Bicycle

The most enjoyable moment was when we were riding near the Shah Amanat International Airport , A plane was taking off just above our head. it’s happened so fast that we missed the opportunity to capture the moment. But the sensation is unforgettable.

When we reached the destination we parked our bicycle and ordered our  Crab Fry. While they prepared the order, I chatted with some of the riders.

We Cyclist

We Cyclist

After a few mins they delivered our order. That was the most delicious Crab Fry I ever eat.

Crab Fry

Crab Fry

Especially the soup was awesome. Especially only for this, I am so excited for my next Crab Ride ;). I eat like that was the only task I had to do. Nothing else really mattered 🙂

Eating Crab Fry

Eating Crab Fry

After that we started our ride back to home. When I reached home I checked my Endomondo and found that I have biked 45 km total and this is my highest one so far.

I am so happy to start my Cycling career with the help of ACC. So many things to visit. So many things to overcome. And this is the start …

Tagged , , , ,

Highlight navigation bar with CSS

I know every one of you must have face a common problem with customizing the navigation bar depending on the page user is visiting. Like changing background, text colour or anything you can imagine to let the user know which page/category page he/she is browsing.

believe me in my early coding time I went through a lot of coding to achieve the result. at first I have to check the address on every page and then with the help of if statement change the right navigation link’s class. This is a lot of work and believe me you don’t want to try this.

Continue reading

Tagged , ,

#BBM4ALL, what is going on

@BBM is now the new term of building and breaking hope. Play store is filled with fake @BBM apps. Everyday there is at least one rumour floating around. And the official @BBM twitter account is silent for last 3 weeks. So what’s really going on. Actually nobody know.
Continue reading

Tagged , ,
Advertisements