Skip to content

Instantly share code, notes, and snippets.

View chetanppatil's full-sized avatar

Chetan Patil chetanppatil

View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@chetanppatil
chetanppatil / mvn.txt
Created March 12, 2021 11:19
Maven command to get value of pom.xml property var in command line
mvn help:evaluate -Dexpression=<pom.xml-property-name> -q -DforceStdout
@chetanppatil
chetanppatil / psql_useful_stat_queries.sql
Created June 24, 2019 08:02 — forked from AMEYCHAVAN/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB.
------------
-- Basics --
------------
-- Get indexes of tables
@chetanppatil
chetanppatil / sslCA.sh
Last active May 10, 2019 09:45
curl: (77) Problem with the SSL CA cert (path? access rights?)
mkdir /usr/src/ca-certificates && cd /usr/src/ca-certificates
# Check for your Centos Version using this command: "cat /etc/redhat-release" and download respective ca-certificate
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/ca-certificates-2018.2.22-70.0.el7_5.noarch.rpm
rpm2cpio ca-certificates-2018.2.22-70.0.el7_5.noarch.rpm | cpio -idmv
cp -pi ./etc/pki/tls/certs/ca-bundle.* /etc/pki/tls/certs/
Confirm that curl -vvv https://www.unixy.net is now working as expected
@chetanppatil
chetanppatil / libModSecurity.sh
Last active May 30, 2023 15:17
Install and enable libModSecurity for your Nginx
##
# ModSecurity NGINX INSTALLATION SCRIPT
##
# Install Prerequisite Packages
echo "Install Prerequisite Packages";
sudo apt-get install -y apt-utils autoconf automake build-essential git libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpcre++-dev libtool libxml2-dev libyajl-dev pkgconf wget zlib1g-dev
OPT_DIR=/opt
NGINX_DIR=/etc/nginx
@chetanppatil
chetanppatil / apache-netbeans-10.0.sh
Last active March 13, 2019 05:07
Install Apache Netbeans 10.0 On Linux From Binary With Desktop Entry
#!/bin/bash
cd /tmp || exit
echo "Downloading Netbeans 10.0 Binary ..."
wget -q https://www-us.apache.org/dist/incubator/netbeans/incubating-netbeans/incubating-10.0/incubating-netbeans-10.0-bin.zip
unzip incubating-netbeans-10.0-bin.zip
rm incubating-netbeans-10.0-bin.zip
echo "Installing to opt..."
if [ -d "/opt/netbeans" ];then
sudo rm -rf /opt/netbeans
@chetanppatil
chetanppatil / watchNodemon.sh
Created March 5, 2019 10:02
[nodemon] Internal watch failed: watch ENOSPC
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
/*
Table (named=> 'event_head') has one column (named=> 'data_dumb') as json which contains below json object.
We want to read data from that JSON.
==================== EXAMPLE JSON Object ====================
{
"timestamp": "2018-09-27T05:57:25.010Z",
"source": "adc@example.com",
"sourceArn": "arn:aws:ses:eu-west-1:056345409346:identity/example.com",
"sendingAccountId": "067935456346",
@chetanppatil
chetanppatil / Main.java
Created January 29, 2019 11:00
java program to reverse string and replace space with dot
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner read = new Scanner(System.in);
String s = read.nextLine();
String[] split = s.split(" ");
String result = "";
for (int i = split.length - 1; i >= 0; i--) {
@chetanppatil
chetanppatil / Robo3T-Installation-Menu.sh
Last active May 10, 2023 03:54
Robo mongo 3t installation and creating shortcut
#!/bin/bash
set -e
ROBO_VERSION="1.2.1"
ROBO_FILE="robo3t-$ROBO_VERSION-linux-x86_64-3e50a65.tar.gz"
ROBO_URL="https://download.robomongo.org/$ROBO_VERSION/linux/$ROBO_FILE"
ROBO_DIR="/opt/RoboMongo"
echo "Downloading Robomongo..."