Adding eclipse project to github

Following are the steps to add projects to github . Though i have written this for eclipse projects, actually this works for any projects.

1. I assume you are having git installed in your pc, else first download and and install git from here .

2. Browse to your project folder and type

git init

3. Now let git know where you want to send your content. Type the following

$ git remote add origin https://github.com/[GIT user id]/[projectName].git

4. Now that git knows where you want to send your project , another 3 simple things you have to do. Add the actual project, commit to local git and finally replicate the change to github.

git add .   # this adds all the files
git commit -a -m "Initial commit" # this is for local commit. 

git push -u origin --all # finally :)

5. Remember git will ask for your github user id and password.

Installing PyCharm on ubuntu

I was searching for a decent ide for learning python. Browsed through a few blog posts and zeroed in on pycharm. It’s community edition is more than sufficient for me.  I was surprised to see many long articles and videos about installation process on linux. Let me assure you that it’s not at all complex. Here are the steps to install pycharm on ubuntu.

  1. Download Pycharm from here.
  2. Unzip it .
  3. Go to bin folder and type
    ./pycharm.sh
  4. If you get any jdk related error follow theses instructions to install java .

Installing Java 8 on ubuntu

  1. Check if java is already present
     java-version 
  2. If open jdk is present remove it by using
    sudo apt-get purge openjdk* 
  3. Now add the repository, update it and install java 8
    sudo add-apt-repository ppa:webupd8team/java
    
    sudo apt-get update
    
    sudo apt-get install oracle-java8-installer
    
    
  4. Lastly , set the environment variables. I would suggest you to use defaults 🙂  
    sudo apt-get install oracle-java8-set-default

Mounting windows 8.1 partition in ubuntu

After upgrading to windows 8.1 I couldn’t able to mount windows partitions in ubuntu. Had to google it and finally deciphered the mystery behind fast booting time of windows 8.1. Actually it keeps all drives in hibernate mode even when you shutdown.   That is why ubuntu finds it difficult to mount . To resolve this, you just run command as an administrator in windows and type “powercfg.exe /hibernate off”  .

Warning : you are windows booting time will increase drastically 🙂

Debug error in qtcreator

I generally use eclipse in my ubuntu box. This afternoon i decided to use qtcreator for a change. Found a annoying bug in qdebug for console application , which is due to some security changes in ubuntu .

Here is the error….

ptrace: Operation not permitted.

Could not attach to the process. Make sure no other debugger traces this process.
Check the settings of
/proc/sys/kernel/yama/ptrace_scope
For more details, see /etc/sysctl.d/10-ptrace.conf

Solution :

1. Open command line and move to this folder

cd /etc/sysctl.d/
2. Edit this file

sudo nano 10-ptrace.conf
3. change the value of
kernel.yama.ptrace_scope = 0

Thats it 🙂

Conio.h for g++

Lets admit it , most of our colleges don’t care about c++ standards while teaching c++. That is why borland c++ (or turbo c++) is still used in many college labs. But problem is , since they are not compatible with any c++ standards , people face difficulties once they are out of college. One of my colleague has a large personal c++ code base , which was entirely written in his college days using that outdated non standardised compiler. So functions like getch(),clrscr(),cprintf() etc are used widely. Now he was unable to compile any code in his linux box , and the reason was conio.h . I just googled and found that he was not alone. And there is actually a conio.h available for g++ too 🙂

 

You may visit here to have a look at it , in-case you require that

http://linux-conioh.sourceforge.net/

Kernel Fun (Day 1)

{This is a part of a series on my interactions with linux kernel . I will make entry about every days proceedings.  }

I decided to play with kernel a bit. Actually I was playing with shell scripting, and wanted to learn some system calls. After browsing a bit , I realized it would be easier to learn if i start messing up with kernel. And in the process , I might be able to add one or two new words in my cv 🙂

Getting the code

1 . First I installed virtualbox . Installation was very easy , just keep accepting all the default stuffs.

2. Then I started the virtual machine with a ubuntu image .

3. After installing ubuntu I installed git (It is a svn used for managing kernel source)

sudo apt-get install git

4. Next I moved to my home directory and downloaded the latest kernel source by issuing the following command

git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git

5. You may use pull to update the code
git pull

So that completes downloading and setting up environment . Tomorrow will try to compile it.