Friday, October 24, 2014

Prevent MySQL to start on boot in Ubuntu

To prevent mysql from starting on boot:
  1. Open the terminal: Ctrl+Alt+T
  2. Open the mysql.conf file: nano /etc/init/mysql.conf
  3. Comment out the "start on" line near the top of the file, the "start on" might be spread across two lines, so comment out both. (comment adding # at the beginning)
If you want to manually start mysql, use the following command:
service mysql start

Monday, September 16, 2013

Change Maximize, Minimize, Close Button Layout in Ubuntu


gsettings set org.gnome.desktop.wm.preferences button-layout 'close,maximize:minimize'

Here : works as separator. Above combination changes the buttons as in the below screenshot.

Friday, August 30, 2013

Copying From Alternative Cells in Excel

In this scenario, the requirement is to segregate data present in cells at odd and even places and put them in them separate columns.


Original Data Representation :




































Desired Data format :









The formula used to obtain desired is as follows :

In this example the original data was in A1 Column and we have placed it in  column E and F

For Odd Cell :  =INDEX(A:A,1+(2*ROW()-2))
For Even Cell : =INDEX(A:A,1+(2*ROW()-1))



Friday, April 19, 2013

Easiest Way to print Timestamp in Java

Rather than using Calendar.getTime() we can use java.sql.Timestamp class to get the time stamp which gives date and time till millisecond precision.

System.out.println(new Timestamp(System.currentTimeMillis()));


Above will give you current timestamp in this format: 2010-07-27 16:37:45.39