Skip to content

Instantly share code, notes, and snippets.

View adhpawal's full-sized avatar

Pawal Adhikari adhpawal

View GitHub Profile
#
# This is the "master security properties file".
#
# In this file, various security properties are set for use by
# java.security classes. This is where users can statically register
# Cryptography Package Providers ("providers" for short). The term
# "provider" refers to a package or set of packages that supply a
# concrete implementation of a subset of the cryptography aspects of
# the Java Security API. A provider may, for example, implement one or
# more digital signature algorithms or message digest algorithms.
@adhpawal
adhpawal / countries.json
Created October 10, 2021 18:05
Countries.json
{"error":false,"msg":"countries and ISO codes retrieved","data":[{"name":"Afghanistan","Iso2":"AF","Iso3":"AFG"},{"name":"Albania","Iso2":"AL","Iso3":"ALB"},{"name":"Algeria","Iso2":"DZ","Iso3":"DZA"},{"name":"Andorra","Iso2":"AD","Iso3":"AND"},{"name":"Angola","Iso2":"AO","Iso3":"AGO"},{"name":"Anguilla","Iso2":"AI","Iso3":"AIA"},{"name":"Antigua and Barbuda","Iso2":"AG","Iso3":"ATG"},{"name":"Argentina","Iso2":"AR","Iso3":"ARG"},{"name":"Armenia","Iso2":"AM","Iso3":"ARM"},{"name":"Aruba","Iso2":"AW","Iso3":"ABW"},{"name":"Australia","Iso2":"AU","Iso3":"AUS"},{"name":"Austria","Iso2":"AT","Iso3":"AUT"},{"name":"Azerbaijan","Iso2":"AZ","Iso3":"AZE"},{"name":"Bahamas","Iso2":"BS","Iso3":"BHS"},{"name":"Bahrain","Iso2":"BH","Iso3":"BHR"},{"name":"Bangladesh","Iso2":"BD","Iso3":"BGD"},{"name":"Barbados","Iso2":"BB","Iso3":"BRB"},{"name":"Belarus","Iso2":"BY","Iso3":"BLR"},{"name":"Belgium","Iso2":"BE","Iso3":"BEL"},{"name":"Belize","Iso2":"BZ","Iso3":"BLZ"},{"name":"Benin","Iso2":"BJ","Iso3":"BEN"},{"name":"Berm
package com.lftechnology.machpay.webhook.util;
import com.google.gson.JsonObject;
import org.apache.commons.codec.binary.Hex;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.util.HashMap;
import java.util.Map;
@adhpawal
adhpawal / killdatabaseprocess.sql
Created April 11, 2018 07:22
Kill Database Process Postgresql
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
-- don't kill my own connection!
pid <> pg_backend_pid()
-- don't kill the connections to other databases
AND datname = 'database_name'
;
@adhpawal
adhpawal / postgres-cheatsheet.md
Created August 25, 2017 08:06 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@adhpawal
adhpawal / jboss-cli.sh
Created January 12, 2016 16:21
Wildfly Setup For Java Mail Session using SendGrid : Using JBOSS CLI
#Goto WildFly Home
cd $WILDFLY_HOME/bin
#Open JBOSS Command Line Tool
./jboss-cli.sh
#Define a outbound-socket-binding named “MyMailSMTP”
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=MyMailSMTP:add( \
@adhpawal
adhpawal / standalone.xml
Created December 20, 2015 12:05
WildFly and Apache WebServer : AJP Connection
#Goto Configuration directory of WildFly
cd $WILDFLY_HOME/standalone/configuration
#Add Following Content on the standalone.xml file
vi standalone.xml
#Add Following Line,
<ajp-listener name="ajpListener" scheme="http" socket-binding="ajp"/>
@adhpawal
adhpawal / ajp.rewrite.example.com.conf
Last active December 20, 2015 11:53
Sometime we need to rewrite the URL to strip the context-root from the URL.This block of code works on the Virtual Host which has proxy connection to Application Server using AJP . We are creating solution for achieving :: example.com/helloworld ==> example.com. Please make sure you have enabled the rewrite engine for Apache.
<VirtualHost *:80>
ServerName example.com
ErrorLog ${APACHE_LOG_DIR}/error_ci.log
CustomLog ${APACHE_LOG_DIR}/access_ci.log combined
ProxyPass / ajp://localhost:8009/context-root/
ProxyPassReverse / ajp://localhost:8009/context-root/
RewriteEngine On
RewriteCond %{THE_REQUEST} /context-url/