Skip to content

Instantly share code, notes, and snippets.

View ar's full-sized avatar

Alejandro Revilla ar

View GitHub Profile
@ar
ar / jpos-mvn.txt
Created November 17, 2010 20:41
jPOS Maven Build
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] jPOS Project
[INFO] jPOS Core
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jPOS Project 1.8-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
@ar
ar / pom.xml
Created November 22, 2010 13:41
jPOS POM Info
<repository>
<id>jpos</id>
<name>jPOS Central Repository</name>
<url>http://jpos.org/maven</url>
<layout>default</layout>
</repository>
<dependency>
<groupId>org.jpos</groupId>
@ar
ar / Q2 script
Created December 7, 2010 21:48
Q2 start script
#!/bin/bash
cd $HOME/git/jpos
mvn -Dmaven.test.skip=true clean package
cd jpos/target
tar zxf jpos-1.8.0.tar.gz
cd jpos-1.8.0
exec bin/q2
#!/bin/bash
if [ "$1"x == "x" ]; then
echo "Wrong number of parameters. Usage: $0 projectname";
exit 1
fi
mkdir $1 || exit 1
echo "Creating directory $1"
svn add $1
@ar
ar / pwdc
Created December 21, 2010 19:24
Copy working directory (pwd) to clipboard
#!/bin/bash
echo -n `pwd` | pbcopy
@ar
ar / BaseChannel.socketClose.java
Created January 17, 2011 23:13
BaseChannel.socketClose
private void closeSocket() throws IOException {
Socket s = null;
synchronized (this) {
if (socket != null) {
s = socket; // we don't want more than one thread
socket = null; // attempting to close the socket
}
}
if (s != null) {
try {
@ar
ar / Parity.java
Created January 23, 2011 00:42
Adjust parity
public class Util {
/**
* DES Keys use the LSB as the odd parity bit. This method can
* be used enforce correct parity.
*
* @param bytes the byte array to set the odd parity on.
*/
public static void adjustDESParity (byte[] bytes) {
for (int i = 0; i < bytes.length; i++) {
@ar
ar / dave-mbp.xml
Created February 17, 2011 19:11
Who can beat Dave's new MBP?
<profiler>
PACK tps=51505, peak=51505, avg=34402.50 [2281.8/2281.8]
UNPACK tps=43221, peak=43221, avg=21610.50 [1989.6/4271.4]
PACK/UNPACK tps=26035, peak=26687, avg=22932.25 [3807.2/8078.6]
UPDATE/PACK/UNPACK tps=17016, peak=17016, avg=16471.67 [6679.7/14758.4]
end [14758.4/14758.4]
</profiler>
01 00000003 Preparing org.jpos.jpts.PrepareContext
01 00000003 Preparing org.jpos.transaction.Open
00 00000004 Preparing org.jpos.jpts.PrepareContext
00 00000004 Preparing org.jpos.transaction.Open
02 00000005 Preparing org.jpos.jpts.PrepareContext
02 00000005 Preparing org.jpos.transaction.Open
03 00000006 Preparing org.jpos.jpts.PrepareContext
03 00000006 Preparing org.jpos.transaction.Open
@ar
ar / jline.patch
Created April 5, 2011 16:37
jline issue on OS X and proposed simple patch
We found an issue when running it on OS X, we get this exception:
java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:99)
at jline.ClassNameCompletor.getClassNames(ClassNameCompletor.java:89)
at jline.ClassNameCompletor.<init>(ClassNameCompletor.java:33)