Showing posts with label hack. Show all posts
Showing posts with label hack. Show all posts

Monday, August 26, 2013

Command History:

Any command executed on the machine gets logged. By default on bash the history size is 1000 commands. You can check your current size by

  • $ echo $HISTSIZE
this setting is stored in .bashrc , if you open it up you ll see something like this
  • HISTSIZE=1000 
It a good idea to increase the HISTSIZE to store a large number of commands, which can be rendered for quick execution with reverse-i-search.

There is also an interesting hack/trick around this :) . 
You can override the logging behavior but prefixing every command with a space. Interestingly commands executed in such fashion do not show up in the output of the 'history' command.

Also command history can be disabled by setting

  • HISTFILESIZE=0
in .bashrc

Wednesday, August 21, 2013

Change default OS the hacker way

Well I had played with grub.cfg long time back but recently I had to install Ubuntu on my laptop which I rarely use ( as I believe kick ass developers don't work on laptop :P ) and especially with window$ on it.

So anyway , I installed Ubuntu but forgot to set the default OS to window$  , well you might be like


Yeah yeah , I tried persuading my family members to use Ubuntu but soon gave up on them :P.

A very shiny pearl of wisdom I have picked up is that , always create a backup of any config file you plan on tweaking.

So lets go ahead and make a original backup of the /boot/grub/grub.cfg file which will be changed to reset the default options.


  • cd /boot/grub/
  • sudo cp grub.cfg grub.cfg.org
  • sudo vim grub.cfg
  • search for set default with vim search i.e "/set default" this is generally line 13 in grub.cfg
  • All the entries in the grub are associated with "menuentry" keyword in grub.cfg , for setting the default to windows OS we need to find the menuentry number for windows , these menuentry  starts with 0. If you are dual booted there are high chances that menuentry for windows would be 4.
    here in my case it has to be 4 , so I can change my default OS to window$ by pointing the default to 4.
  • change the set default to the corresponding OS menuentry , for me it is 


    • set default = "4"
    • optionally while you are at it , you can even make the booting faster by changing the default time out to 2 sec or so.
You can always use GUI grub config tools but