Skip to content

Instantly share code, notes, and snippets.

@si458
si458 / fixsmartctl
Created September 12, 2026 09:00
Fix smartctl for HP Raid Controllers and Proxmox
#!/bin/bash
echo "=== Step 1: Moving original smartctl ==="
mv /usr/sbin/smartctl /usr/sbin/smartctl.orig
echo "Done."
echo ""
echo "=== Step 2: Creating wrapper script ==="
cat > /usr/sbin/smartctl << 'EOF'
#!/bin/bash
@si458
si458 / netbird_install_jetkvm.sh
Last active July 18, 2026 16:51
Netbird Install on JetKVM
#!/bin/sh
set -eu
main() {
# Fetch latest version using wget instead of curl
NETBIRD_LATEST=$(wget -qO- https://api.github.com/repos/netbirdio/netbird/releases/latest | sed -n 's/.*"tag_name": "v\([^"]*\)".*/\1/p' | head -n1)
REQUESTED_VERSION=""
SETUP_KEY=""
AUTO_YES=false
CLEAN_INSTALL=false
@si458
si458 / passwords.php
Created May 26, 2025 08:57
Get Plesk Passwords From Database
<?php
// Configuration
$config = [
'server' => 'localhost',
'username' => 'admin',
'password' => trim(file_get_contents("/etc/psa/.psa.shadow")),
'key' => file_get_contents("/etc/psa/private/secret_key"),
'database' => 'psa'
];
@si458
si458 / doc.md
Created September 22, 2024 16:46 — forked from willglynn/doc.md
Change SMBIOS UUID on AMI firmware PCs

PCs have SMBIOS data containing small amount of identifying information. One piece of information in this SMBIOS data is the universally unique identifier. Some PC and motherboard manufacturers fail to set this, often leaving the UUID set to 03000200-0400-0500-0006-000700080009.

If your system uses an AMI firmware (sometimes called AMIBIOS), you may be able to use AMI utilities to reset the UUID. Obtain AMIDEEFIx86.efi and an EFI shell executable, such as from inside m1ujt73usa.zip for the Lenovo ThinkStation P330 Tiny download center.

Once you have those two files, create USB drive with the FAT32 filesystem and the following structure:

\
  \AMIDEEFIx86.efi
  \efi
blueprint:
name: Add Hildebrand CAD Entities
description: Create devices and entities using MQTT discovery
domain: script
source_url: https://gist.github.com/si458/2a9ec8d0e2b07205e4859886cc5222b0
input:
input_cad_mac:
name: MAC Address
description: "MAC address of CAD (without :s)"
default: ""
#!/bin/sh
#
# YOU CAN GET VERSION AND ID FROM https://account.blesta.com/client/plugin/download_manager/client_main/ BY HOVERING OVER THE FILE
# SET VALUES BELOW AND RUN SCRIPT AS SUDO
VERSION=${1:-"5.5.1"}
ID=${2:-"214"}
#
# DONT CHANGE ANYTHING BELOW
#
mkdir -p /tmp/blesta-backup
@si458
si458 / virt-customize-ubuntu24
Last active December 11, 2025 09:25
virt-customize ubuntu22
#!/bin/sh
# install tools
apt update -y && apt install nano wget curl libguestfs-tools -y
# remove old image
rm -rfv current/noble-server-cloudimg-amd64.img
# remove old template container - WILL DESTROY COMPLETELY
qm destroy 9000 --destroy-unreferenced-disks 1 --purge 1
# download new image
wget https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img
# add agent to image
@si458
si458 / PVE-HP-ssacli-smart-storage-admin.md
Last active September 4, 2026 08:39 — forked from Philhil/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (8.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (8.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@si458
si458 / build.js
Last active January 9, 2026 06:12
build script for pkg with icon and metainfo
if (process.argv[2] == undefined) process.exit(0);
if (process.argv[2] == "") process.exit(0);
const { pkg_fetch_version, node_version, pkg_cache_path, icon, version, description, company, name, copyright, file } = require(`./${process.argv[2]}.json`);
const ResEdit = require('resedit');
const path = require("path");
const fs = require('fs');
const https = require('https');
function download(url, dest) {
return new Promise((resolve, reject) => {
fs.access(dest, fs.constants.F_OK, (err) => {