Disabling Graphic Driver – Linux/Fedora


Hello all, I was facing a trouble with the graphic driver in Linux for the past few months. When I did the installation as per the previous post in my blog, there are some issues like missing library packages, unable to install the package etc,. After searching the net for a while, I found out the following solution for the graphic driver problems which will completely turn off the graphic card while we work in Linux based systems. This is the best way I found out by which I can work on Linux for hours together with out any battery drain  or over heating problems.

In the following steps we will be disabling the graphic card temporarily by making changes in the kernel files. For that just follow the instructions given here.

1) The changes which we will make to the kernel needs root access, so open a terminal as a root user.

2) Navigate to the vgaswitcheroo folder placed in the kernel.

cd /sys/kernel/debug/vgaswitcheroo

In the vgaswitcheroo folder you can see a file called switch which controls the GPU of your system. When you don’t change any thing of that file you will get some thing like this when you open the switch file:

0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Pwr:0000:01:00.0

Here in this file, the first one corresponds to the Intel GPU and the second one is the external graphic card which is a problem if we don’t have the graphic driver installed in Linux/Fedora. If we turn off the power supply for the graphic card then it is not at all a problem when working in Linux/Fedora

3) For turning off the graphic card just change the value of the switch file by executing the following command in the terminal as a root.

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

After doing this you can see the change in the value of the switch file to:

0:IGD:+:Pwr:0000:00:02.0
1:DIS: :Off:0000:01:00.0

Now wait for a few minutes and see the battery status. You can see the change in the amount of backup time.

Permanent Solution using the above procedure

If you follow the above procedure, you need to do the above process every time. If you think that is an un-necessary task every time when you log in to the system, just follow the below procedure. 🙂

Open a terminal as a root and just paste the following commands in the terminal:

cd 
gedit .bashrc

Now .bashrc file will open and just copy the following to the .bashrc file.

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

Now, just save the file and exit. The thing what you did just now is you have added the above line to the .bashrc file which will be loaded on the system boot-up. This will directly execute the above command when the system files get loaded.

That’s it, I think this will resolve the problem of the graphic card. 🙂

Just please give me the feedback regarding the post in the comments.

Hope this helps. 🙂

Advertisements

Contributing to Mozilla


Doing good is a part of our code.

Doing good is a part of our code.

Mozilla is one of the most leading open source organizations in the world now. Since a lot of people works for Mozilla by fixing bugs and implementing new features. Since people use multiple platforms for this, here I will provide a small guide through which you can install the source code for Mozilla on multi platforms and how can you start your first contributions. As a Mozillian I prefer any one to start their open source contribution with Mozilla.

While installing Mozilla source code, first thing what you need to do is, that you need to install its dependencies. The minimum hardware requirements are:

  • 2 GB RAM and lot’s of free space in it.
  • For debug and builds: at least 8 GB of free space.
  • For optimized builds: at least 1 GB of free space (recommended 6 GB)

Build Tools and Dependencies

All distro’s one line bootstrap command

This is the best way to install the dependencies irrespective of the distro what you are using. For this open a terminal and copy paste the following commands:

wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py && 
python bootstrap.py

If the above command doesn’t work then proceed for one of the following based on the Operating System you are using.

Ubuntu

With the help of the following command you can download and install the prerequisites required for Mozilla build in Ubuntu (as root).

sudo apt-get install zip unzip mercurial g++ make autoconf2.13 yasm libgtk2.0-dev libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libasound2-dev libcurl4-openssl-dev libiw-dev libxt-dev mesa-common-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libpulse-dev
Debian

With the help of the following command you can download and install the prerequisites required for Mozilla build in Debian(as root).

sudo aptitude install zip unzip mercurial g++ make autoconf2.13 yasm libgtk2.0-dev libglib2.0-dev libdbus-1-devlibdbus-glib-1-dev libasound2-dev libcurl4-openssl-dev libiw-dev libxt-dev mesa-common-dev libgstreamer0.10-devlibgstreamer-plugins-base0.10-dev libpulse-dev
Debian Squeez Edition

On Debian Squeeze, you need to install yasm-1.x from the squeez backports. You can also get the mercurial bundle if you need the compatibility with an existing mercurial repository.

echo "deb http://backports.debian.org/debian-backports squeeze-backports main" >> /etc/apt/sources.list
aptitude update
aptitude -t squeeze-backports install yasm mercurial
OpenSUSE/SUSE Linux Enterprise

Execute the following command as a root user in your terminal:

zypper install \
  make cvs mercurial zip gcc-c++ gtk2-devel xorg-x11-libXt-devel libidl-devel \
  freetype2-devel fontconfig-devel pkg-config dbus-1-glib-devel mesa-devel \
  libcurl-devel libnotify-devel alsa-devel autoconf213 libiw-devel yasm \
  gstreamer010-devel gstreamer010-plugins-base-devel pulseaudio-devel
RedHat Enterprise Linux (RHEL)/CentOS/Fedora

Execute the following command as a root user:

sudo yum groupinstall 'Development Tools' 'Development Libraries' 'GNOME Software Development'
sudo yum install mercurial autoconf213 glibc-static libstdc++-static yasm wireless-tools-devel mesa-libGL-develalsa-lib-devel libXt-devel gstreamer-devel gstreamer-plugins-base-devel pulseaudio-libs-devel
# 'Development tools' is defunct in Fedora 19 use the following
sudo yum groupinstall 'C Development Tools and Libraries'
sudo yum group mark install "X Software Development"
Arch Linux

Execute the following command in your terminal:

-Syu --needed base-devel zip unzip freetype2 fontconfig pkg-config gtk2 dbus-glib iw libidl2 python2 mercurial alsa-lib curl libnotify libxt mesa autoconf2.13 yasm wireless_tools gstreamer0.10 gstreamer0.10-base-plugins libpulse

After doing these depending on the Operating system you use, you can proceed for building Mozilla source.

Building Mozilla Source code

Once after you finish the installation of the prerequisites required for the Mozilla build you can continue with the build process. Build process generally goes with the downloading and installing through the mozilla.hg file. You can download the latest mozilla bundle from here.

Once you have downloaded the mozilla bundle follow the steps given below to install the source code.

1) Create an empty directory and  initialize a new repository (in a directory called ‘mozilla-central’ here):

mkdir mozilla-central
hg init mozilla-central

2) Unbundle the mozilla.hg bundle in the created folder.

cd mozilla-central
hg unbundle /home/path-to-the-bundle/mozilla.hg

3) Create a hgrc file in /mozilla-central/.hg/ , in this file we will be adding the path to the main repository so that we can pull the latest changes and update the bundle before we can start the build process.

gedit /hg/hgrc

in that file insert the following lines and save the file.

[paths]
default = https://hg.mozilla.org/mozilla-central/

4) Enter the following command in the terminal, so that it will pull all the latest changes to the code.

hg pull

and after that the next command to apply the changes to the repository file.

hg up (or) hg update

5) Once after the changes are applied you can start the build process with the help of the following command.

./mach build

This process will take at least 45 min to complete. After that you can see some thing like this:

Your build was successful!
To take your build for a test drive, run: /home/path-to-mozilla/obj-x86_64-unknown-linux-gnu/dist/bin/firefox
For more information on what to do now, see https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox

Once you see this in your terminal you are ready to start with your first contribution.

Getting started with your first contribution

Now that you have completed the build and you are ready to start fixing a bug. Bug fixing is basically where you need to go through the code and find the part of code that is responsible for the bug. For this you can take the help of the Mozillans in Internet Relay Chat (IRC). You can follow steps for getting connected to Mozilla IRC and clarify your doubts regarding the bug which you got assigned to you.

Connecting to Mozilla IRC

If you are using Mozilla Firefox as your browser it got an extension for IRC called Chatzilla. Chatzilla is basically an IRC client developed by Mozilla. If not that you can use different clients such as Mibbit or IRCCloud as per your convenience.

After opening the chat client, for connecting to the Mozilla server just type the following in the IRC client.

/server irc.mozilla.org

Once after you have connected to the Mozilla Server you can join the channel introduction, it is a channel for beginners. For joining that channel you can give the following command in the

/join #introduction

This is where you can start asking any questions related to bugs or in general also. Depending on the bug which you took and the availability of the mentor you can go and directly talk to him or you can ask any one there. There are a lot of people in Mozilla who are ready to help you at any point of time.

Selecting a Bug from Bugzilla

Bugzilla Homepage

Once you are ready with the build you can go to bugzilla for searching for bugs. As for a beginner it is recommended to start with minor or trivial bugs. You can search for bugs using bugzilla and once you found out a bug just tell in the bug comments saying that you are interested in working for this bug. After some time you will get that bug assigned to you.

Once you are done with selecting a bug, you can go and ask any help regarding the bug in #introduction on IRC.  While fixing a bug in Mozilla you have to find out a particular function which you need to modify. In that case you can use mxr or dxrUsing these two sites you can search for a file or a particular word or a module.

After you have fixed the bug, you have to make the patch. For making the patch you have to use mercurial.

Using Mercurial for creating a patch

Mercurial is used to create patch for the bug which you have fixed. Patch is one which gives you the changed you made to the code. Patch makes the mentor of the bug to review the changes and test it. For this you need to add the following lines to the hgrc file which you have created previously for giving a path to the Mozilla central repository.

[ui]
username = Name 

[defaults]
qnew = -Ue

[extensions]
mq =

[diff]
git = 1
showfunc = 1
unified = 8

This helps you to create a perfect patch for the bug which you have fixed. Once after you attach the patch to the bug then you can wait until the mentor reviews the patch.

That’s it done, hurray….. you made your first contribution. 🙂

Trip to Diu and Daman


Now I am going to explain a part of it in which I went to Diu and Daman (Union Territory) with my cousins. It was an amazing place, but the time we went is not suitable for that spot. Actually it is a place which is to be visited during Rainy Season. It took around four hours to reach from Mumbai to Silvassa.

Silvassa is the capital of Diu and Daman. We reached Silvassa around 10:00 in the morning. First we thought of going to Lion Safari. I was so excited that we are going for a Lion Safari. But after going there only I came to know that it is not a lion safari. After going there I was surprised because it was only one lion in the park. I thought it would be boring even for the remaining part also. But my calculations went wrong.

After the lion safari we planned to visit the Damanganga dam . The way which led to the reservoir was amazing. It was a ghat road with lots of greenery. In the midway we stopped to have some pics with my cousins. One of my fav pics taken there was with my sister and brother (small kids). I got enough comments for that particular pic. 😛 After reaching there we thought of going for boating which was through the reservoir. We went all the way from one end of the reservoir to the other end of the reservoir. The place was truly amazing. It took around one hour to come back. In the mean while we had some snaps also. But one thing we missed is the Tarpa Festival.

After that we thought of going to the deer park. After a long waiting for around two hours we got our turn finally to go and visit some deer’s. The deer park was truly awesome. It was a safari of about 20 min. All the way through the way we travelled it was full of deer’s only. I was lucky enough to touch a deer which was passing by from our vehicle. But problem is the driver didn’t give enough time to take good pics of the deer’s.  But the time we spent in the deer park was like heaven for me because it was so pleasant and quite there.

That’s how it is done for that day. The next day we decided to spend the whole day in the beach. So we planned to go the Jampar Beach which is located in Daman. The thing is that whole of Silvassa is full of industries and Daman part is like Mumbai with full of tall buildings and apartments. By the time we reached the beach it was around 11:00 in the morning. When we went in the first thing which attracted my mind is paragliding. I’ve decided to do that since I was a person who is interested in adventures. 😀

It was an amazing experience when I was in air for the first time with a parachute on my back. It will be about 200 feet I was from the ground level in the air. I was shouting like hell coz I was so excited. One thing which I was surprised of the beach was the water went back around 500 ft during the morning time. Two more days we had fun covering the places there nearby including Surat. It was one of my best trips till now.

That’s it for my short trip to the Union Territory. 🙂

My Childhood and Teenage


Hi, since I have decided to tell about my life till now, it will be a little bit long. So I have decided to break this entire story into two parts. In this part I will be expressing my memories till 10th class and in the next part I will be explaining you the remaining part till now. It might be a bit boring reading my life story, I will try my level best to make it a good post.

My Childhood:
I was born in July 1993. My parents used to say that I was the most naughtiest child ever during my childhood. When ever some one comes to my home, I used to play a lot like anything regardless of age. I think that is one of the reason why most of the people hate me the most.

Basically for anyone their childhood is the best time ever in their life right? In the same manner for me also, my childhood is the best and had a lot of memorable moments which I can never forgot in my life. Sometimes, I remember my grand father(expired) who used to bring me from my school. I used to play with him all the time. My dad used to say that once we used to have a dog in our home and it was the best friend of mine during my childhood.

My complete school education is done in my hometown itself in Gayatri Model High School. During the entire school age from class 1 to 10 I have come across so many situations. For the entire school age I got some really good friends who always takes care of one another in need of help. My parents used to say that I was one of the most bright students in the class till 3rd class. After that I am no more like that because at that age my dad bought a computer. As every one knows, once there is a computer in home what a kid will actually do, start playing games on it. From then onwards my downgrade in studies started. 😀

During my 9th class my school decide to take us to excursion to Hyderabad. That was the first time ever in my life I went out with out my parents. Anyway on one side, I was excited that I was going to some new place for the first time. Our school decided us to take us to Ramoji Film City which is one among the best of all for the whole Andhra Pradesh. I was almost begging my parents that I wanted to go for that trip. All of my friends have decided that this would be the best time ever in our life where we can enjoy. That’s right with that trip almost all of us became really good friends.

Excursion tour to Hyderabad:
It is really fun traveling with friends right? Before we started the trip we got really strict instructions that we should behave in a good manner. But once when we got into the train the real fun started. The whole night we were singing songs and dancing in the train. After reaching Hyderabad we started to Ramoji Film City in bus. We were wonder struck by seeing the buildings and other. In Ramoji Film City we have enjoyed a lot, and there in Ramoji Film City for the first time ever I have seen a 3D film which was amazing.

My friends and myself

My friends and myself (A small kid in the corner :P)

In that trip we went to Snow-world where all of us really enjoyed. It is where they will be reducing the temperature to -ve and blows in snow(artificial). There almost all of us really enjoyed because there we have even played with our school teachers who were really strict. We took complete revenge on our teachers by throwing snow-balls at them. In the same manner they also replied to us by doing the same. But it was the only place where we had lot’s of fun. What my friends did is that all of them decided to attack on me. Suddenly all of my friends started throwing snow at me. Very soon I was almost filled out with snow and was looking like a snow man. Remaining days we went to some of the important places in Hyderabad.

One funny thing is in Ramoji Film City there was a ride “Tumbler” which revolves us in a circle. The first time I somehow managed to get into that ride because people below 5ft were not allowed. The next time when I tried going for the same ride again the security guard caught me and told me that “This ride is not for children like you.” Anyway I got a chance to try all the adult rides at least one time.

Next is class 10 and all of us started our preparations for the exams. My style of preparation for the exams is completely different. I won’t even study the day before the exam also if parents are not at home. During the preparation holidays for us, what I did is really adverse when compared to my remaining classmates. The very next movement when my mom went to office, I had started the system and started playing games. Some how, I managed to get through the exams.

Escaping from the clutches of death:
During my 7th class I asked my parents to get me a cycle, so that I can learn cycling and can go out freely. According to my wish they gave me a cycle and I have started learning riding on my own. Once I got complete grip on cycle, I have started riding really fast on the street roads. My parents got many complaints on me regarding my fast and reckless driving. Even though my parents warned me so many times, I never listened to those people. Once when I was riding on the streets along with my friends, I suddenly clashed with an ambassador and I was down on the road. From the other side it was a truck coming at an avg speed, and by the time he applied the brakes the tires were almost at my neck. Thank god, I was saved with some major injuries. That day I got really good scoldings from my parents and after that it was only in 10th I got my cycle back and this time I never repeated the mistake again.

I feel like as if I was taking a lecture class. Ok, I will stop here and I will continue the remaining part in the next part. Thanks for reading…. 🙂