Skip to content

Instantly share code, notes, and snippets.

@ChadDevOps
ChadDevOps / ShortNames-ZipFiles-SLTSVGtoPNG.ps1
Last active August 24, 2021 20:41
Generates a random shortname for directories, unzips files, generates png from stl, generates png from svg
# Run as admin
# Summary: Generates a random shortname for directories, unzips files, generates png from stl, generates png from svg
# Pre-req:
# Install OpenSCAD (Ex using chocolatey: choco install openscad -y)
# Install inkscape (ex using choco: choco install inkscape -y)
# Install superdelete (ex using choco: choco install superdelete -y)
# Enable Shortnames in Windows 10 by running the following commands (helps with 260 char. limits):
# fsutil 8dot3name query
# fsutil behavior set disable8dot3 0
# Post [optional]
@ChadDevOps
ChadDevOps / copyall.ps1
Created July 22, 2021 18:53
Copy all files to new folder in parent directory, rename if same
function fcopy ($SourceDir,$DestinationDir)
{
Get-ChildItem $SourceDir -Recurse | Where-Object { $_.PSIsContainer -eq $false } | ForEach-Object ($_) {
$SourceFile = $_.FullName
$DestinationFile = $DestinationDir + $_
write-host "------------------------------------"
write-host "Source: $SourceFile"
write-host "Dest : $DestinationFile"
if (Test-Path "$DestinationFile"){
if( (Get-FileHash "$SourceFile").Hash -ne (Get-FileHash "$DestinationFile").Hash ) {
@ChadDevOps
ChadDevOps / IFTTT Octoprint Pushover Filter Code
Last active December 20, 2022 18:03
IFTTT Octoprint Notification to Pushover (iPhone and Apple Watch Glances)
// Add your code here. All actions will run unless you explicitly skip them.
// Quick tips!
// Auto-complete is on. Start typing to see ingredient options.
// Hover over any ingredient to see the variable type and an example.
// TypeScript v2.92
/*
Octoprint Webhook Plugin: https://plugins.octoprint.org/plugins/webhooks/
Webhook: https://maker.ifttt.com/trigger/{event}/json/with/key/{key}
@ChadDevOps
ChadDevOps / convert.py
Created November 3, 2023 18:04
Convert audio files to txt using openai's faster whisper
# https://github.com/guillaumekln/faster-whisper
# pip install faster-whisper
# pip install nvidia-cublas-cu11 nvidia-cudnn-cu11
# pip install torch
# Export your library prior to running in WSL or virtual env
# export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
import os
import torch, gc
import shutil