Skip to content

Instantly share code, notes, and snippets.

View halr9000's full-sized avatar
👋
🤙

Hal Rottenberg halr9000

👋
🤙
View GitHub Profile
<#
.SYNOPSIS
Moves files to a destination folder based on their creation date.
.DESCRIPTION
This function moves files to a specified destination folder. The destination folder is structured by the file's creation date (yyyy-MM-dd). If the destination folder for a specific date does not exist, it will be created.
.PARAMETER Path
The file(s) to be moved. This parameter accepts pipeline input.
@halr9000
halr9000 / Mp4Utils.psm1
Last active October 30, 2023 01:51 — forked from gvoze32/ffmpeg GIF to MP4.MD
Mp4Utils: a PowerShell module for converting animated GIF to MP4 using ffmpeg
<#
.SYNOPSIS
Converts a GIF file to an MP4 file using ffmpeg.
.DESCRIPTION
The ConvertTo-Mp4 function takes a GIF file as input and converts it into an MP4 file.
It creates a directory named "mp4" to store the converted files.
If the MP4 file already exists, it will not perform the conversion.
# Flags used with ffmpeg
@halr9000
halr9000 / README.md
Last active February 22, 2024 00:25
Quick MusicGen setup for Windows

MusicGen for Windows

Overview

The following is a super quick mnod of facebookresearch/audiocraft to reliably install PyTorch with Cuda support on Windows, which the original repo does not document, and that slowed me down quite a bit. I wasted time so you don't have to! I am too lazy to create a proper fork and PR, but I'm sure someone else can do that if motivated.

I have included both virtualenv and conda methods.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@halr9000
halr9000 / Get-NvidiaGpu.ps1
Created December 24, 2022 02:52
Query NVIDIA-SMI for select properties and output them to the screen
try {
$output = nvidia-smi.exe -q -x
}
catch {
<#Do this if a terminating exception happens#>
throw "NVIDIA System Management Interface (nvidia-smi.exe) is not found. Learn more at https://developer.nvidia.com/nvidia-system-management-interface"
}
$xml = [xml]$output
$log = $xml.nvidia_smi_log
@halr9000
halr9000 / gen.ps1
Last active January 28, 2022 23:15
Quick helper script for VQGAN-CLIP
## Basic helper script for VQGAN-CLIP generation
## Assumes you have all dependencies setup as per https://github.com/nerdyrodent/VQGAN-CLIP
## Start from an Anaconda PowerShell shell, such as the shortcut in your start menu
## Be sure to setup the VQGAN Python environment first, but the script will activate it for you
## Place this script in the base directory containing generate.py
##
## Example 1: Run three jobs from an array
## > $prompts = "prompt1", "prompt2|3|4", "prompt5"
## > $prompts | % { .\gen.ps1 -Prompt $_ -Path $_.replace("|","-") }
##
<![LOG[CScanAgent::ScanByUpdates - Found UpdateClassification 0fa1201d-4330-4fa8-8ae9-b877473b6441 for Update:f2b6e975-cae9-493a-a17d-ca429e6738e5]LOG]!><time="10:40:29.580+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052" file="cscanagent.cpp:470">
<![LOG[Found CategoryID of :bfe5b177-a086-47a0-b102-097e4fa1f807 for Update:f61f6c4b-4598-4571-9663-9333a0906778]LOG]!><time="10:40:29.642+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052" file="cscanagent.cpp:453">
<![LOG[CScanAgent::ScanByUpdates - Found UpdateClassification 0fa1201d-4330-4fa8-8ae9-b877473b6441 for Update:f61f6c4b-4598-4571-9663-9333a0906778]LOG]!><time="10:40:29.643+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052" file="cscanagent.cpp:470">
<![LOG[Found CategoryID of :2ee2ad83-828c-4405-9479-544d767993fc for Update:f6bb2d17-0f0e-4a98-970b-7aaa85aae8ce]LOG]!><time="10:40:29.643+300" date="11-12-2014" component="ScanAgent" context="" type="1" thread="12052"
https://api.usfundamentals.com/v1/companies/xbrl?format=json&token=OrWsG12DjiVpkJmr946VKg
@halr9000
halr9000 / README.md
Last active February 27, 2022 05:00
How to make fake data in Splunk using SPL

How to make fake data in Splunk using SPL

Sometimes, you need to fake something in Splunk. Might be during development and you don't feel like writing a real search, but you really need a number for a dashboard panel to look right. Maybe you are helping someone with a hairy regex, and you don't want to index data just to test it on your instance. Whatever the reason, here are some searches that have helped me out.

Note that when using these techniques, you are not going through the indexing

@halr9000
halr9000 / splunk-hec.psm1
Created February 26, 2016 18:44
Send-SplunkEvent, a PowerShell cmdlet for sending events to the Splunk HTTP event collector
# TODO: write the help
# TODO: support SSL self-signed certs
# TODO: need to validate JSON, and/or add a new param set that accepts hashtable and
# convert internally.
# TODO: support RAW mode
# TODO: refactor to use EC batch (concatenated events in one HTTP request) instead of
# PowerShell pipelines which will do a request per object (event payload) on the pipeline
# TODO: think about load balancing per Geoffrey Martins.