Skip to content

Instantly share code, notes, and snippets.

View anderssonjohan's full-sized avatar
👨‍🚒

Johan Andersson anderssonjohan

👨‍🚒
View GitHub Profile
@anderssonjohan
anderssonjohan / eop_github_actions.svg
Created September 2, 2020 12:39
EOP with GitHub Actions and repository_dispatch + PAT
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@anderssonjohan
anderssonjohan / get-volumeinformation.ps1
Created February 26, 2021 14:23
Script to enumerate filesystem info for the volumes collected by metricbeat, which stopped working from version 7.11
$pinvokes = @'
[DllImport("Kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
public extern static bool GetVolumeInformationW(
string rootPathName,
System.Text.StringBuilder volumeNameBuffer,
int volumeNameSize,
out uint volumeSerialNumber,
out uint maximumComponentLength,
out uint fileSystemFlags,
@anderssonjohan
anderssonjohan / svorak.ahk
Last active November 1, 2021 23:32
My us dvorak key mappings for Swedish characters åäö + mac key bindings for swapping LAlt->LCtrl, LCtrl->LWin, LWin->LAlt
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
; Keys on dell laptop: LCtrl, Fn, LWin, LAlt
; Result: LWin, Fn, LAlt, LCtrl
; ..to get Ctrl next to spacebar so most Cmd key bindings are where the mac user muscle memory says they should be :)
LWin::LAlt
LAlt::LCtrl
@anderssonjohan
anderssonjohan / signalmeter.xaml
Created December 23, 2021 12:06
XAML examples
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="Wheat">
<Grid>
<Canvas Width="16" Height="16" SnapsToDevicePixels="True" ClipToBounds="True">
<Canvas.Resources>
<SolidColorBrush x:Key="LevelBrush" Color="White"/>
<SolidColorBrush x:Key="NoLevelBrush" Color="Transparent"/>
<SolidColorBrush x:Key="LevelBarBorder" Color="Gray"/>
</Canvas.Resources>
@anderssonjohan
anderssonjohan / build-pendulum-wheels.yml
Created March 31, 2023 11:27
Fix arm wheels created with x86_64 platform tag based on https://github.com/pypa/cibuildwheel/pull/1416
name: Build
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
@anderssonjohan
anderssonjohan / delete-deployment.ps1
Last active May 10, 2023 14:27
Get and delete deployments for a github repository
param(
$owner,
$repository_name,
$databaseid
)
gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/$owner/$repository_name/deployments/$databaseid