Tuesday, 7 January 2014

Compiling C-Programs in Linux



Linux is open-source operating system.Linux said to give complete freedom to the user unlike any other operating system.It provides command-line interface to its user. Learning linux commands can really can save a lot of time.
For example.

If I wanted to create a file with a extention .c with some code in it.In linux i would simply use the following syntax.
echo "<File contents>" -> ~/<file name>.<extention>

and the required file would be created in your home folder.
Whereas in windows  i would havee to first save my code in a text document and then change the extention to .c, but by default windows hides extentions of known files.You will have to uncheck "Hide extentions of known file types" from folder options in an explorer.


There are various linux distributions.The most famous are Debian,ubuntu,red hat linux,fedora.Anyone can download it for free of cost from their official sites.linux is worth learning and great for any programmer.

Installing C compiler:-
-Open Linux Terminal.Type the following command without quotes 

"sudo apt-get install build-essential"

-It would request for your root password if you are not logged in as root.

-If you get any dependency errors.Typing "sudo apt-get install -f"  should resolve those dependency errors. 

Compiling C programs:-

-Navigate to the folder where the source code is located using cd command.
 cd <path>

-Then type gcc -o filename filename.c 

-The command will compile the source code and creates the executable in the same folder.To load the program type ./filename at the terminal.

 
 

NOTE:-
- The attribute -o gives the specified name to the output file. Typing gcc filename.c with create a output file "a.out".




Saturday, 2 November 2013

Using Borland to Compile C Programs


A C-compiler converts the source code given by the User to Machine language. Borland c++ compiler is one of the best compiler.Download it from here.After Installing the setup file follow the below Steps to configure the compiler.

To configure compiler:-

-I"c:\Borland\Bcc55\include"
-L"c:\Borland\Bcc55\lib"

Copy the above two lines exactly and paste them in a Notepad and save it.Then change the Extension from .txt to .cfg and name it as bcc32.cfg

-L"c:\Borland\Bcc55\lib"

Copy the above single line exactly and paste it in a Notepad and save it.Then change the Extension from .txt to .cfg and name it as ilink32.cfg

Now move both bcc32.cfg and ilink32.cfg to c:\Borland\BCC55\bin   directory.

To compile a Program using Borland:-

1.Copy the source code file with .c extension to c:\Borland\bcc55\bin 

2.Open command prompt from stat menu or Run cmd command.

3.Use cd command to change directory to c:\Borland\bcc55\bin
    eg:-  cd c:\Borland\bcc55\bin

4.Then type bcc32  <Name of source file> and press Enter.

5.The .exe file will be created in the same folder in which source code is present.

Advice:-
Instead of changing directory (cd) to the directory c:\Borland\bcc55\bin for every time you want to compile a source code.You can make the c:\Borland\bcc55\bin as an Environment variable.For more details visit here.

Download Compiler



Thursday, 24 October 2013

Design your own Run command?


Run commands allows the User to perform tasks at ease and it skips the work of searching for the program.Default Run commands like regedit ,sndvol,colorcpl,cmd etc are pre-installed in windows.Even a user can create his own run commands for programs which he uses frequently.The programs maybe a computer game,software,recovery program or whatever.All Default run commands are actually stored in c:\windows\systeem32 folder.So copying executable of User's program and pasting it in the  c:\windows\systeem32 creates a Run command.To test it just open Run program and Type the name of the executable pasted in the System32 folder.
              Most of the Users don't like to mess with their System32 folder as it contain many valuable files used by the windows operating system or it maybe that your C: drive is Out of memory.In such a situation follow the below steps.
 

1. Type "SystemPropertiesAdvanced" in Run dialog box or in command prompt and press Enter.


2. In the appeared dialog box click 'Environment variables' button.Then select 'Path' from the drop down list     of 'system variables' and click edit button.Then 'Edit System Variable' dialog box appears.




3. In the 'variable value' field type Semi-colon (;) followed by the path of the folder which contains all the executable's for which User wants to create Run commands.Then hit Ok . To Check directly type name of any executable in the run dialog box or command prompt.





Friday, 18 October 2013

Bypass Age restriction on Youtube without Login ?


Youtube is a large video sharing site.Videos which require only adult audience requests user for a Login.Sometimes it's annoying to go back to login page and sign in to just watch a 3 minutes video.In my view it's definitely a waste of time.So, in order to Bypass this situation just edit the URL as instructed below.

-Erase the 'watch?' part and also replace '=' symbol with a '/' symbol.
-Press Enter and you Will be amazed.


Downloading Youtube videos is Easy.Just add 'ss' infront of 'youtube' word and press Enter.
-eg: -  http://www.ssyoutube.com/watch?v=............

It's even possible to extract just audio from a youtube video.visit my post here

Sunday, 13 October 2013

How to permantly block a site on your PC ?



It's possible to block a Website using this manual and simple trick.Whenever User types any domain name in the address bar,the browser actually sends a request to the DNS servers for the Respective Ip Address of that website.So,Every browser before sending requests to DNS server checks the hosts file present in the c:\windows\system32\drivers\etc\   for IP Address of the domain name entered in the address bar.So adding invalid IP Addresses entries to the hosts file will result in the Ridirection of browser to an Invalid site.User Will experience below error message.


Steps :-

- Start->open Command Prompt-> Type 'start C:\windows\system32\drivers\etc\' and press Enter.
{My operating system is installed on C: Drive}


-Open HOSTS file with notepad.Add invalid Ip Addresses followed by the website name user wants to  Block and save the file.


-In Case the user wants unblock the website.Just Erase the changes done to the HOSTS file and hit save.

Saturday, 7 September 2013

Do you want to extract audio file from a Youtube video ?

It is very easy to extract just audio of a youtube video.There are times, you don't get a .mp3 file you desired by searching for it in Google.In that case, just search for that in youtube, it may be a recently released music album, a song, or any podcast or anyting you love.Copy the youtube link of that video and paste it in www.vidtomp3.com.Then hit the download button.You will discover it's the best way to download a .mp3 file from internet.It's even applicable for MySpace, Vimeo, Google video


Thursday, 5 September 2013

Easter Eggs on Google


Easter eggs on Google are a list of hoaxes launched by Google itself. There is long list of these of these Easter eggs  in here.But I am gonna discuss only a few which sounded fun. These are launched by Google on some occasions like April fool's day etc.

1. Atari breakout:

It's simple go to Google images and type in the search box 'Atari breakout'.press enter key.It's based on a popular video game.












2. Zerg rush:

When you do a search for zerg rush you will notice a bunch of O's eating the search results .you can click three times on a "O" to kill it. 















3.Do a Barrel Roll:

It turns screen a 360 degrees.

4.Tilt or askew:

Tilts the screen a little.

5.Google Gravity:

check out yourself.follow the link

6.Google Glass:

This is a type of spectacles gadget from Google.I don't know whether it is available for purchase or not. click here. 



 

Copyright @ 2013 TechTutor.

Designed by Templateify & Sponsored By Twigplay