Monday, October 12, 2015

To find duplicates on field.

SELECT [KodeSupplier], COUNT(*) as duplicate
    FROM [TBL_KODESUPPLIER]
    GROUP BY KodeSupplier 
HAVING      (COUNT(*) > 1)

KodeSupplier    duplicate
001.swadaya         2
1.0000.0000.0000    2
1.0000.0000.0001    2
1.0000.0000.GM01    2
1.0000.0000.GM02    2
1.ABZDZ.CDZZ.305    2
1.ABZZ.BZZZ.3113    2
1.ABZZ.BZZZ.3114    2
1.ABZZ.BZZZ.3116    2
1.ABZZ.BZZZ.3117    2
1.ABZZ.BZZZ.3118    2
1.ABZZ.BZZZ.3119    2
1.ABZZ.BZZZ.3120    2
1.ABZZ.BZZZ.3121    2
1.ABZZ.BZZZ.3122    2
1.ABZZ.BZZZ.3123    2
1.ABZZ.BZZZ.3124    2
1.ABZZ.CDZZ.3041    2

Tuesday, October 06, 2015

Red Hat / CentOS: Check / List Running Services

List all known services (configured via SysV)

chkconfig --list

List service and their open ports

netstat -tulpn

Turn on / off service

ntsysv
chkconfig service off
chkconfig service on
chkconfig httpd off
chkconfig ntpd on