Skip to content

Instantly share code, notes, and snippets.

@monnoval
monnoval / sample.prf
Last active October 14, 2024 06:09
A sample one direction unison profile
# Create one config file for each folder
# /home/whois/.unison/sample.prf
# Run unison in commandline with the following
# unison sample
root = /source/directory
root = /destination/directory
force = /source/directory
@monnoval
monnoval / update-ps5-vide-clip-creation-date.sh
Created July 20, 2024 08:35
Playstation 5 / PS5 video clip filename to update file creation/modified date
#!/usr/bin/env bash
# This is to parse and update the creation date of video clips taken from
# Playstation5 (PS5). For example filenames such as
# GameTitle_20240719233528.mp4
# Transferring this file via USB would not retain the creation/modified date
# which the below bash code would solve
# https://stackoverflow.com/a/43606356
for filename in *.mp4; do # use mp4 or webm
@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