Skip to content

Instantly share code, notes, and snippets.

View hurricup's full-sized avatar

Alexandr Evstigneev hurricup

View GitHub Profile
@hurricup
hurricup / gist:37f435305786eed2643be50937bc9a5c
Last active February 6, 2023 03:46
Install openssl for ruby 2.7 on ubuntu 22.04
sudo apt install libssl-dev=1.1.1l-1ubuntu1.4
@hurricup
hurricup / install_imagemagic_with_heic_22_04.sh
Last active January 25, 2024 06:20
How to install ImageMagick 7.1.0-54 with HEIC and WEBP support on Ubuntu 22.04
# inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd
# remove bundled ImageMagick
sudo apt remove imagemagick -y
# install base dependencies
sudo apt-get install -y \
build-essential \
libde265-dev \
libdjvulibre-dev \
# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
@hurricup
hurricup / convert.sh
Last active November 3, 2022 04:30
HowTo: convert multiple pdfs to png from the command line using ImageMagic
for file in *.pdf; do \
convert \
-density 600 \
-background white \
-alpha remove \
-alpha off \
"${file%%.*}.pdf" \
-resample 200 \
"${file%%.*}_%02d.png";\
done
@hurricup
hurricup / voltage_ha_logger.sh
Last active October 31, 2021 05:24
MQTT-based voltage daemon built on Network UPS Tools
#!/bin/bash
#set -eu
ha_prefix="homeassistant"
ha_config_suffix="config"
ha_state_suffix="state"
ha_component="sensor"
ha_object_id="ac_voltage_meter_powercom"
ha_common_prefix=$ha_prefix/$ha_component/$ha_object_id
@hurricup
hurricup / voltage_logger.sh
Last active October 29, 2021 20:06
Script for logging voltage using UPS device and Network UPS tools
#!/bin/bash
previous_filename="none"
previous_voltage=-1
while true
do
filename=$(date "+%Y-%m-%d")
upsinfo=$(upsc powercom 2>/dev/null |grep 'input.voltage:')
voltage=${upsinfo#input.voltage: }
@hurricup
hurricup / refresh_keys.sh
Created October 13, 2021 11:40
How to fix expired keys for apt on Ubuntu
sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com
@hurricup
hurricup / install_imagemagic_with_heic.sh
Last active April 10, 2024 01:17
How to install ImageMagick 7.1.0-54 with HEIC and WEBP support on Ubuntu 20.04
# inspired by https://gist.github.com/rjnienaber/af47fccb8410926ba7ea35f96c3b87fd
# remove bundled ImageMagick
sudo apt remove imagemagick -y
# install base dependencies
sudo apt-get install -y \
build-essential \
git \
libde265-dev \
@hurricup
hurricup / install_ffmpeg_cuda.sh
Last active October 18, 2022 05:42
How to install ffmpeg with CUDA acceleration support on Ubuntu 20.04
#
# build configuration uses same options as default ffmpeg for Ubuntu 20.04 + cuda
#
sudo apt install -y \
cmake \
flite1-dev \
frei0r-plugins-dev \
ladspa-sdk \
libaom-dev \
libass-dev \