Skip to content

Instantly share code, notes, and snippets.

;; https://en.wikipedia.org/wiki/Maidenhead_Locator_System
;; http://no.nonsense.ee/qth/map.html
;; http://ham.stackexchange.com/questions/221/how-can-one-convert-from-lat-long-to-grid-square
(defn to-maidenhead
[lat long]
(let [long (-> long (+ 180) (/ 2))
lat (-> lat (+ 90))
funs [#(* 10 (mod % 1)) #(* 24 (mod % 1)) #(* 10 (mod % 1)) #(* 24 (mod % 1))]
(ns foo
(:require [immutant.messaging :as msg]))
(defonce magic (atom 0))
(defn foo-responder
"Return an incrementing magic number"
[_]
(swap! magic inc))
12:36:06,440 ERROR [immutant.runtime] (pool-1-thread-1) Unexpected error occurred loading immutant.init #<CompilerException java.lang.RuntimeException: No such var: clojure.core.cache/through, compiling:(clojure/core/memoize.clj:52:3)>
12:36:06,440 ERROR [org.jboss.msc.service.fail] (pool-1-thread-1) MSC00001: Failed to start service jboss.deployment.unit."sententia.webapi.clj".immutant.core.application-initializer: org.jboss.msc.service.StartException in service jboss.deployment.unit."sententia.webapi.clj".immutant.core.application-initializer: java.lang.RuntimeException: No such var: clojure.core.cache/through, compiling:(clojure/core/memoize.clj:52:3)
at org.projectodd.polyglot.core.AsyncService$1.run(AsyncService.java:52) [polyglot-core.jar:1.x.incremental.44]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_21]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt
12:04:27,230 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-4) JBAS010401: Bound JCA ConnectionFactory [java:/JmsXA]
12:04:30,124 INFO [org.torquebox.core.runtime] (pool-1-thread-1) Created ruby runtime (ruby_version: RUBY1_9, compile_mode: JIT, context: global) in 3.67s
12:04:30,584 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC00001: Failed to start service jboss.deployment.unit."ws.console-knob.yml".torquebox.messaging.destinationizer: org.jboss.msc.service.StartException in service jboss.deployment.unit."ws.console-knob.yml".torquebox.messaging.destinationizer: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA.jar:1.0.4.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
11:00:31,182 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Started GET "/admin/reports" for 127.0.0.1 at 2013-05-24 11:00:31 -0400
11:00:31,248 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Processing by ReportsController#index as HTML
11:00:31,757 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Rendered reports/_search.html.haml (492.0ms)
11:00:31,757 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Rendered reports/index.html.haml within layouts/application (498.0ms)
11:00:32,189 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Rendered layouts/_navigation.html.haml (10.0ms)
11:00:32,192 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Rendered layouts/_messages.html.haml (0.0ms)
11:00:32,192 INFO [ws-console] (http-localhost/127.0.0.1:8080-2) Completed 200 OK in 943ms (Views: 942.0ms)
# Place this file:
#
# /etc/jboss-as/jboss-as.conf
JBOSS_USER=jbossuser
STARTUP_WAIT=30
SHUTDOWN_WAIT=30
JBOSS_HOME=/home/jbossuser/jboss-as7
JBOSS_PIDFILE=/run/jboss-as-standalone.pid
@damionjunk
damionjunk / gist:5624551
Created May 22, 2013 01:12
Ubuntu AS7 startup script
#!/bin/sh
#
# JBoss standalone control script
#
# Provided in JBoss AS 7.1.1
# Modified for Ubuntu Server 10.04 by koma
#
# chkconfig: - 80 20
# description: JBoss AS Standalone
# processname: standalone
@damionjunk
damionjunk / gist:5616174
Last active December 17, 2015 13:19
JGroups TCPPING configuration for two nodes, 'ip.address.node.1', and 'ip.address.node.2'. Obviously, replace those strings with the IP addresses of the two AWS nodes.
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="TCPPING">
<property name="timeout">30000</property>
<property name="initial_hosts">ip.address.node.1[7600],ip.address.node.2[7600]</property>
</protocol>
<protocol type="MERGE2"/>
<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
@damionjunk
damionjunk / gist:5616083
Created May 20, 2013 22:24
Default Immutant/JBoss JGroups subsystem configuration
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="udp">
<stack name="udp">
<transport type="UDP" socket-binding="jgroups-udp"/>
<protocol type="PING"/>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
<protocol type="FD"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST2"/>
@damionjunk
damionjunk / gist:5595234
Last active December 17, 2015 10:29
Working Immutant/Torquebox JGroups subsystem configuration for cluster node discovery.
<subsystem xmlns="urn:jboss:domain:jgroups:1.1" default-stack="tcp">
<stack name="tcp">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<!-- Use S3_Ping because we need to discover the IPs of
the other nodes, and AWS doesn't have multicast. -->
<protocol type="S3_PING">
<!-- This user works -->
<property name="secret_access_key"></property>
<property name="access_key"></property>