Skip to content

Instantly share code, notes, and snippets.

@batonac
batonac / z_aiops_mysql.cnf
Last active May 5, 2022 15:26
mysql configuration for zfs inside linux virtual server on runcloud proxmox with 128 MB ram limit
[mysqld]
bulk_insert_buffer_size = 8388608
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
innodb_buffer_pool_chunk_size = 67108864
innodb_buffer_pool_size = 67108864
innodb_checksum_algorithm = full_crc32
innodb_doublewrite = 0
innodb_file_per_table = 1
@batonac
batonac / wp_normalize.ps1
Last active June 5, 2023 19:33
Normalize WordPress Post Meta using PowerShell and CSV inputs
# Import the CSV files
$posts_table = Import-Csv -Path "wp_posts.csv" | Group-Object -AsHashTable -Property 'ID'
$postmeta_table = Import-Csv -Path "wp_postmeta.csv" | Group-Object -Property 'post_id'
$relationships_table = Import-Csv -Path "wp_mb_relationships.csv" | Group-Object -Property 'from'
# remove subdirectory "Posts" if it exists
if (Test-Path ".\Posts") {
Remove-Item -Path ".\Posts" -Recurse
}
@batonac
batonac / wp_normalize_mb.ps1
Last active June 5, 2023 19:33
Normalize WordPress Post Meta and Metabox Relationships using PowerShell and CSV inputs
# Import the CSV files
$posts_table = Import-Csv -Path "wp_posts.csv" | Group-Object -AsHashTable -Property 'ID'
$postmeta_table = Import-Csv -Path "wp_postmeta.csv" | Group-Object -Property 'post_id'
$relationships_table = Import-Csv -Path "wp_mb_relationships.csv" | Group-Object -Property 'from'
# remove subdirectory "Posts" if it exists
if (Test-Path ".\Posts") {
Remove-Item -Path ".\Posts" -Recurse
}
@batonac
batonac / media-dedup-cli.php
Last active August 29, 2023 20:12
Media Deduper Pro CLI commands
<?php
/*
Plugin Name: Media Deduper Pro CLI
Plugin URI: https://avu.nu/
Description: Provides WP-CLI commands for Media Deduper Pro.
Version: 1.0
Author: Avunu LLC
Author URI: https://avu.nu/
*/
@batonac
batonac / naps2.nix
Last active October 31, 2023 13:15
NAPS2 on NixOS from Debian package
{ autoPatchelfHook
, curl
, dotnet-runtime
, dotnet-sdk
, dpkg
, fetchurl
, gtk3
, icu
, krb5
, lib
@batonac
batonac / default.nix
Last active October 31, 2023 12:57
NAPS2 Build from Source on NixOS (WIP)
let
pkgs = import <nixpkgs> {};
in
pkgs.callPackage ./naps2.nix {}