$ kubectl apply -f - <<EOF
<-- insert YAML content here -->
EOF
OR
$ cat file.yaml | kubectl apply -f -
| from dbus_next.aio import MessageBus | |
| from dbus_next.message import Message | |
| from dbus_next.constants import BusType | |
| import asyncio | |
| async def main(): | |
| match = ( | |
| "type='method_call'," | |
| "interface='org.freedesktop.PowerManagement.Inhibit'," | |
| "path='/org/freedesktop/PowerManagement/Inhibit'" |
| // This is a POC that reads data from a Jiabaida BMS, as it is integrated | |
| // in the Liontron battery that I have. | |
| // It's basically the same information as it is displayed in the buggy app that | |
| // comes with it. | |
| const {createBluetooth} = require('node-ble') | |
| const {bluetooth, destroy} = createBluetooth() | |
| // BLE adress of the battery - this will be different from battery to battery | |
| const DEVICE_ADRESS = "A4:C1:38:C5:96:C9"; |
| #!/usr/bin/env python3 | |
| # install dependencies: | |
| # pip install base45 cbor2 (cwt - not used here) | |
| import sys | |
| import zlib | |
| from base45 import b45decode | |
| from cbor2 import loads |
| Add-Type -OutputAssembly hello.exe -TypeDefinition @' | |
| using System; | |
| public class Hello { | |
| public static void Main(string[] Args) { | |
| System.Console.WriteLine("Hello, world!"); | |
| System.Console.Read(); | |
| } | |
| } | |
| '@ |
| # Source: https://gist.github.com/181614ae807a0cb961271b11bbd18d63 | |
| ###################################### | |
| # Github Actions review and tutorial # | |
| # https://youtu.be/eZcAvTb0rbA # | |
| ###################################### | |
| # Referenced videos: | |
| # - GitHub CLI - How to use manage repositories more efficiently: https://youtu.be/BII6ZY2Rnlc | |
| # - Continuous integration, delivery, deployment, and testing explained: https://youtu.be/0ivcSjpUzl4 |
$ kubectl apply -f - <<EOF
<-- insert YAML content here -->
EOF
OR
$ cat file.yaml | kubectl apply -f -
There are a number cases where it's desirable to call PowerShell from another .NET language, particularly from C#. The two main classes of scenario here are:
Both use cases have a largely similar usage pattern,
| # Source: https://gist.github.com/07b0b4642b5694d0239ee7c1629173ce | |
| ####################################################### | |
| # Kustomize # | |
| # How to simplify Kubernetes configuration management # | |
| # https://youtu.be/Twtbg6LFnAg # | |
| ####################################################### | |
| ######### | |
| # Setup # |
| using namespace Microsoft.Azure.Commands.Insights.OutputClasses | |
| $ErrorActionPreference = 'Stop' | |
| [PSEventDataNoDetails]$lastEvent = Get-AzActivityLog -MaxRecord 1 -StartTime (Get-Date).AddDays(-89) -WarningAction SilentlyContinue | |
| if (-not $lastEvent) {throw [NotImplementedException]'You have an empty activity log!'} | |
| while ($true) { | |
| Write-Verbose "Waiting for new events..." | |
| while (-not $newEvent) { | |
| Write-Verbose "No new event detected after $($lastEvent.EventTimestamp.ToLocalTime()), waiting for changes..." |
WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".
Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios: