Skip to content

Instantly share code, notes, and snippets.

get activemqrar from http://mvnrepository.com/artifact/org.apache.activemq/activemq-rar/5.9.0

unzip activemq-rar-5.9.0.rar into a folder C:\jboss-eap-6.1\standalone\deployments\activemq-rar-5.9.0.rar

overwrite ra.xml into activemq-rar-5.9.0/META-INF

copy ironjacamar.xml into activemq-rar-5.9.0/META-INF

touch activemq-rar-5.9.0.rar.dodeploy in the deployments folder

@zeroDivisible
zeroDivisible / gist:8350834
Created January 10, 2014 12:03
Random PGSQL query generating a funny thing.
WITH RECURSIVE
q (r, i, rx, ix, g) AS
(
SELECT x + r::DOUBLE PRECISION * step, y + i::DOUBLE PRECISION * step,
x + r::DOUBLE PRECISION * step, y + i::DOUBLE PRECISION * step,
0
FROM (
SELECT 0.25 x, -0.55 y, 0.002 step, r, i
FROM generate_series(-40, 40) r
CROSS JOIN
@zeroDivisible
zeroDivisible / .vimrc
Created January 10, 2014 10:07
Random .vimrc file wich might be worth looking into.
" Modeline and Notes {
" vim: set sw=4 ts=4 sts=4 et tw=78 foldmarker={,} foldlevel=0 foldmethod=marker spell:
"
" __ _ _____ _
" ___ _ __ / _/ |___ / __ __(_)_ __ ___
" / __| '_ \| |_| | |_ \ _____\ \ / /| | '_ ` _ \
" \__ \ |_) | _| |___) |_____|\ V / | | | | | | |
" |___/ .__/|_| |_|____/ \_/ |_|_| |_| |_|
" |_|
"
@zeroDivisible
zeroDivisible / Emoticons
Last active December 31, 2015 00:29
Emoticons
༼ つ◕_◕༽つ
ಠ_ಠ
¯\_(ツ)_/¯
\( ゚◡゚)/
@zeroDivisible
zeroDivisible / SSLPoke.java
Created December 4, 2013 13:56
SSL testing stuff.
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@zeroDivisible
zeroDivisible / pgsql_recursive_query_example.sql
Created November 18, 2013 10:10
This is just an example pgSQL query. I don't have the exact schema right now, but basically, there was a tag (stored in table tags) which was mapping to parent (using parent_id) tag from the same table. Give a :startingTagId, this query returns a tag and all parents.
with recursive all_tags(rownum, id) as (
select 1::bigint, id, parent_id from tags where id = :startingTagId
union all
select rownum + 1, c.id, c.parent_id
from all_tags a
inner join tags c on a.parent_id = c.id)
select * from all_tags
@zeroDivisible
zeroDivisible / call_function.sql
Last active December 28, 2015 02:39
simple way of calling a SQL function in PostgreSQL given number of times.
select function_name() from generate_series(1, 2000)
@zeroDivisible
zeroDivisible / tokenize.sql
Last active December 28, 2015 01:29
Function using plpgsql which tokenizes given word. As an example, for input ``word`` it returns ``word wor ord``
-- returns word divided into smaller tokens, not shorter than value specified in
-- MINIMUM_LENGTH.
--
-- calling this with param `bobcat` will return 'bobcat bob obc bca cat bobc obca bcat bobca obcat'
--
-- Please note that changing this function, especially the minimum length which it uses
-- means that each INDEX which depends on it needs to be recreated
create or replace function tokenize(varchar, integer, integer) returns varchar as
$BODY$ declare
@zeroDivisible
zeroDivisible / gist:7404930
Created November 10, 2013 22:44
create gin index for ps_trgm extension
CREATE INDEX trgm_idx ON domain_names USING gin (domain_name gin_trgm_ops);
@zeroDivisible
zeroDivisible / vagrant-issue.md
Last active December 26, 2015 23:29
OSX + Vagrant + Virtualbox Issues.

After getting this error:

There was on error while executing VBoxManage, a CLI used by Vagrant for controlling VirtualBox. 
The command and stderr is shown below 

Command: ["hostonlyif", "create"]

Stderr: 0%... 
Progress state: NS_ERROR_FAILURE