Skip to content

Instantly share code, notes, and snippets.

View dedunumax's full-sized avatar

Dedunu Dhananjaya dedunumax

View GitHub Profile
@dedunumax
dedunumax / Multi-node-Vagrantfile
Last active July 30, 2023 10:20
Multi node sample vagrant file.
Vagrant.configure("2") do |config|
config.vm.define "master" do |master|
master.vm.box = "ubuntu/trusty64"
master.vm.hostname = "master.local"
master.vm.network "private_network", ip: "192.168.2.2"
end
config.vm.define "slave1" do |slave1|
slave1.vm.box = "ubuntu/trusty64"
slave1.vm.network :private_network, ip: "192.168.2.3"
@dedunumax
dedunumax / Vagrantfile
Created May 18, 2015 12:17
Sample vagrant file.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@dedunumax
dedunumax / alfresco.log
Created May 14, 2015 10:07
Alfresco error log for soffice
2015-05-14 10:04:16,607 ERROR [repo.content.JodConverterSharedInstance] [localhost-startStop-1] Unable to start JodConverter library. The following error is shown for informational purposes only.
org.artofsolving.jodconverter.office.OfficeException: failed to start and connect
at org.artofsolving.jodconverter.office.ManagedOfficeProcess.startAndWait(ManagedOfficeProcess.java:68)
at org.artofsolving.jodconverter.office.PooledOfficeManager.start(PooledOfficeManager.java:101)
at org.artofsolving.jodconverter.office.ProcessPoolOfficeManager.start(ProcessPoolOfficeManager.java:66)
at org.alfresco.enterprise.repo.content.JodConverterSharedInstance.afterPropertiesSet(JodConverterSharedInstance.java:239)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1510)
at org.springframework.b
@dedunumax
dedunumax / nextTuple.java
Created May 14, 2015 04:42
nextTuple() for Alfresco
@Override
public void nextTuple() {
if(listIterator!= null && listIterator.hasNext()) {
// Returning node by node
Map<String, Object> item = listIterator.next();
JSONObject jsonObject = new JSONObject();
for (Map.Entry<String, Object> mapEntry : item.entrySet()) {
jsonObject.put(mapEntry.getKey(), mapEntry.getValue());
}
@dedunumax
dedunumax / IMAPTest.java
Last active August 29, 2015 14:18
List down all the folders using IMAP protocol.
package org.dedunu.imap;
import java.util.Properties;
import javax.mail.Folder;
import javax.mail.Session;
import javax.mail.Store;
public class IMAPTest {
public static void main(String []args) {
Properties props = System.getProperties();
@dedunumax
dedunumax / JMeterIMAPTest.java
Last active August 29, 2015 14:18
JMeter code for IMAP Testing
import java.util.*;
import javax.mail.Folder;
import javax.mail.Session;
import javax.mail.Store;
Properties props = System.getProperties();
props.setProperty("mail.store.protocol","imap");
Session session = Session.getDefaultInstance(props, null);
try {
package org.dedunu.alfresco;
import java.util.HashMap;
import java.util.Map;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.DeclarativeWebScript;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
<webscript>
<shortname>Java based Sample Webscript</shortname>
<description>This simple WebScript prints Hello World</description>
<url>/dedunu/helloworld</url>
<authentication>user</authentication>
<format default="html"></format>
</webscript>