Posts

Showing posts from June, 2013

ActiveMQ https

ActiveMQ supports tunneling JMS over https to transparently traverse firewalls, but the documentation doesn't indicate how to configure it and relevant examples were lacking via google. After hacking for half a day I finally stumbled upon the simple solution. Keep in mind that you will want to create you own keys and certificate. For testing I just used the ones provided in the activemq/conf dir.

Simply configure an https transport connector in conf/activemq.xml and pass the keystore, password, and truststore to activemq when started.
conf/activemq.xml
<amq:transportconnector uri="https://0.0.0.0:61684">
activemq start parameters
-Djavax.net.ssl.keyStore=/path/activemq/conf/broker.ks
-Djavax.net.ssl.keyStorePassword=password
-Djavax.net.ssl.trustStore=/path/activemq/conf/broker.ts
import self-signed cert into client jdk keystore
cd /path/jdk1.7.0_15/jre/lib/security keytool -import -trustcacerts -file /path/activemq/conf/broker-localhost.cert -alias activemq -keystore cac…

Ubuntu nfsv4 mount

Ubuntu documentation

Server:

Create export directory or skip if exporting an existing dir:
sudo mkdir /export/someDir Install nfs server:
sudo apt-get install nfs-kernel-server Edit /etc/exports
Add directory to export, could also be an existing dir:
/export/someDir  *(ro,sync,no_root_squash) Start nfs server:
sudo /etc/init.d/nfs-kernel-server start
Client:
Create mount point: sudo mkdir /media/someDir Install nfs server:
sudo apt-get install nfs-kernel-server Mount exported dir: sudo mount 192.168.25.123:/export/someDir /media/someDir List all mounts

mount

due to a bug, nfs mounts in /etc/fstab fail at startup
Create a start script to resolve the issue.

Startup/shutdown scripts:

http://wiki.debian.org/LSBInitScripts
Creates and removes /etc/init.d scripts:


sudo update-rc.d -f mount_nfs.sh removesudo update-rc.d mount_nfs.sh defaults

Master/Slave Management script

#!/bin/bash
function trylock {
  (
    #attempt to acquire lock
    flock -n 9 || { trylockResult=false; return; }
    #start/set/open…