Skip to content

Instantly share code, notes, and snippets.

View lognseth's full-sized avatar
🏳️‍🌈

Mikael Lognseth lognseth

🏳️‍🌈
View GitHub Profile
@lognseth
lognseth / Convert-MelaToCrouton.ps1
Last active May 25, 2023 19:58
Mela to Crouton converter
<#
.SYNOPSIS
Converts Mela recipe format to Crouton
.DESCRIPTION
#>
[CmdletBinding()]
@lognseth
lognseth / clean_acr.py
Last active March 10, 2023 21:43
clean-acr
import os
import re
from azure.containerregistry import ContainerRegistryClient
from azure.identity import DefaultAzureCredential
# Set up authentication
credential = DefaultAzureCredential()
# Set up the container registry client
registry_name = os.environ["ACR_REGISTRY_NAME"]
@lognseth
lognseth / new_image_deployment.py
Created January 12, 2023 14:33
Environment deployments
import subprocess
import os
import re
NewTagFromBuildPipeline = None # set to a string or use input() to take user input
Stage = None # set to a string or use input() to take user input
if not NewTagFromBuildPipeline:
NewTag = os.environ.get("NewTag")
print("new tag is:", NewTag)
@lognseth
lognseth / grafana-users.csv
Created November 23, 2022 13:12 — forked from ashnehete/grafana-users.csv
Bulk Create Grafana Users
name email role
Admin User admin@example.com Admin
Editor User editor@example.com Editor
Viewer User viewer@example.com Viewer
# Datasources
data "azurerm_virtual_network" "vnet" {
name = var.vnet_name
resource_group_name = var.vnet_resource_group_name
}
data "azurerm_subnet" "host_dbw_snt" {
name = "host_dbw_snt"
virtual_network_name = var.vnet_name
@lognseth
lognseth / generate-self-signed-cert.sh
Last active March 22, 2022 10:11
Generates self-signed certificates to be used when creating MTLS solutions.
#!/bin/bash
# Script to generate self-signed certificates to be used with nginx-ingress and MTLS.
# Made in such a way that is harder to accidentally overwrite any other certificates previously generated...
echo "Please enter customer, use case and stage name"
echo "Customer:"
read cust
# Installation script for Shairport and dependencies
# First run chmod +x install_shairport_airplay2.sh
# Then run sh install_shairport_airplay2.sh
cd
cd Downloads
iwconfig wlan0 power off
apt-get update && apt-get upgrade -y
@lognseth
lognseth / Windows_app_install.ps1
Last active February 10, 2022 09:44
App installation script for Windows computer, installs depending on work or pleasure.
# This script is used to install a) personal b) work c) both personal and work applications on a machine running Windows 11
# Running this script will also install WSL and Ubuntu on WSL
# Use at your own risk
Write-Host "Checking for elevated permissions..."
if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "Insufficient permissions to run this script. Open the PowerShell console as an administrator and run this script again."
Break
}

Keybase proof

I hereby claim:

  • I am lognseth on github.
  • I am lognseth (https://keybase.io/lognseth) on keybase.
  • I have a public key ASAKiRu_bSSi-S_Y1wMCma2TYK-Vx3pPe8ARH_crtDUSZQo

To claim this, I am signing this object:

@lognseth
lognseth / README.md
Last active July 28, 2023 11:09
Installation script for my most used tools on macOS

Manual steps

Node

Run nvm install 16 && nvm install 18 && nvm use 16

Go

Language server