Generate ssh key for Github Account

Github is a place where people can share the code and can develop project by coordinating contribution from different sources.It is a nice version manager tool.

To add code to the github account safely we need authorization mechanism.By generating ssh key, we can make sure that codes are added only from safer zones(with our prior knowledge).SSH will generate one private key and public key, the public key we have to add in online github account.Let us see how to generate the keys:

To create key, we need ssh to be installed in our system.

steps:

1) ssh-keygen -t rsa -C “your-email”

Enter the file path where this has to be saved, by default it will save in “home/username/.ssh” folder.Also enter the pass phrase for the key (optional). Now one private and public key will be generated in the specified folder.

2) ssh-add ~/.ssh/id-rsa

This code will add the recently created ssh key to ssh agent.

3)Now we have to add the public key of the key pair to github account.Open your github account in browser and click on account settings.There we can see “SSH Keys” option.Now select add ssh key option and paste the content of public key (~/.ssh/id-rsa.pub).You can open public key in any editor and copy the contents to paste it in github account.

4) ssh -T git@github.com

Now, its time to check whether it is working properly.This command will try to establish connection with https://github.com through ssh.If you get success message, then its done perfectly.

I am done with my github account  .

“Hi ashiksp! You’ve successfully authenticated”

Refer this  for detailed information.

Happy Hacking… 🙂

Posted in Techy | Tagged , | Leave a comment

How to install ruby-on-rails using rvm – Debian

Ruby is a language and rails is a frame work written in ruby.Rails frame work allows a beginner to develope web application very easily and quickly.Rvm (Ruby version manager) gives the flexibility to use different ruby versions in one system.We can use the required ruby version without any conflicts by using ruby version manager.

Here is the steps I followed to install ruby and rails using rvm.

first update the apt repo,  type “sudo apt-get update”  in terminal.

install curl, “sudo apt-get install curl”, then install rvm using curl.

“\curl -L https://get.rvm.io | bash -s stable”

It will install latest stable rvm package in the system.Now rvm is installed in our system.To install its requirements and dependencies first we have to load rvm.Logout the current terminal session and open a new one and type the command to load the rvm,

“source ~/.rvm/scripts/rvm” .

Now to automatically install its dependencies, run

“rvm requirements”

It will check the dependencies for the specific operating system (Here it is Debian) and start to install all the dependent packages.Now rvm is successfully installed in our system.

Next step is to install ruby.For that run the command,

“rvm install ruby”

It will install the latest version of ruby available in the online repo.After installation tell rvm to choose
the recently installed ruby version as the default ruby version by executing the command,

“rvm use ruby –default”

Now, to install rails we have to make sure that all requirements are there for the rails frame work.
So first we need to install gems by run this command,

“rvm rubygems current”

Finally every requirements are installed, now its time to install rails.

“gem install rails”

It will install rails frame work in our system.Now we can enjoy by developing web
applications very quickly with ruby-on-rails.

Happy Hacking… 🙂

Posted in RubyNRails, Techy | Tagged , , | Leave a comment

wifi configuration in my dell laptop

I installed debian operating system in my dell laptop one year ago.I made lots of changes in the os and installed too many packages that I needed.yah, its working fine then.Whenever I get stuck with any issue in os, always there is solution to that.Recently I executed the software update in my system, and some packages got updated.I don’t know, some thing happened to the system, and touchpad was not working then. 😦

Googling is a nice art, we can get a lot of solution. I found some remedy to make touchpad working fine.I created a synaptics.conf file in /etc/X11/xorg.conf.d and updated it with the touchpad configuration details.Then I execute the command,

sudo modprobe -r psmouse

sudo modprobe psmouse proto=imps

Now the touchpad worked for that login session.But after restart, my system always boots in tty prompt.The graphical user interface was not at all opened.I thought it was because of the file I created.I removed the entire xorg.conf.d folder that I created.But I was not able to open GUI window for the login session.I tried some other configuration changes also, but it didn’t work.Its better to reinstall os again…. 😦

I got a debian-wheezy iso image.I made it bootable and installed in my laptop.Debian installation procedure is very simple, only thing we have to be more care while selecting the disk partition for root directory.Now its time to install other packages that I needed. I have wifi connection with me, but my system not detecting it.Thanks to hariska for the help to configure the wifi.

Here is the steps I followed:

first we have to find out which wlan hardware is there with our system.You can figure it out by executing the command,

dmesg | grep -i wireless

In my case it is iwlwifi (Intel(R) Centrino(R) Wireless-N 1000 BGN, REV=0x6C).

I connected my phone to get temporary internet connection to install wifi driver.I tried to install that package (apt-get install firmware-iwlwifi) . The message I got was permission denied. yah.. Debian won’t allow everyone to do every task.We have to get some privilege to do certain crucial tasks.I tried the installation with sudo(Super user do).The message was,
 
salman is not in the sudoers file.The incident will be reported. 😮
 

Next aim is to edit the sudoers file to get the super user privilege.I searched about it (https://wiki.debian.org/sudo).So we have to add the username in sudoers file(/etc/sudoers).For that first login with root password.(you can shift to root by typing su & give root password).Then type  visudo , it will open the sudoers file and add  the line,

username ALL = (ALL) ALL

in my case I added : salman ALL = (ALL) ALL.Logout and relogin to get effect the modification we have made.Now that problem rectified.Again I run the command,

sudo apt-get install firmware-iwlwifi

The message I got was Unable to locate the package.yah, we have to add a non-free repo in sources.list file.I opened that file,

sudo gedit /etc/apt/sources.list, and added the following line

deb http://http.debian.net/debian/ wheezy main contrib non-free

Now after sudo apt-get update, I was able to install the package firmware-iwlwifi.After installation the changes have to effect in kernel also, so we need to run the commands,

modprobe -r iwlwifi; modprobe iwlwifi

wow, now the available wifi connections are showing in the network menu.We can choose the network and can do specific configuration if we needed.

Its time to install all extra packages and software through wifi… 😛

Happy Hacking. 🙂

Posted in Debian, Techy | Tagged , | Leave a comment

Don’t allow to save your Passwords

Hey, there is a high chance to track your password, if it is stored on your browser. Now a days we use so-many web services which require password authentication. Hence, while browsing from public net cafe or from some other’s laptop/pc, be care about saving your password.

facebook authentication page

facebook authentication page

If password is present in the login  window, we can reveal it with simple steps. Just see the case:

1) Open your browser, containing the password in authentication page.

2) Right Click on the “password” field and select “Inspect Element(Q)” from the drop down menu. You will get an additional window at bottom of the page.

3) From the bottom window, select HTML

4) You can see a line like…:

<input id=”passwd” type=”password” name=”passwd”>

or may different in other cases. Right Click on the “password” in the line type=”password”.

Showing password after changing to "text"

Showing password after changing to “text”

5) Change it to “text” and press Enter. Now you can see the password you typed in the text format, which can be read by anyone.

Showing password after changing to "text"

Showing password after changing to “text”

For setting as before, change “text” to “password” as before and close the bottom window. Be aware while browsing from public Internet Cafe. Also try to clear all saved passwords after the browsing.

Cheers..:)

Posted in My Life | 3 Comments

workshop @ iitm by fsftn

I knew about this 5 day workshop from ilugc mailing list, and I registered for the same immediately. One of the program coordinator Prashanth guided me for the registration fee payment and the rest procedures. Workshop was scheduled to 18 june – 22 june.

On the way to chennai, I met my friends Naseef and Thabsheer. Thabsheer completed the PG in Applieed Geology from madras university campus near to iitm. So the problems in finding locations and all are vanished. We reached chennai on 17 june, we spent the day for visiting his campus, Anna cetenary library & beach. Next day I went to iitm campus, where the program venue was decided.

fsftn workshop @ iitm

fsftn workshop @ iitm

Day 1 : 18 june ’13

Workshop started on 18 june, Prashanth, fsftn made a small inaugural speech and announced the commencement   of the program. First session was about philosophy of foss and free software community by Sibi, secretary fsftn. Thank you Sibi for the awesome introduction. He explains about the importance of open source projects & community. Then we were divided into several groups. Anand Raj, Jay Ganesh, Janani, vaishali and me made our group “Open unity”. Vaishakh from CEG was our group coordinator. First team task given to us was to make a discussion about the philosophy session & one person from each group present the conclusion. From “Open unity” I got the chance to represent and made the conclusion points.After lunch, Yashwant (fsftn) taken the presentation about ubuntu installation. And some basic commands are tried out in the following lab session. Yeah the first day was over.

Since I opted for accommodation already the same was arranged at Narmada Hostel, iitm. Deepak from fsftn, who in-charge of accommodation did everything for us, thank you Deepak. A temporary mess card was issued to us from Hostel Office. Vignesh from hydrabad and Harisankar from erode were the other two friends in my room. Also Siva, Sanat (Hydrabad), Madhan karthik (Coimbatore) were there near by rooms. Thank you all for the memorable moments with you.

"Open Unity" Team

“Open Unity” Team with Sibi

Day 2 : 19 june ’13

Second day started with the Python session by Prasanna. He covered all the basics in Python. In the afternoon session he made a presentation about web development and Django. Presentation class was too short, thats why we can’t do anything with hands-own. It finished by giving an opening to Django world. Next session was about – Fundamentals of computer networks by Praveen themmana, Jupiter Networks.

The last session of the day was about Tor, “Onion routing”. Karthik, an energetic guy from Bangalore made the session more interesting with his loud voice and interaction with the people. Tor provides the platform to everyone to be anonymous in the Internet world. And it is privacy by Design NOT privacy by policy, good open source platform. The 2nd day sessions were finished by discussion on network security policies and alternatives. From my group Vaishali made the conclusion speech.

with Anand Raj

with Anand Raj

Day 3 : 20 june ’13

Morning session was started with introduction to Drupal, content management system like wordpress and Jumla by Shyamala from Unimity Solutions. The introductory slide session felt too boring, but later it turned more interesting by hands-own sessions. After basic intro to drupal, team task was assigned to build a website with it. My group got the topic “Creative Commons”, Janani from my group takes the chance to deliver our website to the audience. The day sessions were finished by a small talk on firefox OS by Keshav Mishra.

with vignesh

with vignesh

Day 4 : 21 june ’13

This is the day for Ruby on rails. Vyshakh, my group coordinator taken the sessions about introduction to Ruby and rails frame-work . It was also a good session for us. Some basic commands are tried out in the laptop systems. He explained about the “method” formats used in ruby language instead of “functions”. In evening session Arun Prakash, one of the mozilla contributor takes class about the localization and internationalization (l10n, i18n). He explained about how localization was done in community driven projects.

with Harisankar and Madhan karthik

with Harisankar and Madhan karthik

Day 5 : 22 june ’13

Last day of the workshop program. In Morning session, Yogesh (OpenStack contributor) takes the session about cloud computing, starting from virtualization, hypervisor, OpenStack components and working etc. After certificate distribution Prashanth invited all the volunteers to share their experience. Prashanth takes a small session about freedom policy by striking the case of Aron swartz, who committed suicide recently related to the same issue. At last Yashwant gave an insight and answers to the usual points , from where we have to start… from where we get the resources.. etc.

with Siva, Nabak kumar, Sanat

with Siva, Nabak kumar, Sanat

The five days were gone very fast, and it gave me some new ideas and info about new tools I have to exercise. Beyond Everything these five days gave lots of friends and to be a part of fsftn community. Thank you all behind this workshop for their valuable time and commitment towards the program. Once again thank you fsftn to organize these kinds of workshops.

Thank you all friends, you made this program a great one, & stay-in-touch.

Posted in My Life | 1 Comment

Small pyhton script with cgi

While doing this program (Expression Evaluation script,(Python,html, cgi)) in lab, I faced a problem with server internal error.My friends and me try to solve the issue, but can’t make it runnable.The same code (Same Syntax structure) is working properly with another sample of programs.So I googled about the error message.They suggest some option to fix it , but it won’t match the current situation.Even now am not completely sure with the solution, the blankline after “Content-type: text/html\n” is the problem. By editing that, the program run successfully. Here I share the details.

Download the package xampp, say xampp-linux-1.7.4.tar.gz

Steps to run the server:
1) copy the package file to /opt
sudo cp folder/xampp-linux-1.7.4.tar.gz    /opt
(Give password for the permision)
2) Extract it :/opt
sudo tar xzvf xampp-linux-1.7.4.tar.gz
One folder named lampp is created in /opt.
3) We can save the python script file in /opt/lampp/cgi-bin.
After saving the file, it should make executable.
sudo chmod 755 filename.py
4) Also save the html file in /opt/lampp/htdocs
5) Start the server
cd /opt/lampp
sudo ./lampp start
6) Open the web-browser
type address as : 127.0.0.1/
You will get xampp  server page, now start with the exercises.

After saving the html file in /opt/lampp/htdocs, you can access it from the address : 127.0.0.1/filename.html

One of the error I faced is that,

“Server error!

The server encountered an internal error and was unable to complete your request.

Error message:
Premature end of script headers: expression.py

If you think this is a server error, please contact the webmaster. ”

To overcome this issue check the following, may be useful to fix it.
1) The firstline should be #!/usr/bin/python
2) Provide a space between Content-type and text
3) There should be atleast one blankline after the Content-type line
print “Content-Type: text/html\n”

Sample program is attached here:

expression.py & expression.html

//Program to evaluate an expression//

—-Expression.html—-

Enter the values to evaluate the Expression (a*b)-(c*d)

value a: 5
value b: 4
value c:  3
value d: 2

—-Expression.py—-

Expression : (5 * 4)-(3 * 2)

The Result is : 14

To stop the server:
cd /opt/lampp
sudo ./lampp stop

Cheers….

Posted in College | Leave a comment

Pleasure moments with Kenneth Gonsalves

Recently I came-across with an article in Linux For You, (Sep issue) about Gonsalves  sir

“A tribute to Kenneth Gonsalves”.

From the Article,

“….Kenneth Gonsalves..People active in the Indian Open Source Space will be familiar with this name. He was a strong personality and a man who never minced his words. We lost him on August 3, 2012….”

“….Gonsalves was known for his amazing python programming skills. He also had a good grasp of Django web application development. He was one of the key person involved in the setting up of the Python Software Society, India. He also made major contribution to Tamil computing Open street map….”

I had got a chance to assist him in a Python Workshop organized by IEEE kerala chapter with their event KITES 2012 at Trivandrum. Here I wish to share my experience and pleasure moments with Kenneth Gonsalves sir.

Kenneth Gonsalves

The two day Python Workshop was conducted in last June (23rd & 24th) . My colleague Anand Krishnan and Me contacted Gonsalves sir through mail, mentioned that “we are interested to help out you in the Workshop”. We got the replay from him that day itself, “Its ok and fixed”. And he gave some tutorial links to learn basics of python Language, also he made us contact with the event organizers for rest of the procedures. Then we discussed about the program through mail.

Note down the lines from the article,
“Kenneth was unapproachable via the normal means of communication .You had to email him to get a quick replay!”. Yes, email was the easiest way to communicate with him.

@ coffee house , Trivandrum

Anand and me went to Trivandrum by train, Kerala Express on Friday 22nd June. We reached there about 3 ‘O’ clock evening. We had our tea from Indian Coffee House. As per the information we contacted Mr. Benjamin, representative from MBCET college Trivandrum who arranged accommodation for us at Hotel Chinnus. Among the two day workshop first day program was at MBCET and second day program was at College of Engineering Trivandrum.

@ mbcet college, Trivandrum

We had contact with Gonsalves sir only through mail. So I had lots of excitement about the meet up. But after seeing him on Saturday morning all my expectation turned worthless. He was very friendly and motivative. He encourage us to face the students and gave nice advice, “Don’t fear about making mistakes, even I made mistakes .We have to learn more from mistakes”.

First day session was at MBCET as mentioned earlier. The basics of Python Language were introduced in the workshop. There were the students from different areas of Kerala and all of them are IEEE members. He gave some small tasks for the students, Anand and me helped the students to complete the tasks.

@ hotel chinnu, Trivandrum

Second day session, at College of Engineering Trivandrum
At the time of breakfast , he talked about the function and exercises that to be given to students in the workshop. He also spoke about how he came into the world of Python Language. The same group of students were in the 2nd day session. More exercises were done in the workshop. He described about “re” module and “unit-test” module in python and it’s use. These were also new to me.

College of Engineering, Trivandrum

The experience from this workshop is great to me. I am very thankful to Gonsalves sir for giving such an opportunity to assist him for a workshop. We were returned to Palakkad, Sunday night by train, Amrita Express. After the program also, we did contact Gonsalves sir through mail. And he gave another chance to us, but unfortunately we can’t attend it.

Later heard the sad news that , Kenneth Gonsalves passed away. Sure its a shock news to everyone who have contact with him and its a great loss to Indian Open source community.
May his soul rest in peace.

Some of his contributions,

[1]http://lawgon.livejournal.com/
[2] http://bitbucket.org/lawgon/
[3]http://search.cpan.org/~lawgon/
[4]http://www.linuxforu.com/author/kenneth-gonsalves/
[5]https://people.djangoproject.com/lawgon/
[6]http://in.linkedin.com/pub/kenneth-gonsalves/4/565/10b

Posted in My Life | 4 Comments