Skip to content

Instantly share code, notes, and snippets.

@neilcarlocatalan
neilcarlocatalan / install-mongo-shell.md
Last active April 14, 2022 19:04
Installing Mongo Shell in Linux box
download mongosh v0.5.2 tarball then untar to /user/local/bin
$ wget -O - https://downloads.mongodb.com/compass/mongosh-0.5.2-linux.tgz | tar -C /usr/local/bin -xzf -
download mongosh v1.3.1 tarball then untar to /user/local/bin
$ wget -O - https://downloads.mongodb.com/compass/mongosh-1.3.1-linux-x64.tgz | tar --strip-components 2 -C /usr/local/bin -xzf -
@neilcarlocatalan
neilcarlocatalan / spring-context.xml
Last active May 22, 2019 17:10
Different Ways of Injecting Bitronix Transaction Manager
<aop:config>
<aop:pointcut id="serviceOperation" expression="your-pointcut-expression" />
<aop:advisor advice-ref="transactionAdvice" pointcut-ref="serviceOperation" />
</aop:config>
<tx:advice id="transactionAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="*" read-only="false" />
<tx:method name="find*" read-only="true" rollback-for="java.lang.Exception" />
<tx:method name="get*" read-only="true" rollback-for="java.lang.Exception" />
@neilcarlocatalan
neilcarlocatalan / spring-context.xml
Created May 10, 2019 03:55
Different Ways Creating Spring Bean for Oracle Data Source
<!-- non-XA Oracle DS wrapped with UCP with UCP pooled data source Factory -->
<bean id="dataSource" class="oracle.ucp.jdbc.PoolDataSourceFactory" factory-method="getPoolDataSource">
<property name="URL" value="jdbc:oracle:thin:@myserver:1521:mysid" />
<property name="user" value="myuser" />
<property name="password" value="mypassword" />
<property name="connectionFactoryClassName" value="oracle.jdbc.pool.OracleDataSource" />
<property name="connectionPoolName" value="ANAG_POOL" />
<property name="minPoolSize" value="5" />
<property name="maxPoolSize" value="10" />
<property name="initialPoolSize" value="5" />
@neilcarlocatalan
neilcarlocatalan / mavenized-liferay-plugins-build.xml
Created July 24, 2016 17:47
How to Mavenize Liferay Plugins Ant build.xml
<?xml version="1.0"?>
<!-- Download Maven ant tasks jar form http://maven.apache.org/ant-tasks/download.html and drop it into your $ANT_HOME/lib -->
<project name="mavenized-liferay-plugins-build" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant" default="copy-dependencies-and-deploy">
<import file="../build-common-portlet.xml" />
<property name="app.lib.dir" value="docroot/WEB-INF/lib" />
<!-- Include the your project dependencies -->