Skip to content

Instantly share code, notes, and snippets.

@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 / 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