Skip to content

Instantly share code, notes, and snippets.

View EdoaLive's full-sized avatar

Edoardo Liverani EdoaLive

  • Italy
View GitHub Profile
@EdoaLive
EdoaLive / carwash.md
Created June 17, 2026 08:36
Why my dirty car refuses to let me walk: "the brilliant complexity" of going to the car wash on foot

Intro

Here's a funny conversation with a local LLM about wether is better to go on foot to the car wash.


build : b9670-02810c7aa
model : google/gemma-4-E4B-it-qat-q4_0-gguf

First prompt

@EdoaLive
EdoaLive / disk-status.sh
Last active August 21, 2025 10:28
Non-intrusive disk check for my media center server. Uses smartctl to read model, power state, and temperature without disturbing sleeping drives.
#!/bin/bash
output="Device\tDevice Model\tDevice State\tCurrent Temperature\tPower Cycle Min/Max Temperature\t"
for d in /dev/sd{a..d}; do
info=$(smartctl -i -lscttempsts "$d")
model=$(echo "$info" | grep "Device Model" | cut -d: -f2 | xargs)
@EdoaLive
EdoaLive / .bashrc
Created June 24, 2022 07:18
Expand bash history and avoid duplicates
export HISTCONTROL=erasedups
export HISTSIZE=10000
export HISTFILESIZE=10000
@EdoaLive
EdoaLive / channelClosing.go
Created June 17, 2022 08:59
A clean pattern to close and detect closed channels in goland
package main
import "fmt"
func main() {
var ch = make(chan int)
close(ch)
var ch2 = make(chan int)
go func() {
@EdoaLive
EdoaLive / udpServerClient.go
Last active April 5, 2022 09:55
Example of a simple UDP server (that respond with an echo) and client (that sends periodic packets)
package main
import (
"fmt"
"net"
"time"
)
func main() {
go server()
@EdoaLive
EdoaLive / patch_19.07.patch
Created September 13, 2021 15:59
[PARTIAL] Patch to OpenWRT 19.07 for ASUS RT-AC52U B1
diff --git a/target/linux/ramips/dts/RT-AC52U-B1.dts b/target/linux/ramips/dts/RT-AC52U-B1.dts
new file mode 100644
index 0000000..aad625c
--- /dev/null
+++ b/target/linux/ramips/dts/RT-AC52U-B1.dts
@@ -0,0 +1,184 @@
+/dts-v1/;
+
+#include "mt7620a.dtsi"
+
@EdoaLive
EdoaLive / auto-chroot.sh
Last active February 7, 2022 16:20
Simple chroot scripts that automatically binds directories inside the chrooted environment inside a mount namespace. Useful also to launch a specific command in chroot.
#!/bin/bash
ROOTDIR=/root/update/root/
PARENT_COMMAND=$(ps -o comm= $PPID)
#echo parent is --${PARENT_COMMAND}--
if [ "$PARENT_COMMAND" != "unshare" ]; then
echo "Entering mount namespace..."
unshare -f -m bash $0 "$@"
@EdoaLive
EdoaLive / changed python_targets.sh
Created December 8, 2020 15:37
This command should help to re-emerge all python packages afte changing PYTHON_TARGETS config in a Gentoo system
equery hasuse -F "\$cp" python_targets_python3_8 | xargs emerge -pNvu1
#!/bin/bash
# This will find big files and use dd to measure read throughput.
# Don't know how much the pipe is a bottleneck (64K is the greater chunk the pipe can support).
find -size +10M -exec dd if={} bs=64K 2>/dev/null \; | dd of=/dev/null bs=64K
@EdoaLive
EdoaLive / gentoo.conf
Created October 31, 2020 12:18
Git for gentoo portage repository /etc/portage/repos.conf/gentoo.conf
[gentoo]
auto-sync = yes
location = /usr/portage
sync-type = git
sync-uri = https://github.com/gentoo-mirror/gentoo.git
sync-depth = 1
sync-git-clone-extra-opts = -b master
sync-git-verify-commit-signature = true