Skip to content

Instantly share code, notes, and snippets.

View ashee's full-sized avatar

Amitava Shee ashee

View GitHub Profile
@ashee
ashee / readtm.sh
Created August 15, 2016 16:08
ThingMagic reader
amitava:java amitava$ ./sample.sh demo tmr://10.21.235.186:5084/
@ashee
ashee / mvn-search-shasum.sh
Last active July 27, 2016 02:37
REST search maven by checksum
# see http://search.maven.org/#api
find /usr/local/Cellar/maven/3.3.9/libexec -name \*.jar -exec shasum {} \; | \
cut -d' ' -f 1 | \
xargs -n 1 -I@ \
curl -s 'http://search.maven.org/solrsearch/select?q=1:"@"&wt=json' | \
jq .
@ashee
ashee / get-archetype-catalog.sh
Created July 27, 2016 00:05
maven archetype catalog
curl https://repo.maven.apache.org/maven2/archetype-catalog.xml
{application, tcp_rpc,
[{description, "RPC server for Erlang and OTP in action"},
{vsn, "0.1.0"},
{modules, [tr_app,
tr_sup,
tr_server]},
{registered, [tr_sup]},
{applications, [kernel, stdlib]},
{mod, {tr_app, []}}
]}.
@ashee
ashee / vim-cmds.md
Created July 9, 2016 13:47
vim shortcuts - esoteric commands
gx: open url under cursor
gg=G: indent file
@ashee
ashee / webpack.config.js
Last active June 12, 2016 15:35
webpack config
module.exports = {
entry: './app.js',
output: {
path: __dirname,
filename: 'bundle.js',
},
module: {
loaders: [
{
test: /\.js$/,
@ashee
ashee / react-redux-webpack.md
Last active June 13, 2016 19:45
Minimal react-redux-webpack app
$ mkdir react-redux-webpack && cd react-redux-webpack
$ npm init . -f
$ npm i --save react react-dom redux react-redux immutable
$ npm i --save-dev webpack babel-loader babel-preset-es2015 babel-preset-stage-2 babel-preset-react # babel-preset-stage-0 for lower
$ # to add es7 async features
$ npm i -D babel-plugin-syntax-async-functions babel-plugin-transform-regenerator babel-polyfill
$ npm i -S babel-polyfill

Configure webpack.config.js

@ashee
ashee / amitava-recipes.md
Last active May 31, 2016 17:03
Amitava Recipes

There are four different ways one can deploy a webapp to Tomcat.
If $TOMCAT_HOME is the Tomcat top-level directory:

  • Copy the war file foo.war or exploded war directory to $TOMCAT_HOME/webapps
  • Create a context file context.xml in the webapp’s META-INF/ directory that contains a fragment that describes the webapp deployment
  • Add a <Context> element to the <Host> element in Tomcat’s server.xml that describes the webapp deployment, including docBase. docBase is a attribute that locates the war file or exploded war directory in the filesystem.
  • Create a context file foo.xml in $TOMCAT_HOME/conf/Catalina/localhost/foo.xml that contains a fragment that describes the webapp deployment, including docBase.

Sample $TOMCAT_HOME/conf/Catalina/localhost/foo.xml

@ashee
ashee / datasource-template.cli
Created May 4, 2016 14:35 — forked from ehsanullahjan/datasource-template.cli
Templates for creating PostgreSQL, SQL Server, Oracle and MySQL datasources in JBoss / WildFly using JBoss CLI
# PostgreSQL
/subsystem=datasources/data-source={{data-source-name}}:add(jndi-name="{{jndi-name}}",driver-name="postgres",connection-url="{{jdbc-uri}}",user-name={{username}},password={{password}},enabled=true,use-java-context=true,background-validation=false,validate-on-match=true,valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker",exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter",min-pool-size=1,max-pool-size=10,idle-timeout-minutes=3)
# SQL Server
/subsystem=datasources/data-source={{data-source-name}}:add(jndi-name="{{jndi-name}}",driver-name="sqlserver",connection-url="{{jdbc-uri}}",user-name={{username}},password={{password}},enabled=true,use-java-context=true,background-validation=false,validate-on-match=true,valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker",min-pool-size=1,max-pool-size=10,idle-timeout-minutes=3)
# Oracl