Skip to content

Instantly share code, notes, and snippets.

@eosfor
eosfor / spec.json
Created June 25, 2025 06:10
notWorking2
{
"data": [
{
"name": "link-data-raw",
"values": [
{"source": 0, "target": 0, "value": 2, "src": 0, "tgt": 0},
{"source": 0, "target": 1, "value": 2, "src": 0, "tgt": 1},
{"source": 0, "target": 2, "value": 2, "src": 0, "tgt": 2},
{"source": 0, "target": 3, "value": 2, "src": 0, "tgt": 3},
{"source": 0, "target": 4, "value": 2, "src": 0, "tgt": 4},
@eosfor
eosfor / spec.json
Created June 24, 2025 06:42
working
{
"data": [
{
"name": "link-data-raw",
"values": [
{"source": 0, "target": 0, "value": 2, "src": 0, "tgt": 0},
{"source": 0, "target": 1, "value": 2, "src": 0, "tgt": 1},
{"source": 0, "target": 2, "value": 2, "src": 0, "tgt": 2},
{"source": 0, "target": 3, "value": 2, "src": 0, "tgt": 3},
{"source": 0, "target": 4, "value": 2, "src": 0, "tgt": 4},
@eosfor
eosfor / spec.json
Created June 24, 2025 06:18
notWorking01
{
"data": [
{
"name": "link-data-raw",
"values": [
{"source": 0, "target": 0, "value": 2, "src": 0, "tgt": 0},
{"source": 0, "target": 1, "value": 2, "src": 0, "tgt": 1},
{"source": 0, "target": 2, "value": 2, "src": 0, "tgt": 2},
{"source": 0, "target": 3, "value": 2, "src": 0, "tgt": 3},
{"source": 0, "target": 4, "value": 2, "src": 0, "tgt": 4},
@eosfor
eosfor / spec.json
Created June 18, 2025 09:40
vegaTransformNotWorking
{
"data": [
{
"name": "node-data",
"values": [
{"name": "https://azazello.darkcity.dev", "group": 1, "index": 0},
{
"name": "https://azazello.darkcity.dev/system-account-report/index2",
"group": 1,
"index": 1
$vm = Get-AzVM -Status | % { Add-Member -InputObject $_ -Name "NICObj" -MemberType NoteProperty -Value (Get-AzNetworkInterface -ResourceId $_.NetworkProfile.NetworkInterfaces[0].id) -Force -PassThru } |
% { Add-Member -InputObject $_ -Name "PrivateIP" -MemberType NoteProperty -Value ($_.NICObj.IpConfigurations[0].PrivateIpAddress) -Force -PassThru} |
% { if ($_.NICObj.IpConfigurations[0].PublicIpAddress.count -gt 0) {
$rIdparsed = $_.NICObj.IpConfigurations[0].PublicIpAddress[0].Id -split "/";
Add-Member -InputObject $_ -Name "PublicIP" -MemberType NoteProperty -Value ((Get-AzPublicIpAddress -Name $rIdparsed[-1] -ResourceGroupName $rIdparsed[4]).IpAddress) -Force -PassThru
}
else {
$_
}
} |
@eosfor
eosfor / findAlertRules.ps1
Created February 1, 2022 08:55
pill alert rules and their action groups from azure where action groups have a webhook attached
$q = "resources
| where type == `"microsoft.insights/metricalerts`"
| extend prop = parse_json(properties)
| extend agId = tolower(tostring(prop.actions[0].actionGroupId))
| project metricsid = ['id'], mname = name, mresourceGroup = resourceGroup, agId
| join kind = inner ( resources
| where type == `"microsoft.insights/actiongroups`"
| extend prop = parse_json(properties)
| project actiongroupid = tolower(id), aname = name, aresourcegroup = resourceGroup, whURL = tostring(prop.webhookReceivers[0].serviceUri)
| where whURL != `"`")
@eosfor
eosfor / kube-minizinc.mzn
Last active September 17, 2021 05:59
Quick and dirty minizinc model to estimate cluster costs
include "all_equal.mzn";
% config section
int: maxClusterSize = 6;
float: minNodeRAMConsumption = 0.5;
float: maxNodeRAMConsumption = 0.8;
float: minNodeCPUConsumption = 0.1;
float: maxNodeCPUConsumption = 0.8;
% end config
@eosfor
eosfor / graphSysmonNetworkEvents.ps1
Last active October 4, 2018 16:47
graph network events from sysmon
$ids = Get-WinEvent -LogName Microsoft-Windows-Sysmon/Operational | ? {$_.id -eq 3}
$commObjects = $ids | % {
New-Object psobject -Property @{
RuleName = $_.Properties[0].value
UtcTime = $_.Properties[1].value
ProcessGuid = $_.Properties[2].value
ProcessId = $_.Properties[3].value
Image = $_.Properties[4].value
User = $_.Properties[5].value
Protocol = $_.Properties[6].value
@eosfor
eosfor / getPodStatus.ps1
Last active September 3, 2018 15:43
Get status of a pod
function Get-PodStatus {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[string]$ContextName,
[Parameter(Mandatory = $false)]
[switch]$All
)
end {
@eosfor
eosfor / restorePasswordsOfSP.ps1
Last active August 9, 2018 11:49
When you accidentally deleted password of a security principal
$passwords = "<pwd1>",
"<pwd2>",
"<pwd3>"
$keys = $passwords | % {
$sDate = Get-Date
$eDate = $sDate.AddYears(10)
$kID = (New-Guid).Guid
$value = $_
$keydata = [Microsoft.Azure.Graph.RBAC.Version1_6.Models.PasswordCredential]::new($sDate, $eDate, $kID, $value)