Skip to content

Instantly share code, notes, and snippets.

@Jimbolino
Jimbolino / updatePrinter.sh
Created June 14, 2023 00:09
HP DeskJet 2600 letsencrypt auto renewal script
#!/usr/bin/env bash
IP=192.168.1.123
PFX=certificate.pfx
DOMAIN=hp2600.example.com
PASS=$(cat /proc/sys/kernel/random/uuid)
openssl pkcs12 -export -out ${PFX} -inkey /etc/letsencrypt/live/${DOMAIN}/privkey.pem -in /etc/letsencrypt/live/${DOMAIN}/cert.pem -passout pass:"${PASS}"
curl --silent --insecure "https://${IP}/Security/DeviceCertificates/NewCertWithPassword/Upload?fixed_response=true" --form certificate=@${PFX} --form password="${PASS}" > last-result.log
@Jimbolino
Jimbolino / copyBlueToothKeysToWindows.sh
Created June 17, 2023 01:25
Copy my DualShock PlayStation 4 controller Bluetooth key from Linux to Windows, so it keeps paired when i dual boot :)
#!/bin/bash
set -e
input_pattern="/var/lib/bluetooth/*/*/info"
output_folder="/mnt/data/ubuntu/"
for file in ${input_pattern}; do
content=$(cat "${file}")