Tuesday, November 29, 2016

Install MySQL via Homebrew on Mac

To install MySQL via Homebrew on Mac, do as follows:

$ brew install mysql
$ mysql.server start

Remove MariaDB installed via Homebrew on Mac

To remove MariaDB installed via Homebrew on Mac, do as follows:

$ sudo mysql.server stop
$ brew remove mariadb
$ brew cleanup

Reference:
https://gist.github.com/vitorbritto/0555879fe4414d18569d

Thursday, November 24, 2016

Windows equivalent for grep and wc -l

If you want to find the number of established connections on 8080 in Windows, you can use the following command:

netstat -an | findstr 8080 | findstr ESTABLISHED | find /c /v ""

References:
http://superuser.com/questions/300815/grep-equivalent-for-windows-7
http://superuser.com/questions/959036/what-is-the-windows-equivalent-of-wc-l

Tuesday, November 22, 2016

Friday, November 4, 2016

List files in a jar file

To list files in a jar file, do as follows:

unzip -l build/libs/spring-boot-throwaway-branches-1.0.jar

Wednesday, November 2, 2016

Get the start and expiry dates of a SSL certificate in a server

To get the start and expiry dates of a SSL certificate in a server, do as follows:

openssl s_client -connect 1.2.3.4:443 | openssl x509 -noout -dates