Skip to content

Instantly share code, notes, and snippets.

View GiovanniGrieco's full-sized avatar
💭
mumble mumble

Giovanni Grieco GiovanniGrieco

💭
mumble mumble
View GitHub Profile
@GiovanniGrieco
GiovanniGrieco / auto-upgrade.sh
Created March 24, 2021 22:15
Automatically upgrade Raspberry Pi OS software packages
#!/bin/bash
if [ "$EUID" -ne "0" ]; then
echo "Please run this script as root."
exit 1
fi
export DEBIAN_FRONTEND=noninteractive
apt update
@GiovanniGrieco
GiovanniGrieco / install-openssh-server-windows.ps1
Last active December 6, 2022 17:14
Install OpenSSH Server on Windows
# credits: https://www.medo64.com/2019/12/authorized-keys-in-windows-10-openssh/
# Start as admin
If (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
$arguments = "& '" + $myinvocation.mycommand.definition + "'"
Start-Process powershell -Verb runAs -ArgumentList $arguments
Break
}
# OpenSSH: Install
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
@GiovanniGrieco
GiovanniGrieco / podman_on_wsl2.md
Last active September 21, 2025 12:12
Install Podman on WSL2

Install Podman on Windows Subsystem for Linux 2 (WSL2)

This guide allows a safe and rootless installation of Podman on WSL2. Head over the hyperlinks to discover more about these two wonderful technologies!

This guide assumes that Debian 11 "bullseye" is installed as WSL2 base OS. To do it, simply open your Windows Powershell console under Admin rights and run

PS> wsl install -d Debian

After installation, please check that you are under the latest Debian. If not, please upgrade it.

@GiovanniGrieco
GiovanniGrieco / wsl.conf
Created February 26, 2022 12:12
Enable filesystem metadata on WSL2
# Place this file in /etc/wsl.conf, then reboot WSL VM via the following command
# PS> wsl --shutdown
# (then open a new WSL2 terminal session)
#
[automount]
enabled = true
options = metadata
mountFsTab = false
@GiovanniGrieco
GiovanniGrieco / Setup-Podman-on-LXC.md
Last active June 18, 2025 19:00
Setup Podman on LXC

Before you start, please NOTE: this guide does not cover rootless containers!

On an hypervisor with LXD installed, create a new container, ensuring that -c security.nesting=true -c security.privileged=true is set:

lxc launch -c security.nesting=true -c security.privileged=true images:fedora/35 my-container

If the container already exists, set this parameter through lxc config:

lxc config set my-container security.nesting=true
lxc config set my-container security.privileged=true
@GiovanniGrieco
GiovanniGrieco / Enforce_Wayland_Qt_Flatpak_App.sh
Created May 7, 2022 06:36
Enforce Wayland in Qt-based Flatpak Application
#!/bin/bash
APP_NAME=$1
flatpak --user override --socket=wayland --env="XCURSOR_SIZE=24" --env="QT_QPA_PLATFORM=wayland" $APP_NAME