Skip to content

Instantly share code, notes, and snippets.

@monnoval
monnoval / fix-dietpi-proxmox-qemu-guest-agent.sh
Created March 28, 2023 03:22
Fix not working qemu-guest-agent in Proxmox running DietPi VM
# References
# - https://dietpi.com/forum/t/qemu-guest-agent-shutdown/5898/7
# - https://pve.proxmox.com/wiki/Qemu-guest-agent
# 1. Here are the commands to run
apt install qemu-guest-agent \ # install guest agent
&& systemctl unmask systemd-logind \
&& apt install dbus \
&& systemctl start systemd-logind \
&& systemctl status systemd-logind # check status to verify
@monnoval
monnoval / commands.sh
Created March 7, 2023 14:31
Fix missing libncurses.so.5 in Debian 11, Ubuntu 22 and AlmaLinux 9.1
$ find /usr/lib/ -name *ncurses* # find ncurses library
$ sudo ln -s /usr/lib/libncurses.so.6 /usr/lib/libncurses.so.5 # do soft link
@monnoval
monnoval / num-files-per-folder.sh
Created December 19, 2022 09:27
How many files are there in each folder
# How many files are there in each folder
# https://stackoverflow.com/a/26458853
for i in */ .*/ ; do
echo -n $i": " ;
(find "$i" -type f | wc -l) ;
done
@monnoval
monnoval / heaviest-files.sh
Last active December 19, 2022 09:28
List the heaviest files in root
du --exclude="/home" -x -h -a / | sort -r -h | head -30
#!/usr/bin/env bash
# Usage:
#
# run this script as executable
# $ chmod +x update-firefox.sh
# run as sudo and add a firefox version
# $ sudo ./update-firefox.sh 95.0b10
if [[ "null" = "$1" || -z "$1" ]]; then
@monnoval
monnoval / upgrading-from-node-10-to-latest.md
Last active October 19, 2021 03:34
Upgrading from Node v10 to latest

Node releases are fast and not-so-easy to keep up. And upgrading to the latest node version (16 as of Oct 2021) is not really that much of work. Maybe few minutes should be enough while very hopeful at upgrading the packages easily.


1. Quick intro

ℹ️ gulp 3.9 vs gulp 4
This post is mainly for projects using gulp 3.9.
If you are using gulp 4 then moving to latest node would be much easier and may not need to do any of the below.
@monnoval
monnoval / raspberry-pi4-wordpress-dev-server.md
Last active November 3, 2021 01:34
Raspberry Pi 4 as Wordpress Development Server
@monnoval
monnoval / ubuntu-linux-firefox-1password.md
Created October 13, 2021 04:35
Firefox Developer Edition - 1password desktop app integration
@monnoval
monnoval / xkeysnail-config.py
Last active July 13, 2021 10:50
xkeysnail-config
# -*- coding: utf-8 -*-
# Run in startup using
# /usr/local/bin/xkeysnail /home/msnoval/.xkeysnail-config.py --devices /dev/input/event4 /dev/input/event7 --quiet
#
# Run xkeysnail without sudo, https://github.com/mooz/xkeysnail/issues/64#issuecomment-600380800
# $ sudo groupadd -f uinput
# $ sudo gpasswd -a $USER uinput
# $ cat <<EOF | sudo tee /etc/udev/rules.d/70-xkeysnail.rules
# KERNEL=="uinput", GROUP="uinput", MODE="0660", OPTIONS+="static_node=uinput"