Skip to content

Instantly share code, notes, and snippets.

View hkboujrida's full-sized avatar

Haithem BOUJRIDA hkboujrida

View GitHub Profile
curl -X POST \
-H "Ocp-Apim-Subscription-Key: YOUR_DOCUMENT_INTELLIGENCE_SUBSCRIPTION_KEY" \
-H "Content-Type: multipart/form-data" \
-F "file=@c:/data/example.pdf" \
"YOUR_DOCUMENT_INTELLIGENCE_ENDPOINT/documentintelligence/rest/v1.0-preview/custom/models/YOUR_MODEL_GUID/analyze"
param (
[Parameter(Mandatory = $true)]
[string]$Organization,
[Parameter(Mandatory = $true)]
[string]$Project,
[Parameter(Mandatory = $true)]
[string]$ClientId,
# read a json local file from local disk and extract the build information
import json
import requests
json_url = 'http://localhost:8080/v1/rules'
# load json form url and extract the build information
json_file = requests.get(json_url).json()
# json_file = 'test.json'
# get base adress from json_url
https://583c-77-201-81-191.ngrok-free.app/dashboards
cluster:
name: my-cluster
externalServices:
prometheus:
host: http://mimir-nginx.observability.svc:80
# queryEndpoint: /api/v1/push
writeEndpoint: /api/v1/push
authMode: none
tenantId: "1"
# Powershell script to download and install grafana alloy in silent mode
# https://github.com/grafana/alloy/releases/download/v1.1.1/alloy-installer-windows-amd64.exe.zip
# Define the URL of the alloy installer
$url = "https://github.com/grafana/alloy/releases/download/v1.1.1/alloy-installer-windows-amd64.exe.zip"
# Define the path where the installer will be saved
$installerPath = "$env:TEMP\alloy-installer-windows-amd64.exe.zip"
# Download the installer
Invoke-WebRequest -Uri $url -OutFile $installerPath
docker run -it \
--name pytorch \
--network=host \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--device=/dev/kfd \
--device=/dev/dri \
--group-add video \
--ipc=host \
--shm-size 8G \
@hkboujrida
hkboujrida / cidr
Last active March 1, 2024 13:08
cidr
output_address_cidr = "${join(".", [split(".", local.base_address)[0], split(".", local.base_address)[1], split(".", local.base_address)[2], split(".", split("/", local.other_address_cidr)[0])[3]])}/${split("/", local.other_address_cidr)[1]}"
# terraformer import azure -R edgeprime-oss -r subnet
# terraform plan -out=tfplan
# terraform show -json tfplan > plan.json
# bash script to automatically import state to terraform
#!/bin/bash
# get all the ressources id and name from the state file
file="imported.tfstate"
# jq '.modules[].resources | .[] | {type: .type, id: .primary.id, name: .primary.attributes.name}' "$file"
# put the ressources id and name, and type with jq into the variable ressources
existing_ressources=$(jq '[.modules[].resources | .[] | { type: .type, name: .primary.attributes.name, id: .primary.id}]' imported.tfstate)
provider "azurerm" {
features {}
}
data "azurerm_container_registry" "acr" {
name = var.registry_name
resource_group_name = var.resource_group_name
}
resource "azurerm_container_registry_task" "daily_purge_prod_images" {