Tuesday 30 September 2014

Inconvience Ahead

Hi, guys. I am gonna change the layout and the structure of the blog in a couple of days. So, if you are not able to visit my site or cannot find a blog post or it's just plain simple weird showing on your browser. Then, need not worry it will all be fixed in 3-4 days.

I got a really bad review from my sister about the blog design (She already has her own website). So, let me tweak it up a bit.

Sorry for the inconvenience.

Wednesday 24 September 2014

C Language Tutorial Series Part 1

Hi, long time no see. So, here we are on the C language tutorial  part 1. This is a tutorial, a crash course in C and nothing else. I am not gonna detail on how to get C compiler and how to run the compiled code. This tutorial would be based on examples and not much explanation would be given.

Here are a few things to note, before we get started:

NOTE: These things should not be forgot and paid attention to.

TIPS: These things are little tricks that you could use (optional stuff).



YOUR FIRST PROGRAM: (Why is it the Hello World Program???)
Well, let's get started. The first program is:
#include <stdio.h>
int main() {
    printf("Hello World!\n");
    return 0;
}
 Here's the explanation:

1. The statement #include <stdio.h> is used to import the contents of the file stdio.h. This file contains most commonly used functions and variables that we are going to use.

2. The statement int main() { } defines a function named main with the return type int (Integer, a number with no decimal point like 23, -97, etc...). It takes no parameters as indicated by empty round brackets().

NOTE: Return type means that if the system ran this program, then the program upon completion would return an integer.

NOTE: All functions must have 4 components:
1. A return type (if the function does not return anything, then return type is void)
2. A name (The name must not begin with a number or any special character; it can begin with an underscore and the name must not be something that C uses)
3. Parameters (The round brackets can contain parameter that the function requires to run, if the function does not require parameters, then simply keep the brackets empty or write void)
4. The body of the function must be enclosed in curly brackets{} (The brackets should be one before the function block and one after the function block)

TIPS: main can have arguments, then main becomes int main(int argc, char* argv[]). By giving main parameters, it means that the program requires some extra input to run. In that case, argv[0] points to name of the program and the options start from argv[1]. This means that argc becomes 2 if there is only one option, 3 if there are two options and so on.

3. The statement printf("Hello World\n") prints the string "Hello World!" on screen. "\n" stands for new line. It means that the if your do another printf, then the output goes to the next line (Think pressing Enter/Return Key on your keyboard).

4. The statement return 0 is the end of the main function. As defined, main should return an int, so we choose zero (basically, it could be anything you want, but it's standard practice to put zero).

The reason for doing this program as the very first program is that it clearly shows the syntax of the language.

Here's a sample run of the program:



CALCULATOR v1.0:
Well, then now you can print stuff on screen. How about we do a little math. Here is the code:
#include <stdio.h>
int main() {
    float c = 0.0;
    float a, b;
    printf("Enter a number: ");
    scanf("%f", &a);
    printf("Enter another number: ");
    scanf("%f", &b);
    printf("Addition: %0.2f\n", (a+b));
    printf("Subtraction: %0.2f\n", (a-b));
    printf("Multiplication: %0.2f\n", (a*b));
    printf("Division: %0.2f\n", (a/b));
    printf("Remainder(Integer Division): %d\n", ((int)a%(int)b));
    printf("Multiply first number by 23: %0.2f\n", (a*23));
    printf("Multiply number 12 by 13: %d\n", (12*13));
    return 0;
}
 Here's the explanation:

 Everything up to main is the same.

1. The line float c = 0.0 and float a, b declare variables a, b and c. Think of variables as boxes in which you put stuff in. float(Numbers with decimal points like 2.3, -9.87, etc..) here refers to the data-type of the stuff we want to put. As you can see, we can give value to variable at the time of declaration if we want.


NOTE: The standard data types are:
1. char
2. short
3. int
4. long
5. float
6. double


The printf just containing strings are the same as before.

2. The line scanf("%f", &a) is used to get a value from the user (basically the keyboard) and then put that value in a.

3. The printf from line 9-14 are different from what you used earlier. The %0.2f used prints the contents of the calculations done after the comma in the string and writes that to the screen as a float with only 2 digits after the decimal point. The %d is used to print integer values (no decimal points). %c is used to print characters.

NOTE: If you just use %f in printf, then you might get a long list of trailing zeroes.


4. The part ((int)a%(int)b) in line 13, first converts variable a (float) into an integer. The same goes for variable b and then perform integer division (just gives the remainder after dividing).

Here's a sample run of the program:




NOTE: Be careful with the input, you might get a floating point exception (more on that in part 2).

Now, continue to part 2. As always thanks for reading and please comment (if you get any problems or not).

Tuesday 27 May 2014

Puzzle Game in VLC

Yo, now most of us like games. I really do. Most of have VLC Media Player to play videos. But, did you know that you can combine the two.

No, it's no joke. VLC comes with a setting with which you can transform any video into an interactive puzzle game. The steps are pretty simple. So, here is the how-to:
  • Start VLC Player
  • Play any video file
  • Click on Tools
  • Click on Effects and Filters (or you can just press Ctrl + E)
  • Click on Video Effects tab
  • Click on Geometry Tab
 
  • See, that there is tick box for Puzzle Game
  • Tick that Box
  • Press Close
  • Pause the video and play the puzzle.
The puzzle has to be played with the mouse. To play the video, just un-pause the video. As simple as that. Now, you can play a simple puzzle with your favorite movie characters.


Here is a screenshot of me playing puzzle to "42 Ways to Die in Minecraft". I did this on Windows, so if this does not work out for you, then please comment.

Thanks for reading and as always please comment.

Play Tetris on uTorrent

Yep, You read that right. uTorrent is the most populer (as far I know) torrent client, used by thousands of people world wide to download mostly anything from torrent sites.

We are not here to discuss the pros and cons of uTorrent. We are here to play tetris on it.
Yup, it sounds weird but it is true. So, here is the how-to:
  • Start uTorrent
  • Click on Help
  • Click on About
  • Now click inside the About dialog box
  • Press "t" and start playing tetris
    So, now you can play tetris while waiting for your download to complete. A good way to pass the time. Tetris can be played with the arrow keys but you cannot drop tiles with spacebar (so don't press spacebar). I have used Windows, so if this does not work, then please comment.

    As Always, Thanks for reading and please comment.

    Turn your Web Browser into a Calculator

    Hey, there. I know I have been gone a long while now. College. But, I still surfed the net and for you guys found a new neat trick.

    As the title tells you can convert your web browser into a handy calculator. Now, don't go jumping and start finding complex calculations. I mean, dude, it does not go beyond a simple calculator. So, without further ado, here is the how-to (rhymes):
    • Start your web browser
    • Start console (If there are many consoles, just start any one. I used Web Console.)
    • Now, just do your calculations..

    I just tested it out with firefox portable. Now, I am gonna list shortcuts to open the console for the three most commonly used web browsers. Sorry, can't list them all.

    For Firefox, press Ctrl + Alt + K

    For Google Chrome, press Ctrl + Alt + J

    For Opera, press Ctrl + Alt + I

    If you are using the Mac Keyboard, then replace Ctrl with Command.

    As Always, thanks for reading and please comment. If I have made a mistake, then please let me know by commenting below.

    Monday 14 April 2014

    How To Watch Age Restricted Youtube Videos

    Hey, there. How many of you went to Youtube and saw this


    I know, it is very annoying. You know, I just wanna watch one video and don't want the hassle of logging in every time something like this pops up.

    So, the question is HOW DO YOU REMOVE THIS?

    It's basically simple, all you have to do is:
    • Look at the address bar, it is something like
    youtube.com/watch?v=something_here
    • Change that to
    youtube.com/v/something_here
    And now you can watch, most restricted videos. If this does not work for you or I have made some mistake, then please comment.

    NOTE: To pull this off, I used Mozilla Firefox and it worked.

    As always thanks for reading and please comment. 

    Monday 7 April 2014

    Hide Files and Folder from SpotLight Search

    This trick is for Mac users only. Now, guys everyone knows about spotlight. That handy dandy little app on the top right of the screen. This app is basically used to search the system for most of the things.

    So, its basically like a system wide search and you can't hide files (this I have encountered personally). So the question which you should ask or have been asking is: How, do you hide files then. This little how-to is here to help.

    There are a couple of tricks for that and I am gonna list them one-by-one and also let you know which is the more efficient.


    Hide a folder and keep your files in it

    To do this, all you need to do:
    • Make a new folder and add ".noindex" to the folder name.
    If you are gonna use an existing folder, then
    • Highlight the folder
    • Press Enter
    • Now type ".noindex" at the end of the foldername
    Now, shift your files in this folder. This basically hides the folder but this folder still shows up in Finder. If someone starts searching with the exact file name, then it might show up in spotlight.


    Hide Files

    To do this, just do:
    • Highlight the file
    • Right-Click and click Get Info or press Command-I
    • Now go to Name & Extension field
    • Add ".noindex" to the end of the file name
    • Mac might ask you to choose the extension, then choose ".noindex"
    This works, but fails miserably when you have a huge amount of files to hide.


    Hide Files in Library Folder

    This is tricky. Library is a folder but it does not even show up in the Finder. To actually go there do,
    • Start Finder
    • Hold option and click on Go in the menu bar
    • Now, you see Library (usually it does not show up) and click on it
    Once Library comes up, you could hide your files by shifting them here.


    Configure Spotlight

    This is the last option,
    • Click on the Apple Icon
    • Click on System Preferences
    • Under Personal Tab, Click on Spotlight

    • Now click on the Privacy tab






    • Click the plus sign (it's on the lower-left side)
    • Now choose the folder you want to hide
    Or you could just drag and drop the folders in it

    Sorry, but you cannot hide individual files by using this method. 

    Well, these were the methods I could find. So, if your trick is not mentioned here, then please comment and let us all know.

    As Always thanks for reading and please comment.

    Install or Run Emacs without Graphics

    No offense but this post is for Linux users. Whenever you install Emacs you get the GUI but sometimes you would be in the terminal and would like to start Emacs (without the GUI). This is simple:
    • At terminal type:
    emacs -nw
    Or you could add the following line to your .bashrc or .bash_aliases
    alias emacs='emacs -nw'
    This way, every time you type emacs, Emacs will start without the graphics.

    But, let me say this, Emacs is big so if you are gonna just use emacs without the X, then just simply install emacs without X. For that, just install the package emacs(number here)-nox. So, the package would be like emacs23-nox



    And that's that.

    Thank you for reading and as always please comment.

    Wget How-To

    Well, most Windows users know and use apps like download managers. There are some of these apps for linux as well. But, most of the time (I being at the terminal) use a small utility known as wget.

    It comes with most linux systems pre-installed. Yeah, it's a command line download manager.

    NOTE: For the website (websitenamehere), I have typed everything including the "http://" and it works.


    Mirror an entire website

    To do that type:
    wget -m websitenamehere
     
    and that will basically mirror or make a copy of the website on your system with the same name.
    You could also do:
    wget -H -r --level=1 -k -p websitenamehere

    What this baby does is:
    • -r tells to download pages recursively
    • --level=1 tells wget to download other websites that link to it but just upto one level. Simply, let's say website A links to your website and website B links to website A. Then, this command says download website A but not B
    • -H is for spanning hosts
    • -k for converting the links so that both websites point to each other on the hard drive and not to the real thing
    • -p tells to download all materials to properly display the page (like images, animations, you get the idea)



    Resume downloads

    Well, if you are on flaky connection, and the download keeps breaking off, then
    wget -c fullfilenamehere
    fullfilenamehere means the entire address to that file




    Specify output document

    At times the link don't precisely tell the document name or it could be lengthy, then you could use
    wget --output-document=filename
    NOTE: filename has to be the full filename with extensions




    Download music automatically

    First create a file with the list of your mp3 music sources (URLs) but mention them one per line, then
    wget -r -l1 -H -t1 -nd -N -np -A.mp3 -erobots=off -i filename.txt


    Bulk downloads

    Make a file with the list of URLs of the stuff that you want to download, then
    wget -i filename.txt


    Generate a log for checking broken links

    For this, simply type
    wget --spider -o wget.log -e robots=off --wait 1 -r -p websitenamehere

    There are many more uses for this versatile tool. If I have not mentioned your trick or there is some mistake in mine, then please comment.

    As always thanks for reading and please comment.

    Saturday 29 March 2014

    Activate Godmode in Windows 7

    Now a friend of mine asked me, how do you I view the installed updates on my system? Looking at the settings screen, one would have to click a few times, and then you finally get the settings you want.

    This is tedious and boring. But let's change that. It's pretty simple. By doing so, you get most of the settings at one place. So, you would have to click only once (most of the times).

    Here is the how-to:
    • Right-click on any free space on your desktop
    • Create a new folder.
    • Name that folder to GodMode.{ED7BA470-8E54-465E-825C-99712043E01C} and press Enter
    And that's done. Now, open your new folder and see what Windows 7 has to offer.

    Thank you for reading and as always please comment.

    Compile and Run Programs in Notepad++

    Yo, most of the people I know use Notepad++ and swear by it that it's the best text editor any one can use. Me, I frankly use Vim. But, I gave it a shot and it's pretty useful. It's got tons of features. This post is not about Notepad++ and it's features.

    Now, back to post. The major problem any guy or gal has is that once you write your program in Notepad++, you cannot compile or interpret in it nor can you run your compiled programs in it. So, you would have to use some other application with it. But, now you don't need to (unless you want to debug). I tried that, but it did not work.

    Here is the how-to:
    • Install the compiler or interpreter you want to use.
    • Install NppExec Plugin (I won't write how to install it)
    • Now, goto Plugins -> NppExec -> Execute or press F6
    • In the Execute Dialog Box, write
     For C, write
     cd "$(CURRENT_DIRECTORY)"
    set obj = $(CURRENT_DIRECTORY)\$(NAME_PART)
    gcc "$(FILE_NAME)" -o "$(obj).exe"
    NPP_RUN "$(obj).exe"
    unset obj
     For C++, you can write
     cd "$(CURRENT_DIRECTORY)"
    set obj = $(CURRENT_DIRECTORY)\$(NAME_PART)
    g++ "$(FILE_NAME)" -o "$(obj).exe"
    NPP_RUN "$(obj).exe"
    unset obj
    For Java,
     cd "$(CURRENT_DIRECTORY)"
    javac "$(FILE_NAME)"
    java "$(NAME_PART)"
    NOTE: You can write something similar for the language you want to use.
    •  Click on Save.
    • Give the name something like run@.c for C, run@.cpp for C++ and run@.java for Java. (But, keep the name same, see only the extension has changed,  because you are gonna use this property later)
    • Then, make a new script and write in it,
    // Save Current File
    NPP_SAVE
    // Construct the script name to be called
    SET Compiler = run@$(EXT_PART)
    // Call the script
    NPP_EXEC "$(Compiler)"
    • Save this with a name something like compile.
    That's about it. Now, anytime you write you program, just run the compile script and it's done.

    I haven't tried it with languages other than the ones that have been mentioned in this post. If you do try it, whether you are successful or not, please let us know.

    As always thanks for reading and please comment.

    Saturday 15 March 2014

    Play Breakout on Google

    Have you played DX Ball 2? It is actually similar to Breakout. Breakout is an old Atari game. Now, you or anyone can play it on Google.
    Well, this trick works (for now, meaning Google has not removed it). Breakout game is a classic (my opinion) and has many remakes. I don't wanna delve into the history of the game, this post is not about that, now back to basics. The board (or the player) can be moved with the mouse or the keyboard arrow keys. It is a fairly easy game and can be played by almost anyone.

    To play, simply:
    • Fire up your browser.
    • Go to Google Images
    • In the search box, type
    atari breakout
    • Press Enter and you are done.
    Here is a small video of me playing. (Well, it is actually another trick in action)

    Thursday 13 March 2014

    Hack A Linux System

    Now, in the world of OS, the most secure system is that of Linux. Here I am gonna show you how to break into a linux OS. Basically all you need is the root password to do anything in linux, Right! I have successfully tried it myself. The system I used was LXLE. You just need GRUB to do this trick.

    Here's how you do it:
    • Interrupt linux boot. (Basically, keep Shift Key pressed)
    • Now, you have the GRUB menu, highlight the OS and press e for edit
    • Find the line which contains something on the lines
    /vmlinuz -somenumber-generic
    •  At the end of said line, add 1 or s or single after a space (I tried with single and 1, but single worked)
    • Boot with the current settings (I can't exactly list how to do so, since it differs in each flavor)
    • By doing just this you may get root access
    • Now, you do whatever you want. But just in case you tried changing root password and it does not give any output. (Well, that's because SELinux is interrupting)
    • Then, type setenforce 0 to switch SELinux into permissive mode and try again. 
    • If it says something on the lines that setenforce is not installed, then install it and try again.
    And that's about it. Now, you can pretty much do anything ranging from changing root password to adding new hidden accounts (I am gonna post on it soon) and even changing password of present user accounts or even deleting them.

    I don't actually care why you do this. But I just have to say it, this is sweet.

    If I didn't mention something or left something out, then please let me know. There are other ways of hacking a linux box which I have not mentioned, so if you do know of it let us all know.

    As Always thanks for reading and please comment.

    See Password behind Asterisk in Web Browser

    There are several passwords one needs to remember like, for your account, the wifi password, password for hidden files and so on. But each time the popup shows or the web browser asks you to enter your password, all you see when you type the darn thing is a bunch of dots.Even in the modem configuration page, the password for the account is a just a bunch of dots.

    This post will tell you a way to actually see those passwords. Now, you would be thinking this is crazy, why would I want to do that. Beats me! I don't know why you want to use this trick but you are here none the less.

    So, here is the how:
    • Go to the page that requires the password
    • Type in the password
    • Right click in the password field and select Inspect Element


    • Find the line which reads something like type = password



    • Change password to text and press Enter
    • Voila! You can now see the password
    It was that simple. So go ahead and try it out.

    NOTE: I have only tried it out using Google Chrome and Mozilla Firefox. If you are using some other web browser, then the trick may need to be modified a little. (Sorry, can't tell you the details of every web browser present on the planet on such a little post, now can I)

    As Always thanks for reading and please comment.

    Hack Windows 7 login

    At times, you find yourself locked out of your system or a friend of yours has changed your password and has left you in trouble. No matter what the case may be, you can still get you account back. Pulling this off in Windows XP was simpler but anyway here is the how-to:
    • Fire up your system.
    • When the screen states "Starting Windows", press the power button.
    •  Now restart the system, when it boots, you have a choice whether to start normally or Launch Startup Repair. Choose Launch Startup Repair.

    • Now, a pop may ask you if you want to use System Restore. Press Cancel.
    • After waiting quite some time, you will be told that Startup Repair failed. Click on the down arrow to see the problem details
    • Scroll down to the very bottom of the report and click on the link for the offline Privacy Statement

    • Notepad opens up, go to File and click on Open

    • In the Open Dialog, go to Computer -> Local Disk (This could be C: or D: or the place where you installed Windows)  -> Windows -> System32
    • Change the File Type from Text Documents to All Files
    • Find the application sethc or a file named sethc.exe
    • Right Click and rename it to sethc-bak
    • Find the application cmd  or a file named cmd.exe
    • Right Click and copy it
    • Now Paste it
    • You will get something on the lines of cmd - Copy,  right click and rename it to sethc
    • Close Notepad and Press Finish (Basically System Shutdown)
    • At the login, press Shift Key 5 times
    • Voila! You have DOS

    • Type net user. This gives you a list of all users.
    • Now, type net user username * to reset the password of account username or net user username password to change password of username account.
    See this is a bit complex but still you get what you want.

    As Always thanks for reading and please comment.

    Sunday 9 March 2014

    No Sound in Linux

    This is the most common problem, I have come across. Basically it boils down to this. No matter what I do, I cannot get the sound to work.

    So, in this scenario, here's what to do:
    • Install pavucontrol (I am not gonna tell you how! Linux has many flavors and each one can use multiple methods)
    • Start pavucontrol (Basically done through terminal)
    • Check the sliders and increase them to the level you want but keep them below 90%.
     
    I know most of you will say, been there done that. But wait, there is more.
    Here are couple of links, if the above mentioned does not work:

    I hope this helps.

    As Always thanks for reading and please comment.

    Emacs Cheatsheet

    Commands mentioned here works on GNU Emacs but does not cover every command. A subset of these commands may work on Zile, XEmacs and others.

    Note: C stands for Ctrl and M stands for either Alt or Esc

    Command                Description
    ----------------------------------------------------------------------------------------
    C-x C-c          Quit completely
    C-g                Quit a partial entered command
    C-v                Move forward one screen
    M-v                Move back one screen
    C-l                 Move text on which cursor is to center of screen (Pressing again leads to movement, first to top, then to bottom and back)

    C-p                Move to previous line
    C-b                Move backwards character by character
    C-f                 Move forwards character by character
    C-n                Move to next line
    M-f                Move forward word by word (when cursor is between word, then move cursor to end of word)
    M-b               Move backwards word by word (when cursor is between word, then move cursor to beginning of word)
    C-a                Move to beginning of line (if at beginning, then does nothing)
    C-e                Move to end of line (if at end, then does nothing)
    M-a               Move to beginning of sentence (if repeatedly pressed, cursor moves to previous sentence's beginning)
    M-e               Move to end of sentence (if repeatedly pressed, cursor moves to next sentence's end)
    M-<               Move to beginning of whole text
    M->               Move to end of whole text
    C-u Number Command        Repeat the command "Number" times (Works for most commands)
    M-Number Command        Repeat the command "Number" times (Works for most commands)
    C-u Number C-v            Scroll text forward by "Number" lines (not screenfull)
    C-u Number M-v            Scroll text backward by "Number" lines (not screenfull)
    C-x 1                Kill all windows except the current one
    C-u Number Character        Insert "Character" "Number" times at current cursor position
    C-d                Delete character at current cursor position 
    Backspace    Delete character before current cursor position (If used with C-u, then will kill instead of delete)
    M-Backspace Kill word before current cursor position
    M-d                Kill word after current cursor position 
    C-k                 Kill from current cursor position till end of line (if pressed repeatedly, will kill the newline) (If used with C-u Number will kill, instead of delete)
    M-k                Kill from current cursor position till end of sentence
    C-Space         Start highlighting from current cursor position
    C-w                Kill all text previously highlighted by "C-Space"
    C-u Number C-k            Kill the "Number" lines along with their newlines
    C-y                Yank (Paste) latest killed text at current cursor position (If several C-k were used, then would yank all killed)

    M-y                Yank second latest killed text (If pressed repeatedly, then would come back to latest kill) (Could be used with C-u)

    C-/                Undo (If used with C-u, then repeat undo "Number" times)
    C-_                Undo (If used with C-u, then repeat undo "Number" times)
    C-x u             Undo (If used with C-u, then repeat undo "Number" times)
    C-x C-f          Open file or create new file
    C-x C-s          Save file
    C-x C-b          Show the list of buffers
    C-x b buffername        Goto "buffername" buffer
    C-x s             Save buffers which had changes in them
    C-x C-c         Quit emacs
    C-z                Suspend Emacs
    fg                 Resume Emacs
    %emacs       Resume Emacs
    M-x repl s string replace    Replace all occurrences of "string" with "replace" after the current cursor position
    M-x recover-file        After opening file, if during editing system crashes, this command can be used to recover or get back changes

    M-x mode-name            Change mode to "mode-name" (Use text-mode for editing text, use minor mode: auto-fill-mode for human language text)

    C-h m                Shows help on current mode
    C-u number C-x f        Change margin to "number" (default is 70)
    M-q                Re-fill paragraph (if paragrah is made up of sentences, some at new lines, then pressing this would connect them at the period)

    C-s string            Search for string in forward direcrion (Enter to terminate search, keep pressing it for next occurrence of "string", after this is Backspace is pressed the cursor would jump to previous occurence of string)

    C-r string            Search for string in reverse direction (Enter to terminate search, keep pressing it for next occurrence of "string", after this is Backspace is pressed the cursor would jump to previous occurence of string)

    Note:     If control characters are typed other than C-s and C-r, the search terminates

    C-x Number            Split the screen into "Number" frames, each displaying the same file
    C-x o(other)            Bring the cursor to the other frame
    C-M-v                      Scroll other frame (cursor remains where it was)
    Escape C-v              Scroll other frame (cursor remains where it was)
    C-x 4 C-f                  Open a different file in new frame (Cursor also moves to new frame)
    M-x make-frame     Create new window
    M-x delete-frame    Delete selected window
    Escape Escape Escape        Get out of recursive editing level or out of minibuffer
    C-h ?                       Get help on everything
    M-x help                  Same as C-h ?
    F1                           Same as C-h ?
    C-h c Command     Tells "Command" name (Here "Command" is of the form C-x, M-v, C-x C-s, etc...)
    C-h k Command            Displays documentation of the "Command" (Here "Command" is of the form C-x, M-v, C-x C-s, etc...)

    C-h f Command-name        Displays documentation of "Command-name" (Here "Command-name" is of the form previous-line, etc...)
    C-h v variable-name        Displays documentation of "variable-name" (Here "variable-name" refers to all variables some of which can be used to customize Emacs)

    C-h a               Search for commands
    C-h i                Info (Use "m emacs" to read Emacs Manual, type ? for guided tour)
    C-h r               Read Manual

    Note:
    Use Tab for auto-completion of commands.

    If you want to download it, here you go.

    As Always thanks for reading and please comment.

    Vim Cheatsheet

    This is awesome editor. Enough Said. So, here is the cheatsheet

    Command            What it does
    --------------------------------------------------------------------------------
    :q                        Quit (no saving)
    :wq                     Save and quit
    j                          Move one line down
    k                         Move one line up
    l                          Move to the next alphabet
    h                         Move to the previous alphabet
    x                         Delete unwanted character
    i                          Insert text
    dw                      Delete word
    d$                       Delete from current cursor position to end of line
    de                       Delete word till end of word
    w                        Move onto next word
    e                         Move onto next word's end alphabet
    0                         Move to beginning of line
    $                         Move to end of line
    dd                       Delete a line
    u                         Undo recent change
    U(capital u)        Undo everything on that line
    CTRL-r               Redo recent change
    p                         Put deleted text after cursor (the entire thing)
    r<new char>     Replace character at current cursor position with specified character
    ce                       Change characters until the end of the word
    Ctrl-g                 Show line number and file status
    G                        Go to end of file
    gg                      Go to beginning of file
    <line number>  Ctrl-g    Go to specified line number
    /<word>            Search for specified word in forward direction
    ?<word>           Search for specified word in backward direction
    n                        Search previous word for next hit in forward direction
    N                       Search previous word for next hit in backward direction
    Ctrl-o(Oh)          To go back where you came from
    Ctrl-i                  To go forward
    %                       To search for matching parenthesis (place cursor on parenthesis first)
    :s/old/new           Substitute 'old' word with 'new' word (only first occurence of 'old' word)
    :!<command>    Execute specified command
    :w <Filename>   Save opened file with specified filename
    v motion :w <filename>    By pressing 'v' we enter visual mode which selects all text with motion such as move down
    :r <filename>     Place the text from specified filename below the current cursor position
    o                         Place text below cursor position
    O(capital o)        Place text above cursor position
    a                         Append Text
    A                        Insert text after the end of the line
    R(capital r)        Replace all characters until <ESC> is pressed
    y                         Yank (copy) selected text. Use after entering visual mode
    :set ic                  Ignore case for all searches (Use after search command)
    :set hls is            Highlight matching text for all searches (Use after search command)
    :set noic             Disable ignore case for all searches (Use after search command)
    :nohlsearch        Disable highlighting text for all searches (Use after search command)
    <HELP>, <F1>, :help    To get help
    Ctrl-w Ctrl-w       To jump from one window to another
    :e <filename>     Open filename for editing
    :set nocp             Disable compatible mode
    Ctrl-d                   Show a list of available commands starting with the specified character (Enter a character first), press repeatedly for autocompletion of command (Do :set nocp first)

    <TAB>            Autocomplete command or filename (Do :set nocp first)

    Note:
    You can use the following formats for these commands:
        <times> command
    like
        3w        -    Move three words forwards
        2e        -    Move two words forward on the end character
        d3w        -    Delete three words
        2dd        -    Delete two lines
        c$        -    Change till end of line
        c3w        -    Change from beginning of line till beginning of fourth word
        4G        -    Move to fourth line from top
        :s/old/new/g    -    Substitute 'old' word with 'new' word (for every occurence of the 'old' word in the file)

        :#,#s/old/new/g -    #,# are line numbers within which to change 'old' word with 'new' word

        :%s/old/new/g    -    Change 'old' word with 'new' word in entire file
        :%s/old/new/gc  -    Change 'old' word with 'new' word in entire file but prompt first

        :!ls        -    See contents of present working directory
        :!rm <filename>    -    Delete specified filename
        :r !ls        -    Write contents of directory below current cursor position
        j$        -    Move to end of line
        /<text>\c    -    Search for specified text while ignoring case just for this search
        :help <argument> -    Get help on the specified argument


    If you want to download it, here you go.

    This covers the terminal based vim and not GVim, and also does not cover buffer management  and other commands. These commands should also work on GVim.

    As Always thanks for reading and please comment.

    Add user to sudoers file

    This concerns Linux users. Well, you guys installed this savvy flavor, you opened up the terminal to update so you typed the usual sudo command. But, got something on the lines
    User is not in the sudoers file.  This incident will be reported
    Let's face it, most of the system functions can be accessed with sudo. So, you need to add the user to this monstrosity. Now, you just need to:
    • Change to root (Don't ask me how! This how-to covers something else)
    • Type vim /etc/sudoers and press Enter. Here instead of vim you could use anything you want like gedit, nano, and the rest.
    • Under User Privilege Specification section add the line
    Yourusername ALL = (ALL) ALL
    • Press Esc (Escape key)
    • Type :wq and press Enter. (Well basically, this is saving the file, so if you have used anything other than vim, you know which steps to follow to save the file.)
    • Restart the system
    And that's that. After this try sudo again and I am pretty sure, this time around you not get that nagging message.

    This is one of the methods to add your username. If your preferred method is not here, then please comment.

    As Always thanks for reading and please comment.

    Change your Browser into a notepad (sorta)

    Hey, long time no see. I have been busy, you know with all the exams, projects and assignments. But, I did not forget you.

    This little trick is super. Every now and then, when I surf the web, I like to collect little snippets of information. For this, I needed Notepad or Gedit. But, lately I have just been using the browser. With this trick you can change your browser into a notepad with almost the same functionality.

    Here's how you do it:
    • Start your web browser.
    • In the URL Bar, type
    data:text/html, <html contenteditable>
    •  Hit Enter and enjoy your new notepad.


    That's it. But wait, this trick will work only if your browser supports HTML5. Well, most browsers do, so you  need not worry.

    As Always thanks for reading and please comment.

    How to set a video as a desktop wallpaper on Windows XP

    Everyone has a wallpaper, even the dweeb who aces the exams. I have tried find most of the coolest wallpapers on the net. Someone finds even better than I did and all goes to waste.Then, a friend of mine asked me if you can put a video of a movie or a clip as a wallpaper.

    This idea was awesome. Nobody knew about it (If they had, I would have seen it) and so nobody tried. I searched and finally found it (No, it's not a software, it's a trick). So for all you guys, here it is:
    • Before you go ahead, you need to have VLC. you can get it here.
    • Start VLC
    • Click on Tools and then choose Preferences.
    • On the Preferences Window, select Video (It's on the left)
    • In Video Settings, for Output choose DirectX video output instead of Default/Automatic

    • Click Save and restart VLC
    • Start any movie or clip
    • Right click on the screen, under Video choose DirectX Wallpaper/Set As Wallpaper. or Choose Video from the top menu and then choose DirectX Wallpaper/Set As Wallpaper.
    If you are using Window's Aero theme, you will get a warning
    • Minimize VLC (Yep! Don't close it) and voila!
    If you want to get your wallpaper back, then
    • Resize VLC
    • Choose Video from top menu and select DirectX Wallpaper.
    • Now sometimes it will not work, so just get a new wallpaper (Sorry, this post is about setting a video as a wallpaper, I am not gonna tell you about setting you wallpaper)
    Now there might be other methods that I have not mentioned. Please feel free to share.

    That's that and enjoy as well as impress other people.

    Thanks for reading and as always please comment.

    Free Windows 7 Keys

    Hey, there. You have Windows 7 installed right. Now, tell me is this the original deal or did you find a crack or a serial key or used RemoveWAT utility. Now, come on tell me.

    Okay, you got where I am going with this. But did you know that when you downloaded the ISO for Windows 7, you already had the key (Seriously I mean it). I am gonna show you where it is:
    • Extract the ISO using any tool you like
    • Go to Sources Folder and open it
    • Search for a configuration file named PRODUCT or a file named PRODUCT.ini

    • Open it in notepad and scroll down.
    • You will get all the keys for different Windows.
    I haven't used any of these keys. If you do, let us know if it works.

    As always thanks for reading and please comment.

    Saturday 15 February 2014

    Display Multiple Clocks in Window 7 System Tray

    Okay, suppose you are studying abroad or are visiting someone or are abroad or (you get the idea, right). You wanna check on the right time to call back home. Here, most of you guys and gals would download a software to display clocks right.

    But what if I can show you that Windows itself allows you to have multiple clocks (now this is awesome), it would be great right.So, here is the how to:
    • Click on Clock on System Tray
    • Click Change date and time settings...
    • Click tab Additional Clocks

    • Click Show this clock
    • Now, change the details like time zone and display name.
    • There is one more Show this clock, this means you can show two additional clocks on Windows
    • Click Apply and then click OK
    • Hover over clock in system tray and it's done.
    But if you want more than two clocks, I am looking into it. But, if you guys find it out soon, then let me.

    As always thanks for reading and please comment.

    Manually Change Windows 7 logon screen

    Yep! As the title tells, this post is about changing the logon screen of Windows 7. We all know, Windows 7 logon screen is down right plain, simple and boring. But, fear no more as I am about to tell you how to change it.

    Without further ado, here are the steps:
    • Click Start Button.
    • In Start Search Box, type regedit and press Enter
    • Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background
    • Double click OEMBackground key
    • Set the Value data to 1

    • Choose any image you want, Wait, there is a catch. The image size should be less than 256 KB. So, yeah, if your image is greater than that, shrink it down. (I am not gonna tell you how)
    • Move to C:\Windows\System32\oobe
    • Create a new folder, call it info
    • Create a new folder inside info, call it backgrounds
    • Copy your image here, but rename it to backgroundDefault.jpg
    • Reboot and voila!
    Simple, right. Nothing much to it. And for those that don't want to do it manually, there is a software named Logon Changer.

    Thanks for reading and as always please comment.

    Thursday 13 February 2014

    Watch Movie from DOS

    Hey, long time no see. Just joking. Now, in Schools I know that most computer stuff is known by the Geeks and Nerds but I ask you this question:
    How can you impress someone you like via computer?
     Well, the answer is pretty simple, just show them a movie from DOS (I know there are tons of different ways, this is one of them).

    Enough about impressing (seriously dude this trick is awesome and plain simple), you can use this trick for show off or any other thing you like. Just, as a reminder, the movie is Star Wars. So, here's how:
    • Start cmd (Mentioned here)
    • Type telnet towel.blinkenlights.nl and press Enter.
    If you get an error message, something on the lines that telnet is not recognized as an internal or external command or file name, then probably your telnet is switched off (Don't worry, it's there with every Windows).
    If it's switched off, then:
    • Click Start Button
    • Click Control Panel
    •  Click Programs and then Click Turn Windows features on or off
    • A new box will appear, scroll down and click on the check box for Telnet Client.
    • Press OK.
    After that Windows will activate Telnet and you can watch the movie.

    Thanks for reading and as always please comment.

    Remove Windows 7 not Genuine

    I recently encountered a friend of mine with the message "Your copy of Windows 7 is not genuine". Now, this is no big deal right. I mean, you just get a message, your screen becomes black with no screensaver, right! But guys all of you are thinking "What happened?" or "How did I get this?"


    It's simple, you just downloaded and installed an update. Windows update contains among them one update that checks for the authenticity of your copy of Windows. There are some websites that do the same, so be very careful.

    You can remove it by:
    • Click Start Button.
    • Among the programs listed, right click cmd and select Run as administrator
    • Now type SLMGR -REARM (Yep! type it as is, no changes) and press Enter
    • You get a pop telling you to restart the system.
    • Press OK and restart the system
    This just removed the annoying message. Now to reactivate your Windows key:
    • Click Start Button
    • In Start Search Box, type cmd
    • Among the programs listed, right click cmd and select Run as administrator
    • Now type SLMGR -ato and press Enter
    • If successful, you get a pop telling Windows key is activated.
    • Press OK and you're done.
    If that doesn't fix it, then simply:
    • Click Start Button
    • Click Control Panel
    • Click Windows Update
    • Click View Installed Updates (It's at the bottom left)
    • Uninstall update KB971033
    Now, the methods written up top are manual. You have to do it yourself. But, if you feel that something may go wrong, I may screw up!, yada yada... .Then there is one more method.

    Go to any search on the internet and search for RemoveWAT. It's a small utility to fix this issue. But, a point to note: Most antiviruses will tell you that it's a virus. Need not worry, I mean seriously, look at the type, it says HackerTool. Simply, stop the antivirus and run it or you can add as an exception.

    Thanks for reading and as always please comment.

    Wednesday 5 February 2014

    Declaration

    Well, this is just my backup. This is to declare that Blogger and the author of this blog will not be under any responsibility for the mess the reader may make.

    Simply put, the decision rests with you.

    Okay that was creepy. Now how to put, the words aren't coming. Let's compare this to a class. The teacher teaches the class about some exothermic reactions. One of the students goes ahead and creates a firecracker with it. But ends, up hurting someone. So, in this case the fault is entirely of the student, not of the teacher. So, the same applies to this blog and it's author.

    NOTE: USE THE KNOWLEDGE PRESENTED WITHIN THIS BLOG WITH YOUR OWN DISCRETION.

    Rename Recycle Bin

    Recycle Bin or the garbage dump. It sits quietly on the system and does nothing (Until you delete something). But it's name is annoying (Well to me it is). There is a cool way to change the name to anything you want.


    Do you want to know. So, here it is:
    • Click Start.
    • For Windows XP, Click Run, type regedit and press Enter.
    • For Windows Vista and up, in the Start Search box type regedit and press Enter.
    • Press CTRL + F and type Recycle Bin
    • Change the value to anything you want.
    • Press F3 to search again.
    • Repeat till all names have been changed.
    Simple as that. This way you get to change Recycle Bin to most anything you desire. This little trick should not affect anything else.

    Try it and let me know how it goes.

    Update: Sorry, to mention but I have only tried this on Windows XP. Let me know if it works on others.

    Delete an Undeletable File

    Upon several occasions, I came across a file that could not be deleted. Now, this is a big headache for a lot of guys (and of course gals). Even, I tried restarting the system but still the file could not be deleted. I finally thought, the message said the file is being used by another process, so what if I remove all process or if I changed to another operating system or .... (I know that's a lot of or's).

    So, not to despair, I have a solution ( I know, a cliche):
    • Open cmd. (It is listed here)
    • Close all open programs.
    • Right-click on an empty area of the Taskbar and select Start Task Manager.
    • Click on Processes Tab.
    • Find explorer.exe
    • Right-click on it and select End Process.
    • A Prompt may come up, so select the appropriate option.
    • Then, using cmd go to the place where the file was.
    • Type del filename to delete the file or rmdir foldername to delete the folder.
    • Now, finally in Task Manager, Click on File Menu.
    • Select New Task and type explorer.exe
    There is another method though. If you have a live USB or CD or DVD of Linux lying around, you could use that. Here's the how-to. First boot into Linux, then delete the file. (Seriously, this is it)

    If that didn't work or for that matter you don't have Linux, then simply download and install FileZilla. When you start it you see something like


    Now, see that Local site bar on the left. Below that, find the file/folder you want to delete and then,  well delete it.

    Let's say you have tried all of this but still you could not delete it. Man! what the hell did you put into that. Nevermind. Then finally you could try:
    • Open Notepad.
    • Click on File.
    • Click Save As
    • Locate the folder where you kept that monstrosity.
    • Choose All files as the File Type.
    • Click once on the file you want to delete. (Just so that you can get a name)
    • Put a " (Yep! That's an apostrophe) on the start and beginning of the filename.
    • Click Save.
    Hey, the process is not complete. Now try Deleting the file as usual.

    I hope this comes as help. If it did or did not, please comment.

    See All Hidden Files

    You know the easiest way to keep something on a system which everyone uses and still keep it private is to make it hidden. Microsoft took a big leap with that concept and so it's most important files are hidden. Not common hidden, like you would hide a folder or file. You can even try to see it by doing:
    • Open Windows Explorer.
    • Click on Tools.
    • Click on Folder Options.
    • Click on View Tab.
    • Under Advanced Settings section, inside Hidden Files and Folders, click on Show hidden files, folders and drives.
    But still you would be disappointed. Not to fear, there is another way.
    • Start cmd. (Mentioned in earlier post)
    •  cd (Yep! This is a command) to the place where the hidden files are supposed to be.
    • Type dir/ah and there you go.
    • If there are many files, type dir/ah/p
    Now, the boring part. These files are system hidden. Simply put, even if you try to unhide it using the conventional style, it will not work. This is the so far only way I know (without using any software) to do so.

    See it was pretty easy. Thanks for reading and please comment.

    Remove Windows XP Splash Screen

    Have you ever wondered, what exactly happens when Windows boots up? Now, those who have Linux can see a long list of things when Linux boots but in Windows, we get a Splash Screen (sorta animation). Now, this sucks in many ways. How many of you wanted to show that your system is super awesome? With a splash screen, nobody takes heed but remove that, and well you are a rockstar (kinda).

    There is a way to remove the splash screen, which is:
    • Open System Properties. (You have to go to Start Menu, then click on Control Panel. Click on System and finally on Settings)
    • Click Advanced (It's the tab on the top of the box)
    • Click Settings in the Startup and Recovery section.
    • In the new box, in the System Startup section, click Edit. (This will open boot.ini in a notepad)
    • Find the line that ends with /fastdetect
    • Position your cursor to the right after the paramter and press space.
    • Then, add /SOS
    • Save the file.
    • Close both the dialog boxes.
    • Restart the system and watch.
    It is as simple as that. Oh! If you are wondering, how I remove it. Just follow the same procedure as mentioned above but remove the /SOS and the job is complete.

    Thanks for reading and please comment.

    Sunday 26 January 2014

    Download stuff without registering

    Hey, How you doin? Now then, many of us have tried downloading from sites but most of them pop up asking for registration or account details. Now, I didn't want the hassle of  becoming a registered user. Well let's face it most of the time you would have to clean up your inbox for junk from these websites, and besides it's just one download right, it's not like I am asking for their entire suite or something.

    Now down to business. Here is the method to avoid it. Well, I have tried it myself (a couple of times only) and it works. It may or may not work for you but atleast give it a try

    • Go to your web browser and in the address bar type www.bugmenot.com
    • Enter the websites name in the address bar (Don't be lazy type the www also)
    • Use the logins provided (Surely one of them will work)


    This is easy, but wait there is another way (I haven't tried it myself). The method is to change your user agent from your web browser to something else (like GoogleBot). This way you would have access to the restricted material.

    A word of advice, this method doesn't work on hidden forums.

    So, go ahead and download what you need without the hassle of registration and as always please comment.

    Stuff that most try to do