Skip to content

Instantly share code, notes, and snippets.

@ogerardin
ogerardin / updateConfluence.sh
Created December 8, 2023 13:01
Export Archi collaborative model to Confluence page
#! /bin/bash
# This script will export the views from an Archi collaborative model and upload them to a Confluence page.
# Usage: updateConfluence.sh [ DIR ]
# where DIR is base directory of the Archi model repo. If it is not specified, it defaults to the parent directory of
# this script (which reflects this repo's structure).
#
# Requirements: curl, yq, xmllint, git
#
# Ref:
@ogerardin
ogerardin / gist:7e7789fbcae341cbd6cffa8f292157c6
Last active November 27, 2023 16:20
Export Archi diagrams to Confluence
#! /bin/bash
# This script will export the model's views and upload them to a Confluence page.
# Tested on Windows with bash 5.2.21 (git-bash), Archi 5.2.0, Confluence server 7.19.16
# Requirements: curl, jq, xmllint
#
# Ref:
# Confluence API doc: https://docs.atlassian.com/ConfluenceServer/rest/7.19.16/
# Archi CLI doc: https://github.com/archimatetool/archi/wiki/Archi-Command-Line-Interface
@ogerardin
ogerardin / gist:014aff71b7d7aacf4bbfb3b8bbc575b7
Created July 25, 2023 14:18
Convert VMware VM to UTM (Mac)
Export VM as OVF
/Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/ovftool VM.vmwarevm/VM.vmx .
Convert .vmdk to .qcow2
qemu-img convert -p -f vmdk -O qcow2 VM-disk1.vmdk VM-disk1.qcow2
Create custom VM in UTM matching VM hardware
Remove default disk
Add drive / import QCOW2 file (file is copied to default UTM VM folder)
Add CD/DVD drive
sudo synogroup --add docker
sudo chown root:docker /var/run/docker.sock
sudo synogroup --member docker $USER
@ogerardin
ogerardin / Sort.java
Created May 19, 2021 22:40
some sort algorithms in Java
package com.ogerardin.xpman.util;
import lombok.experimental.UtilityClass;
import java.util.Comparator;
import java.util.List;
@UtilityClass
public class Sort {
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.collect.Streams;
import lombok.Data;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
package poly
import (
"b2b-go/lib/typeregistry"
"fmt"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
"github.com/globalsign/mgo/dbtest"
"io/ioutil"
"os"
@ogerardin
ogerardin / Maven version in .Net projet
Last active October 12, 2018 13:19
Retrieve Maven version in .Net projet
Add a custom attibute "MavenVersion" to the assembly
----------------------------------------------
- Add the file MavenVersion.cs to the project
- Add a line [assembly: MavenVersion("")] in the appropriate AssemblyInfo.cs files
Update attribute during build
-----------------------------
- Using NuGet package manager, add the following dependency to the project: "MSBuildTasks" by LoreSoft
- Add the following line to the project's .csproj file under <Projet> element (edit path as appropriate):
@ogerardin
ogerardin / extractjdk.bat
Last active May 29, 2024 02:42
Extract an Oracle JDK for Windows (up to Java 8) from the EXE file
@echo off
rem
rem Extract an Oracle JDK for Windows (up to Java 8) from the EXE file
rem (c) Olivier Gérardin 2018 [email protected]
rem Adapted from https://stackoverflow.com/questions/1619662/how-can-i-get-the-latest-jre-jdk-as-a-zip-file-rather-than-exe-or-msi-installe
rem
setlocal EnableDelayedExpansion
set INTERACTIVE=1
@ogerardin
ogerardin / Running Docker in Alpine Linux running in QEMU on Windows (64 bits)
Last active November 23, 2021 18:32
Running Docker in Alpine Linux running in QEMU on Windows (64 bits)
Download latest qemu-w64-setup-*.exe from https://qemu.weilnetz.de/w64
Extract qemu-w64-setup-*.exe using 7-Zip to a directory named "qemu"
Download Alpine ISO image (Extended) for x86_64 from https://alpinelinux.org/downloads/
Create disk image using "qemu-img create hd.img 10G"
Copy start.bat next to ISO image and hd.img, adjust qemu path if required
Start QEMU using start.bat
(Let Alpine Linux boot from ISO)
Login using "root" (no password)
Start setup by entering "setup-alpine"