Skip to content

Instantly share code, notes, and snippets.

@Chuckame
Chuckame / db-backup.sh
Last active October 24, 2024 10:17
Backup and restore immich database: scripts made to easily backup the immich database in a docker compose env. You need the `DB_BACKUP` and `DB_BACKUPS_FOLDER` set in your `.env`, then just execute `./db-backup.sh`
#!/usr/bin/env bash
####
# This script use .env where should be defined DB_FOLDER (the PG data folder) and DB_BACKUPS_FOLDER (the backups location).
# It stops the immich stack then make the backup by zipping the db data to a tar file.
####
set -a
source .env
@mietzen
mietzen / m720q_setup.md
Last active April 13, 2025 14:45
m720q Setup: i7 8700 65W

m720q Setup with an i7-8700 65W

I had trouble getting my i7-8700 65W to work in my m720q with a 65W PSU. It was working fine in Windows, but was throttling down first to 20 Watt, then to 15, 10, and finally to 7 Watt, which resulted in a maximum clock speed of 800 MHz.

The main problem seems to be a mix of crappy firmware settings from Lenovo/Intel (Reddit Post) and the weak power supply.

To fix this problem, we have to install some tools, and for them to work, you have to make sure that secure boot is OFF; otherwise, the kernel doesn't allow you to set the CPU power limits. The easiest way is to install in legacy mode; therefore, you need to disable secure boot and enable CSM in the BIOS, select legacy boot preferred.

@Waltibaba
Waltibaba / lxc_mount_block_device
Last active October 6, 2024 02:46
Mount a block device like HDD inside an LXC container (specifically in proxmox 4)
Mounting block device in lxc (specifically Proxmox 4)
1. Find devices' major & minor ID (need both dev + partition for HDD)
# ls -al /dev/sda
brw-rw---- 1 root disk 8, 0 Dec 19 11:16 /dev/sda1
# ls -al /dev/sda1
brw-rw---- 1 root disk 8, 1 Dec 19 11:16 /dev/sda1
That's 8,0 for sda and 8,1 for sda1
@thisismitch
thisismitch / le-renew-webroot
Last active September 5, 2024 01:55
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"