Skip to content

Instantly share code, notes, and snippets.

View marcoaureliox's full-sized avatar

Marco Aurélio G. Pina marcoaureliox

View GitHub Profile
@sijie
sijie / geo-replication-demo-without-a-global-zookeeper.md
Last active September 5, 2023 14:01
Geo Replication Demo without a global zookeeper

This doc demonstrates how to do geo-replication across multiple pulsar clusters without a global configuration store (zookeeper).

This demo is using docker-compose to start 3 pulsar clusters. Each pulsar cluster has 1 zk, 1 bk, and 1 broker. The docker compose file can be found at https://gist.github.com/sijie/63737459112471a82957ae20bd78adb5.

The information of all the three clusters is listed in the following table:

zk configuration store broker
beijing zk-beijing zk-beijing broker-beijing
// (c) 2018 Sem Postma
// This code is licensed under MIT license
(function () {
var endScopeObj = {};
window.obj2xml = function (obj, opt) {
if (!opt) opt = {};
var rootName = opt.rootName || 'root';
var declaration = opt.declaration === 'auto' ? '<?xml version="1.0" encoding="utf-8"?>' : opt.declaration;
var indentation = opt.indentation || 0;
@SatyaSnehith
SatyaSnehith / Converter.java
Last active May 4, 2024 08:06
Convert Bytes to KB, MB, GB, TB - java
public class Converter{
static long kilo = 1024;
static long mega = kilo * kilo;
static long giga = mega * kilo;
static long tera = giga * kilo;
public static void main(String[] args) {
for (String arg: args) {
try {
System.out.println(getSize(Long.parseLong(arg)));
@serge1
serge1 / input.xml
Last active August 30, 2022 19:24
XSLT Transform by simple Java code
import javax.xml.transform.*;
import javax.xml.XMLConstants;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import java.io.File;
public class XsltTransform {
public static void main(String[] args) throws TransformerException {
Source xslt = new StreamSource(new File(args[0]));
Source xml = new StreamSource(new File(args[1]));