Skip to content

Instantly share code, notes, and snippets.

@TomaszGasior
TomaszGasior / dell-custom-fan-speed
Last active April 2, 2023 20:50
Custom fan speed for Dell Optiplex 7050 Micro on Fedora 37 with Intel Core i7-7700T
#!/bin/bash
export CPU_TEMP_THRESHOLD_FOR_FAN_SPEED_LOW=54
export CPU_TEMP_THRESHOLD_FOR_FAN_SPEED_HIGH=68
export SLEEP_TIME_SECS=10
export GET_CPU_TEMP_FILE=/sys/devices/platform/coretemp.0/hwmon/hwmon*/temp1_input
export SET_FAN_SPEED_FILE=/sys/devices/platform/dell_smm_hwmon/hwmon/hwmon*/pwm1
@TomaszGasior
TomaszGasior / optimag.sh
Last active April 19, 2022 14:41
Optimize JPEG, PNG and SVG images with one simple command.
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
get_file_mime_type()
{
local filename=$1
file -b --mime-type "$filename"
}