Skip to content

Instantly share code, notes, and snippets.

View heinrich-ulbricht's full-sized avatar
🎯
Building WikiTraccs - Confluence to SharePoint migrations

Heinrich Ulbricht heinrich-ulbricht

🎯
Building WikiTraccs - Confluence to SharePoint migrations
View GitHub Profile
@heinrich-ulbricht
heinrich-ulbricht / swagger.v3.modified.json
Last active June 7, 2022 16:11
The Confluence Cloud REST API - modified to some day work with autorest; the current state fails
This file has been truncated, but you can view the full file.
{
"openapi": "3.0.1",
"info": {
"title": "The Confluence Cloud REST API",
"description": "This document describes the REST API and resources provided by Confluence. The REST APIs are for developers who want to integrate Confluence into their application and for administrators who want to script interactions with the Confluence server.Confluence's REST APIs provide access to resources (data entities) via URI paths. To use a REST API, your application will make an HTTP request and parse the response. The response format is JSON. Your methods will be the standard HTTP methods like GET, PUT, POST and DELETE. Because the REST API is based on open standards, you can use any web development language to access the API.",
"termsOfService": "https://atlassian.com/terms/",
"version": "1.0.0"
},
"externalDocs": {
@heinrich-ulbricht
heinrich-ulbricht / bluetooth-audio.sh
Created June 28, 2021 18:52
Set up bluetooth headphones with Qubes OS
#!/bin/bash
# original source from https://m7i.org/tips/qubes-VM-bluetooth-audio/
# fixed calls to qvm-usb and replaced bluetooth-assistant with bluetoothctl (see https://github.com/blueman-project/blueman/issues/1560)
# remember preparing AppVM template: sudo apt-get install qubes-usb-proxy bluez blueman pulseaudio-module-bluetooth pavucontrol
set -o errexit
set -o nounset
@heinrich-ulbricht
heinrich-ulbricht / CompressString.js
Created June 11, 2021 13:38
JavaScript: Compressing a string to send via query parameter
// pako finally worked (browser, Teams desktop client, Teams Android client); I tried/checked a lot of libraries but they either produced wrong results, did not compress good or were old or without good docs: shorter, shoco, lzma-js, lzutf8 (did not work in Teams Android client), lz-string
const pako = require('pako');
const {Base64} = require('js-base64');
let stringToCompress = 'test';
let compressedStringBytes = pako.deflate(stringToCompress);
let compressedStringBytesBase64 = Base64.fromUint8Array(compressedStringBytes, true);
// send via query parameter
// -----------------------------
@heinrich-ulbricht
heinrich-ulbricht / GetAllChildTerms.ts
Created May 5, 2021 07:04
Get all child terms from already retrieved list of parent terms
// note: in a previous step "parentTerms" has already been retrieved; now we want all child terms down the hierarchy
const childTermsPromise = (parentTerms: ((ITermData & ITerm)[])): Promise<(ITermData & ITerm)[]> => {
const termsWithChildTerms = [...parentTerms.filter(term => term.TermsCount > 0)];
if (termsWithChildTerms.length == 0) {
return Promise.resolve(parentTerms);
}
// get all child terms
const childPromises = termsWithChildTerms.map(childTerms => childTerms.terms.get().then(values => childTermsPromise(values)));
// wait for child terms and concat with parent terms
<View Scope="RecursiveAll">
<Query>
<Where>
<Eq>
<FieldRef Name="FSObjType" />
<Value Type="Integer">1</Value>
</Eq>
</Where>
</Query>
</View>
@heinrich-ulbricht
heinrich-ulbricht / install-docker-qubesos-deb10-templatevm.sh
Created February 23, 2020 21:13
Install Docker In Qubes OS Debian 10 TemplateVM (note the AppVM steps)
#!/bin/bash
#
# -----------------------
#
# This is a script that installs docker-ce (Docker Community Edition) on Debian 10
# Inspired by https://gist.github.com/upbeta01/3b968320b3a579c326ab6cd2a195b10d
#
# -----------------------
# Pre-requesite
@heinrich-ulbricht
heinrich-ulbricht / install-docker-deb9.sh
Created February 23, 2020 20:29 — forked from EsEnZeT/install-docker-deb9.sh
Install Docker In Debian 9 (Stretch)
#!/bin/bash
#
# -----------------------
#
# This is a script that installs docker-ce (Docker Community Edition) on Debian 9
# Inspired by https://gist.github.com/frgomes/a6f889583860f5b330c06c8b46fa0f42
#
# -----------------------
# Pre-requesite
@heinrich-ulbricht
heinrich-ulbricht / PnP-Sites-Core#2337
Created July 25, 2019 14:55
PnP-Sites-Core: PnP Template triggering #2377
<?xml version="1.0"?>
<pnp:Provisioning xmlns:pnp="http://schemas.dev.office.com/PnP/2019/03/ProvisioningSchema">
<pnp:Preferences Generator="OfficeDevPnP.Core, Version=3.11.1907.0, Culture=neutral, PublicKeyToken=c742ba29399ff639" />
<pnp:Templates ID="CONTAINER-TEMPLATE-09C0D16B3FF6469AA46E90AD5C44FC14">
<pnp:ProvisioningTemplate ID="TEMPLATE-09C0D16B3FF6469AA46E90AD5C44FC14" Version="1" BaseSiteTemplate="SITEPAGEPUBLISHING#0" Scope="RootSite">
<pnp:SiteFields>
<Field Type="Choice" DisplayName="Top-Thema" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" Format="Dropdown" FillInChoice="FALSE" Group="Contoso" ID="{d3083a16-74f7-49f1-b792-7541eb2ecb7e}" SourceID="{587860c6-5519-4cf5-a539-0b8729d5675b}" StaticName="Top-Thema" Name="Top-Thema">
<Default>Wohngesundheit</Default>
<CHOICES>
<CHOICE>Wohngesundheit</CHOICE>
@heinrich-ulbricht
heinrich-ulbricht / Manage-AzureADPSAppRoleAssignments.ps1
Created July 16, 2019 07:25 — forked from psignoret/Manage-AzureADPSAppRoleAssignments.ps1
Add or remove application permissions to a client application.
<#
.SYNOPSIS
Grants (or removes) application permissions (app role assignments) to a client application.
.PARAMETER ClientId
The AppId or one of the ServicePrincipalNames of the client service principal.
.PARAMETER Permissions
A hashtable where the key is an identifier for the resource (either the AppId or one of the
ServicePrincipalNames) and the value is the space-separated list of app roles desired.
@heinrich-ulbricht
heinrich-ulbricht / Test-Ports.ps1
Created April 18, 2019 09:14
check if certain ports can be reached from your internal network or if they are blocked
# check if certain ports can be reached from your internal network or if they are blocked
# note: adapted from https://github.com/JustinGrote/Scripts/blob/master/Test-TCPPort.ps1
function Test-Port()
{
Param([string]$srv, $port = 135, $timeoutMs = 3000, [switch]$verbose)
$failed = $false
$ErrorActionPreference = "SilentlyContinue"
$tcpclient = New-Object System.Net.Sockets.TcpClient