Skip to content

Instantly share code, notes, and snippets.

View Fabaderheld's full-sized avatar

Fabian Sasse Fabaderheld

View GitHub Profile
@Fabaderheld
Fabaderheld / df.md
Last active July 6, 2024 16:51
Convert DF in powershell

df -h > df_output.txt

Read the contents of the df_output.txt file

$dfOutput = Get-Content -Path df_output.txt

Parse the output

$parsedOutput = $dfOutput | ForEach-Object { if ($_ -match '^\s*Filesystem\s+Size\s+Used\s+Avail\s+Use%\s+Mounted on') {

@Fabaderheld
Fabaderheld / readme.md
Created April 18, 2024 04:33
remove Node from proxmox

pvecm expected 1 pvecm delnode pve-2

rm -r /etc/pve/nodes/pve-2

@Fabaderheld
Fabaderheld / filament.md
Created December 17, 2023 14:41
Filamet esphome config backup

esphome: name: filament friendly_name: filament includes: - filament.h

esp8266: board: nodemcu

board: d1_mini

@Fabaderheld
Fabaderheld / ha-dynamic-input.md
Created December 3, 2023 05:59
Generate Input Select dynamiclly

service: input_select.set_options data: options: > [ {% for entity in integration_entities('spoolman') %} {{entity.friendly_name}} "{{ state_attr(entity, 'friendly_name') }}", {% endfor -%} ] target: entity_id: input_select.filaments

$doc.Styles["Normal"] # in english Word its "Normal"
$doc.Styles["Standard"] # in german Word its "Standard"
@Fabaderheld
Fabaderheld / ansible-json.md
Last active July 28, 2023 04:33
Output Ansible as pure JSON

$env:ANSIBLE_STDOUT_CALLBACK="json" $env:ANSIBLE_LOAD_CALLBACK_PLUGINS="true"

@Fabaderheld
Fabaderheld / get-comics-komga
Created July 25, 2023 19:17
Lookup Comic with Komf from KOmga
java -jar komf-1.0-SNAPSHOT-all.jar --config-file=./application.yml series identify $ID
@Fabaderheld
Fabaderheld / flash-esplink.md
Created July 12, 2023 13:44
Flash ESP-Link
@Fabaderheld
Fabaderheld / rename-volume.md
Last active July 5, 2023 09:41
replace Volume year whit volume number

function Rename-Volume { $Comics = Get-ChildItem

foreach ($Comic in $Comics) {
    $Volume = (($Comic.PSParentPath -split "/")[-1] -split " ")[1]

    Move-Item -Path $($Comic.FullName) -Destination $($($Comic.Fullname) -replace "Vol\.\d+", "Volume $Volume")
    $Comic | Where-Object { $_.Name -eq "series.json" -or $_.Name -eq "folder.jpg" -or $_.Name -eq "cover.jpg" } | Remove-Item

}

Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/volumes/?api_key=$ComicVineAPIKey&filter=name:ironman&format=json"
Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=$ComicVineAPIKey&filter=name:ironman&format=json"
Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=$ComicVineAPIKey&format=json"
(Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=$ComicVineAPIKey&format=json").result
(Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=$ComicVineAPIKey&format=json").results
(Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=$ComicVineAPIKey&format=json").results | Where-Object { $_.Name -like "*iron*" }
(Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=$ComicVineAPIKey&format=json").results | Where-Object { $_.Name -like "*iron*" } | Select-Object name
(Invoke-RestMethod -Uri "https://comicvine.gamespot.com/api/characters/?api_key=