Thursday, August 10, 2017

Add colors to terminal and vi in MACos

Monday, June 26, 2017


Option -O (upper-case O) is important. Without this, curl will start dumping the downloaded file on the stdout. Using -O, it downloads the files in the same name as the remote server. In the above example, we are downloading strx25-, so the downloaded file will also be the same name.

yum update
yum search any-package

yum info any-package

yum install any-package
yum list something

yum list recent

yum list installed
yum list available

yum list all

lsof -i :port
lsof -i :80
WITH replication = {'class': ‘Strategy name’, 'replication_factor' : ‘No.Of  replicas’}

Sunday, May 28, 2017


Friday, December 30, 2016

Saturday, December 10, 2016

Date Time in Java 8

package com.ldap;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

public class DateTimeTest {
private static final String DATE_FORMAT = "dd-M-yyyy hh:mm:ss a";
public static void main(String[] args) {

private static void datetime() {
String dateInString = "22-1-2015 10:15:55 AM";
        LocalDateTime ldt = LocalDateTime.parse(dateInString, DateTimeFormatter.ofPattern(DATE_FORMAT));

        ZoneId singaporeZoneId = ZoneId.of("Asia/Singapore");
        System.out.println("TimeZone : " + singaporeZoneId);

        //LocalDateTime + ZoneId = ZonedDateTime
        ZonedDateTime asiaZonedDateTime = ldt.atZone(singaporeZoneId);
        System.out.println("Date (Singapore) : " + asiaZonedDateTime);

        ZoneId newYokZoneId = ZoneId.of("America/New_York");
        System.out.println("TimeZone : " + newYokZoneId);
    LocalDateTime localdate =;
    LocalDateTime localdate2 =;
    DateTimeFormatter fmt = DateTimeFormatter.ISO_DATE_TIME;
System.out.println("---> "+localdate.format(fmt));
System.out.println("---> "+localdate2.format(fmt));
        ZonedDateTime nyDateTime = asiaZonedDateTime.withZoneSameInstant(newYokZoneId);
        System.out.println("Date (New York) : " + nyDateTime);

        DateTimeFormatter format = DateTimeFormatter.ofPattern(DATE_FORMAT);
        System.out.println("Date (Singapore) : " + format.format(asiaZonedDateTime));
        System.out.println("Date (New York) : " + format.format(nyDateTime));


Tuesday, December 6, 2016


7th Dec 2016

Thursday, November 24, 2016


To create a keyspace with Simple strategy 


  WITH REPLICATION = {'class' : 'SimpleStrategy''replication_factor' : 1 };

Memory efficient collections framework

Friday, November 4, 2016


Sunday, October 2, 2016

Autowiring into filter in Spring application

If you are facing problems autowiring dependencies in your filter class in Spring application Use the following trick.

public void doFilter(ServletRequest request, ServletResponse response, FilterChain filter)
throws IOException, ServletException {

$ ( Currency Sign ) Missing in Excel POI

If you are writing to a cell and find that currency sign is missing this could be because of the following reason.

Setting cell style is not enough

CellStyle dollarStyle=workbook.createCellStyle();
DataFormat df = workbook.createDataFormat();


You also need to set the cell style to NUMERIC


Sunday, August 21, 2016

App Ideas

list news paper stands nearby
Any electrical / cooker repair shops nearby  repair shops
Any small vendor like samosa , gol gappa , momo stand nearby
any place nearby to get some attestation done
price of newspaper in bangalore
price of liquor in bangalore ( brand wise)

Amazon groups : we can add amazon users to groups such as family , friends and share wallet etc.
Reporting of expenditure if amazon api is available.


cross marketplace integration.

all the above information though required is not available on google.