Saturday, September 15, 2012

Restore windows bootloader without installation disc

  • Download MBRFix from Sysint, and extract the archive.
  • Navigate to the archive through the command line and run the following command, substituting mbrfix with mbrfix64 if you are on a 64-bit system.
          mbrfix /drive 0 fixmbr /yes

For more details see the  MBRFix documentation

Tuesday, September 11, 2012

Implementation of getch() and getche() in Linux

#include <stdio.h>
#include <termios.h>
   
    int getch()
    {
        struct termios initialrsettings, newrsettings;
        char ch[2];
        tcgetattr(fileno(stdin), &initialrsettings);
        newrsettings = initialrsettings;
        newrsettings.c_lflag &= ~ECHO;
        newrsettings.c_lflag &= ~ICANON;
        if(tcsetattr(fileno(stdin), TCSAFLUSH, &newrsettings) != 0)
            fprintf(stderr,"Could not set attributes\n");
        else
        {
        fgets(ch,2,stdin);
        tcsetattr(fileno(stdin), TCSANOW, &initialrsettings);
        return ch[0];
        }
    }
   
    int getche()
    {
        struct termios initialrsettings, newrsettings;
        char ch[2];
    
        tcgetattr(fileno(stdin), &initialrsettings);
        newrsettings = initialrsettings;
        newrsettings.c_lflag &= ~ICANON;
        if(tcsetattr(fileno(stdin), TCSAFLUSH, &newrsettings) != 0)
            fprintf(stderr,"Could not set attributes\n");
        else
        {
        fgets(ch,2,stdin);
        tcsetattr(fileno(stdin), TCSANOW, &initialrsettings);
        return ch[0];
        }
    }

Sunday, September 9, 2012

Add item to Send to menu

Open the following location and paste the link to the new sendTo item into this folder -
%APPDATA%/Microsoft/Windows/SendTo

Customize windows 7 theme

Applications to provide a awesome look to windows 7

1. fullmetro theme from deviantart.
2. xwidget
3. Rainmeter
4.eXtraButtons
5.win7 context menu editor
6.DefaultProgramsEditor to change icons
7. Rocketdock

Saturday, September 8, 2012

Useful Linux Shortcuts

  • Ctrl-c - Interrupter
  • Ctrl-d - Terminator
  • Ctrl-u - Killer
  • Ctrl-s - Stop scrolling
  • Ctrl-q - Resume scrolling
  • Ctrl-h - Eraser
  • sttysane - Restores sanity