Skip to content

Instantly share code, notes, and snippets.

View cagyirey's full-sized avatar

Cadence cagyirey

View GitHub Profile
@cagyirey
cagyirey / cnpg.fs
Created May 10, 2025 19:02
CPNG Operator CRDs in F#
namespace Haruspex.Modules.Services
open Pulumi
open Pulumi.FSharp
open Pulumi.FSharp.Kubernetes.Meta.V1.Inputs
open Pulumi.FSharp.Kubernetes.Yaml.V2
open Pulumi.FSharp.Outputs
open Pulumi.FSharp.Random
open Pulumi.FSharp.Kubernetes.Core.V1
@cagyirey
cagyirey / talhelper.fsx
Created February 26, 2025 19:04
Talhelper F# wrapper
#r "nuget: YamlDotNet"
#r "nuget: YamlConvert"
open YamlDotNet.Serialization
open System.IO
let yamlConverter =
SerializerBuilder()
.WithQuotingNecessaryStrings()
.ConfigureDefaultValuesHandling(
@cagyirey
cagyirey / fsharpvalue-extensions.fs
Created January 1, 2025 22:31
Convert F# idiomatic types to Pulumi Input, InputList, InputMap, etc
namespace Microsoft.FSharp.Reflection
open System.Reflection
open System.Collections.Generic
open System
open Pulumi
open Pulumi.FSharp
module internal RecordMap =
[<AutoOpen>]
module Utils =
module CommandLine =
type private Boundary =
| TokenStart
| WordEnd
| QuoteEnd
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="specialize">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<EnableLUA>false</EnableLUA>
</component>
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-IE-ESC" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<IEHardenAdmin>true</IEHardenAdmin>
@cagyirey
cagyirey / ansible_unattend.ps1
Created January 17, 2021 15:45
Unattended driver install + sshd setup + ansible service account
$SshConfig = @"
AuthorizedKeysFile .ssh/authorized_keys
PasswordAuthentication no
ChallengeResponseAuthentication no
PubkeyAuthentication no
PubkeyAcceptedKeyTypes ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,ssh-rsa
Subsystem sftp sftp-server.exe
@cagyirey
cagyirey / Vagrantfile
Last active January 4, 2021 18:46 — forked from pj/Vagrantfile
UEFI PXE boot ubuntu focal
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
ENV['LC_ALL']="en_US.UTF-8"
config.vm.box = "bento/ubuntu-20.04"
config.vm.define "pxetest" do |pxe|
pxe.vm.hostname = "pxetest"
pxe.vm.network "public_network"
config.vm.provider :parallels do |prl, override|
@cagyirey
cagyirey / Dockerfile
Created November 13, 2020 22:22
server 2004 VCTools + .net 5
# escape=`
ARG DOTNET_SDK_VERSION=5.0.100
ARG DOTNET_VERSION=5.0.0
FROM mcr.microsoft.com/windows/servercore:2004-KB4586781-amd64 as installer
ARG DOTNET_SDK_VERSION
SHELL ["cmd", "/S", "/C"]
COPY Install.cmd C:\TEMP\
set moviePath="E:\Migration\torrent\Serial.Experiments.Lain.S01.1080p-Hi10p.BluRay.FLAC2.0.x264-CTR\Serial.Experiments.Lain.S01E09.1080p-Hi10p.BluRay.FLAC2.0.x264-CTR.[573E7536].mkv"
set subsPath="lain09.ass"
set streamPath="lain09.flv"
ffmpeg -i %moviePath% -q 40 -map 0:0 -map 0:2 -vf "ass=%subsPath%" -c:v libx264 -c:a aac -b:v 1400k -tune animation -f flv %streamPath%
#!/bin/bash
# stream.sh <url> <video path>
ffmpeg -re
-ss 00:00:00 \ # start time in case stream disconnects
-i $2 \
-map 0:0 -map 0:3 \ # select video/audio/subtitle channels to transcode
-c:v h264 -c:a:2 libfaac \ # have to explicitly declare codec copying when doing mkv -> flv (i think)
-filter_complex "[0:v][0:s]overlay=y=-40" \ # overlay subtitles, y pos - 40
-preset medium \
-b:v 1600k \ # set to your upload - 400kb