Skip to content

Instantly share code, notes, and snippets.

ChadDevOps / clamd.conf
Created Feb 8, 2020
clamonacc for Ubuntu 18.04
View clamd.conf
#Used with Virtualmin
#Tweak as needed
TCPSocket 3333
User root
ScanMail true
ScanArchive true
ArchiveBlockEncrypted false
ChadDevOps / aws
Created Feb 9, 2020
Bash script using AWS Cli to check various systems for daily email
View aws
# /etc/cron.daily/aws
# Check AWS SES Suppression List
OUTPUT="$(aws sesv2 list-suppressed-destinations --profile default)"
ISEMPTY=`echo "${OUTPUT}" | grep '".*SuppressedDestinationSummaries": \[\].*'`
[ -z "$ISEMPTY" ] && echo "${OUTPUT}" | mail -s "[AWS-DAILY] Daily Suppressed Destinations" info
ChadDevOps /
Last active Feb 11, 2020
Update Open Distro triggers to use MS Teams message card json


This query will update the trigger message for monitor alerts in Kibana with Open Distro plugin installed.

This should also work with the AWS ElasticSearch service as it utilizes Open Distro.

A Microsoft Teams (MS Teams) generic message card template is included.


ChadDevOps /
Created Mar 20, 2020
Ubuntu full disk encryption manual partitioning uefi with additional home partition

Modified to use a seperate encrypted partition for /home

Run gparted, and do the following:

delete all the existing partitions on the target disk
create a new partition table of type parimary
create a fat32 partition of 256MB with name “EFI System Partition” and label “ESP”, then click “Apply” to actually create the partition

right-click on the partition you’ve just created, click “Manage flags” and check “esp”, then click “Apply again”

ChadDevOps / printer.cfg
Created Mar 1, 2021
Ender 3 Max Printer Config
View printer.cfg
# This file contains pin mappings for the stock 2020 Creality Ender 3
# MAX. To use this config, during "make menuconfig" select the
# STM32F103 with a "28KiB bootloader" and with "Use USB for
# communication" disabled.
# Because this printer has factory wiring, mounts, and firmware for
# a BLTouch, but does not ship with one at this time, default values
# for the sensor have been specified, but disabled, in anticipation of
# future revisions or user modification. User should take care to
# customize the offsets, particularly z-offset, for their specific unit.
ChadDevOps / create_png_from_stl.bat
Last active Jun 8, 2021
Windows batch script to create png from stl
View create_png_from_stl.bat
REM Install OpenSCAD (e.g. if using chocolatey run: choco install openscad -y)
REM Run batch script in root folder, this will recursively go into all sub folders.
echo off
call :treeProcess
goto :eof
for %%f in (*.stl) do (
if not exist "%%~nf.png" (
echo import("%%f"); >"__tmp__%%f_tmp"
ChadDevOps / set_short_names.ps1
Created Jun 8, 2021
Create random short name for Windows Directories
View set_short_names.ps1
#Generates a random shortname for directories
#Enable Shortnames in Windows 10
# fsutil 8dot3name query
# fsutil behavior set disable8dot3 0
#Run as admin
Get-ChildItem -Recurse -Directory | ForEach-Object {
$fullpath = $_.FullName
$foldername = $_.Name
$ShortPath = (New-Object -ComObject Scripting.FileSystemObject).GetFolder($_.FullName).ShortPath
$ShortName = $ShortPath|split-path -leaf
View create_png_from_stl_and_shortnames.ps1
# Run as admin
# Summary: Generates a random shortname for directories and generates png from stl
# Pre-req:
# Install OpenSCAD (Ex using chocolatey: choco install openscad -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]
# If you want to convert png to jpg run the following from wsl (you'll need imagemagick and parallel)
# find . -iname "*.png" | parallel convert -quality 95% {} {.}.jpg
ChadDevOps / unzip.ps1
Created Jul 9, 2021
Recursively extract all zip files into filename subdirectory
View unzip.ps1
$dash = '-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-'
Get-ChildItem $folderPath -recurse | %{
if($_.Name -match "^*.`.zip$")
write-host $dash
write-host '-+-+-+-+-+-+ EXTRACTING'
write-host $dash
ChadDevOps / .bashrc
Created Jul 10, 2021
svgtopng bash alias using inkscape under windows wsl
View .bashrc
alias svgtopng="IFS=\$'\n'; set -f; for file in \$(find -name "*.svg"); do _INKSCAPE_GC=disable inkscape \"$file\" -e \"${file%svg}png\"; done; unset IFS; set +f"