October 16, 2015

How to use Aliases in Linux | Superuse your Terminal

14:18 Posted by Freblogg , , , , , , No comments
Well, let’s face it, Linux is cool. Using Linux makes you look cool. But, for new users, may be not so much. Typing those long  commands can be a little intimidating and may even scare them off.
Wouldn’t it be awesome if there was a way, so that you won’t have to type long commands? Or even better, to create your own new commands by which you can do a lot of stuff?
You are in luck, because Aliases help you with that and much more.
 

What are Aliases anyway? 
Alias, as the name suggests is an alternate form of a previously existing command(s). So basically you are creating your own custom command with which you can do a lot of functions.
Enough with the definitions, let’s see an example.
Say you want to go to the Desktop folder. You would have to do something like this,

 [dsp@freblogg]$:~ cd /home/dsp/Desktop
How about instead of  typing all that, you just say desk like this and it takes you to Desktop?

August 21, 2015

TOP 4 Apps for taking Better Selfies | FreBlogg

12:46 Posted by Freblogg No comments
"But first, Let me take a selfie" is the new jargon that dominates all events. Even though the device that can get you that perfect selfie is in your pocket or your purse maybe, taking that picture-perfect selfie can be quite a task. The internet today, is full of apps to help you put your best face forward; here we have narrowed it down to the four apps that help you make the cut! 


March 29, 2015

February 16, 2015

C Program for decrypting Caesar's Cipher

00:47 Posted by Freblogg No comments
Caesar's cipher is one of the most popular encryption techniques in Cryptography. It is also referred to as Caesar's shift cipher or simply Shifting cipher.  It is said to be widely used in private communications of Julius Caesar. The encryption of the plain text is done by shifting the letters by a previously agreed number. So, after a shift of 2, 'a' becomes 'c', 'b' becomes 'd' and so on..

This article will show you a program that can be used to decrypt the cipher text encrypted using this method. To decrypt, you need to know the key which is the shift used to encrypt. Using the key we'll just do the reverse of encryption to get the Plain text. And, we'll program all that.

For example, the following is a decryption with a left shift 3.
Ciphertext: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD
Plaintext:  THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG
The following is the function implemented in C Programming for the decrytpion.

January 31, 2015

C Program that prints its own Source Code | C Programming Quine

23:55 Posted by Freblogg No comments
Quine in programming terms is a program which outputs its own Source code. These are self-replicating programs and are very popular in the programming community. So, in this article we will see how we can achieve this.
           This problem may sound complex, but this is actually quite easy and simple. So, the way we proceed with this is by opening the source file from the program and print out each and every character.
Sounds simple, doesn't it? Lets code it.
Things you need to know for this : Usage of File Pointers
C Programming - Swaroop's Blog
Procedure: Lets break down the approach step by step
  1. Open the current file (fopen()) using a file pointer (in Read Mode)
  2. Read characters one after the other and print them until you reach the end of the file (EOF)
  3. Close the file
To open the file we'll use the fopen() function which takes in two parameters, the location of the file and mode of opening (Read/Write). Fortunately for us, there is a macro in C, to give us file's location, called  _FILE_  macro. Using this we can get the location/path of the current file.

January 13, 2015

Things you don't know about scanf()

13:58 Posted by Freblogg No comments
Scanf() is an inbuilt function in the C Standard libraries. This is used to get input from the user and store that in a variable.
scanf provides inbuilt mechanisms to tackle with de-limiters which many people are not aware of. So, today we'll show you how you can limit your input till a certain symbol.

Consider we have a variable declared as
char a[20];
Reading a String:
To read a string usually we use '%S'. Instead of that we can also use the following way to get the value till you encounter '\n' and discard it.
scanf("%[^\n]\n",a);
This only stores the value till '\n' is encountered and discards it.
To read till a Comma:
Just like the above scenario we will use comma (,) as our delimiter. That would be,