Skip to content

Instantly share code, notes, and snippets.

View clemlesne's full-sized avatar

Clémence Lesné clemlesne

View GitHub Profile
clemlesne /
Last active May 9, 2024 03:14
Extract Azure Monitor consumption by Azure Kubernetes Service Pod labels

Run this command against your Azure Monitor logs:

  | where TimeGenerated >= ago(360d)
  | project TimeGenerated, ContainerID, _BilledSize
  | lookup kind=leftouter (
        | where TimeGenerated >= ago(360d)
 | sort by TimeGenerated desc
clemlesne /
Last active March 15, 2024 15:25
LLM prompt to summarize a meeting

You are an executive assistant with 20 years of experience.


Assistant is working in an IT company.


Summarize a meeting transcript. The Transcript has been automatically generated by Teams.


  • Cite people for each main points
clemlesne /
Created February 8, 2024 17:21
Add users to Azure Entra ID and add them to a group, in a batch.
# Skip the header line
tail -n +2 "$CSV_FILE" | while IFS=',' read -r first_name last_name hackaton_group_number first_password
# Create the user in Azure AD, make sure the user principal name is in lowercase
display_name="$first_name $last_name"
user_principal_name="$(echo $first_name.$last_name | tr '[:upper:]' '[:lower:]')"
clemlesne /
Last active November 20, 2023 10:26
Convert a locally a Mermaid diagram to a HiDPI image, ready to use
# Function to check if a command exists
command_exists () {
type "$1" &> /dev/null ;
mermaid_cli() {
npx --yes @mermaid-js/mermaid-cli $@
clemlesne /
Created November 16, 2023 13:17
Easiliy optimize videos with FFMPEG from a folder
# Iterate over MP4, MOV and M4V files in the directory
find "." -type f \( -iname "*.mp4" -o -iname "*.MP4" -o -iname "*.mov" -o -iname "*.MOV" -o -iname "*.m4v" -o -iname "*.M4V" \) -exec sh -c '
for file do
echo "Optimizing: $file"
# Extract the file extension
# Generate a random file name for the temporary file, preserving the extension
clemlesne /
Last active November 10, 2023 10:33
OpenAI SDK wrapper for Azure AD authentications
from azure.identity import DefaultAzureCredential
from typing import Awaitable
import asyncio
import openai
# Set up the Azure credential
credential = DefaultAzureCredential()
def openai_refresh() -> None:
clemlesne /
Created November 7, 2023 15:20
Make transaprent and crop an image
# Display help with -h parameter
function display_help {
echo "Usage: $0 -i <image-path>"
echo " -h Display this help message."
echo " -i <image-path> Specify the image path for processing."
exit 1
title: Deployment workflow
flowchart LR

    subgraph azdo["Azure DevOps"]
        repo["Azure Repos"]
        pipeline["Azure Pipelines"]
clemlesne /
Created September 18, 2023 17:05
Takes a raw string of HTML and removes all HTML tags, Markdown tables, and line returns.
from typing import Optional
import re
import html
def sanitize(raw: Optional[str]) -> Optional[str]:
Takes a raw string of HTML and removes all HTML tags, Markdown tables, and line returns.
if not raw:
clemlesne / openai.svg
Created August 31, 2023 08:49
OpenAI SVG icon
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.