Skip to content

Instantly share code, notes, and snippets.

View yooakim's full-sized avatar
⌨️
Focusing

Joakim Westin yooakim

⌨️
Focusing
View GitHub Profile
@yooakim
yooakim / Get-PublicIPs.ps1
Last active August 25, 2022 07:41
Simple PowerShell + AZ CLI to get public IP addresse from all subscriptions I have access to
$Subscriptions = az account list --query '[].{Id:id,Name:name,TenantId:tenantId}' | ConvertFrom-Json
$PublicIPs=$Subscriptions | % { az network public-ip list --query '[].{Name:name,PublicIP:ipAddress,Version:publicIpAddressVersion,Method:publicIpAllocationMethod,SKU:sku.name,ResourceGroup:resourceGroup,DNS:dnsSettings.fqdn,d:id}' --subscription $_.Id -o json | ConvertFrom-Json }
$PublicIPs | select Name,PublicIP, ResourceGroup, SKU, Version, Method | Sort-Object Name | Format-Table -AutoSize
$PublicIPs
@yooakim
yooakim / gist:f319abd453f1b62e21e588d7f797ac28
Created September 7, 2023 05:09
enable-az-web-account-manager
# [Windows only] Azure CLI is collecting feedback on using the Web Account Manager (WAM) broker for the login experience.
#
# You may opt-in to use WAM by running the following commands:
az config set core.allow_broker=true
az account clear
az login
@yooakim
yooakim / gist:618c67d10a344c0bdeec17e4e9aba73a
Created February 7, 2024 10:18
Install Cascadya COver Nerdfont on Ubuntu
sudo apt install wget fontconfig \
&& wget -P ~/.local/share/fonts https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/CascadiaCode.zip \
&& cd ~/.local/share/fonts && unzip CascadiaCode.zip && rm *Windows* && rm CascadiaCode.zip && fc-cache -fv
@yooakim
yooakim / gist:276cbdebd841b5def31fdac3cb533f17
Last active February 15, 2024 07:13
Download duckdb CLI (Linux)
# Set the GitHub API URL for the latest release of duckdb
API_URL="https://api.github.com/repos/duckdb/duckdb/releases/latest"
# Use curl to fetch the latest release data and grep to extract the asset's browser_download_url
DOWNLOAD_URL=$(curl -s $API_URL | grep -oP '"browser_download_url": "\K(.*duckdb_cli-linux-amd64.zip)')
# Download the latest release using the extracted URL
curl -L $DOWNLOAD_URL -o duckdb_cli-linux-amd64.zip
# Create the target directory if it doesn't exist
@yooakim
yooakim / gist:6e06f7d543fa772494b237dbefa447e2
Created May 15, 2024 14:10
Windows Terminal DuckDb profile
{
"commandline": "duckdb.exe",
"cursorShape": "filledBox",
"font":
{
"face": "Cascadia Code"
},
"guid": "{5b381983-78db-4954-b6b0-8f1749cb7530}",
"hidden": false,
"icon": "ms-appdata:///roaming/DuckDB.png",