Skip to content

Instantly share code, notes, and snippets.

View ivarprudnikov's full-sized avatar
🌍
Vivamus, moriendum est.

Ivar (aɪvɑr) ivarprudnikov

🌍
Vivamus, moriendum est.
View GitHub Profile
@ivarprudnikov
ivarprudnikov / main.py
Created January 10, 2025 18:19
Summarize files using Azure OpenAI via the Python script. It would be necessary to deploy the models in Azure OpenAI for this to work.
DOC_PATH=./my-docs
AZURE_OPENAI_ENDPOINT=https://foobar-eastus2.cognitiveservices.azure.com
AZURE_OPENAI_API_KEY=change-me
@ivarprudnikov
ivarprudnikov / README.md
Created January 4, 2025 19:31
Summarise MS Stream transcripts after downloading them from the website as JSON files.

Lecture transcripts

To get the transcripts I got them in the MS Stream website. The transcript was extracted when inspecting the file downloads in the network tab. You need to filter the network tab to list the paths that contain "transcript" and select the largest one. The response will contain the JSON which was copied to this directory in the form of transcript.MMMDD.json.

Convert JSON to Markdown

Make sure you have Node.JS in path and then run the script:

node convertTranscript.js
podx-0 /foo/bar/
ledger_1-7.committed ledger_10003-10629.committed ledger_8-10002.committed
podx-0 /foo/baz/
snapshot_10002_10004.committed snapshot_148573_148575.committed snapshot_202606_202607.committed
podx-1 /foo/bar/
ledger_1-7.committed ledger_10003-10629.committed ledger_8-10002.committed
podx-1 /foo/baz/
apt-get update
apt-get install gvm
...
gvm-setup
...
gvm-check-setup
...
// fix issues by looking into output
...
@ivarprudnikov
ivarprudnikov / go.mod
Created February 29, 2024 12:14
Create COSE_Sign1 signature envelope in Go and sign with a key in Azure KeyVault
module something.com/whatever
go 1.19
require github.com/veraison/go-cose v1.1.1-0.20240126165338-2300d5c96dbd
require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.2 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.2 // indirect
@ivarprudnikov
ivarprudnikov / multipart-form-data.go
Created February 27, 2023 15:36
Send multipart form data in go
package main
import (
"bytes"
"mime/multipart"
"net/http"
)
func PostFormMultipart(content []byte) (*http.Response, error) {
url := "http://localhost:8080"
@ivarprudnikov
ivarprudnikov / sh
Created September 21, 2022 15:57
Create CosmosDB authorization token
#!/bin/env bash
set -e
# Generate Cosmos DB authorization header
# and create a database in the emulator
# HTTP-date
# https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1
ISSUE_DATE=$(TZ=GMT date '+%a, %d %b %Y %T %Z')
@ivarprudnikov
ivarprudnikov / inspect.sh
Created February 16, 2022 12:53
Run and inspect a Docker container
$ docker exec -it testcontainer /bin/bash
[root@18dbc0919c88 /]#
@ivarprudnikov
ivarprudnikov / main.go
Created November 5, 2021 18:07
Go parallel execution
package main
import (
"errors"
"log"
"time"
"sync"
"fmt"
)
@ivarprudnikov
ivarprudnikov / mergeSort.js
Created February 7, 2021 13:21
Merge sort in javascript
var arr = [0,5,7,3,4,9,6,2,1,8];
var ans = [0,1,2,3,4,5,6,7,8,9];
// Split array into smaller chunks recursively [a,b,c,d] => [a,b] and [c,d]
// At the bottom (or top of stack) start merging those back
// O(NlogN)
function mergeSort(a, startIdx, endIdx) {
if (startIdx < endIdx) {
var mid = Math.floor((startIdx + endIdx)/2);
mergeSort(a, startIdx, mid);