Skip to content

Instantly share code, notes, and snippets.

View StrixROX's full-sized avatar

Pratyush Kumar StrixROX

View GitHub Profile
@StrixROX
StrixROX / README.md
Last active February 8, 2026 08:31
Getting `sudo apt update` to work on Raspberry Pi Zero W with Raspbian Trixie (Jan 26)

Getting sudo apt update to work on Raspberry Pi Zero W with Raspbian Trixie (Jan 26)

PS: Please use a power backup next time instead of raw-dogging life.

Preface

Right after first boot, tried running sudo apt update but it kept breaking with the error:

E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/raspbian.raspberrypi.com_raspbian_dists_trixie_main_binary-armhf_Packages (1)
@StrixROX
StrixROX / README.md
Last active February 8, 2026 09:07
Power cut while upgrading packages... now how to fix dpkg corrupted cache error

Forget everything about dpkg backups and stuff... rebuild the dpkg cache.

sudo rm /var/lib/dpkg/status
sudo dpkg --clear-avail
sudo dpkg --configure -a
sudo rm -rf /var/lib/apt/lists/*
sudo apt update
@StrixROX
StrixROX / README.md
Last active March 8, 2026 19:06
Installing Tailscale and Pi-hole on Pi Zero 2 W (Jan 26)

Preface

So after killing my Pi Zero W and wrestling with the environment way too many times I have now acquired and Pi Zero 2 W... and life has never been better.

Tailscale

As for the Tailscale part, I have the thing figured out pretty well on Pi Zero W. The issues I get on Zero W are just not there in Zero 2 W.

To install Taiscale on Zero 2 W, simply do:

curl -fsSL https://tailscale.com/install.sh | sh
@StrixROX
StrixROX / README.md
Last active March 8, 2026 18:52
How to run Ubuntu with Desktop Environment and Auto-Login without a display

Cuz auto-login on Gnome without a display just doesn't work fsr...

sudo nano /etc/default/grub

Update the GRUB_CMDLINE_LINUX_DEFAULT variable in this file to have one of the display connectors always active.

ls /sys/class/drm/ # shows a list of available display connectors prefixed with 'card-'
@StrixROX
StrixROX / README.md
Last active March 14, 2026 08:48
How to unlock keyring remotely via SSH

To unlock your keyring from an SSH session, you can use the gnome-keyring-daemon command with the appropriate arguments. A convenient way to do this is to add a function to your bash profile that prompts for the password and executes the command.

You can add a function to your ~/.bashrc file to manually unlock the keyring from the command line when needed.

  1. Edit your ~/.bashrc file using a text editor like nano or vim:
nano ~/.bashrc
  1. Add the following function to the end of the file:
@StrixROX
StrixROX / README.md
Last active May 21, 2026 04:39
How to limit battery charging threshold in Linux

To make the change persistent, create a file named /etc/systemd/system/battery-charge-threshold.service with the following content:

[Unit]
Description=Set the battery charge threshold
After=multi-user.target

[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c 'echo 80 > /sys/class/power_supply/BAT0/charge_control_end_threshold'
@StrixROX
StrixROX / README.md
Last active April 6, 2026 08:23
Video Wallpapers on Niri using mpvpaper
  1. Download your .mp4 file in ~/videos/mybg.mp4.
  2. Install mpv and mpvpaper.
  3. Add this to niri configs
spawn-sh-at-startup "mpvpaper eDP-1 ~/videos/mybg.mp4 -o \"no-audio --loop-file=inf --profile=fast --no-cache --video-sync=display-resample --osc=no --vf=scale=1920:1080\""

layer-rule {
    match namespace="^mpvpaper$"
    place-within-backdrop true
}
@StrixROX
StrixROX / README.md
Last active May 5, 2026 00:35
homepage docker setup
  1. Create the folder structure:
homepage/
├── config/
├── icons/
├── images/
└── docker-compose.yaml
  1. Create the docker compose file
@StrixROX
StrixROX / README-ws_ups_hat_c.md
Last active June 3, 2026 15:43
Setup rmpc in kiosk mode on RPi Zero 2W

Waveshare UPS Hat (C)

How to setup Waveshare UPS Hat (C) for RPi Zero 2W?

This is relatively easy. For me it was just plug-and-play. Just follow the "How to use?" guide on their wiki: https://www.waveshare.com/wiki/UPS_HAT_(C)

  1. Enable I2C from raspi-conifg menu (sudo raspi-config)
  2. sudo reboot
  3. Install the official library and sample code:
sudo apt-get install p7zip
@StrixROX
StrixROX / README.md
Created July 4, 2026 21:55
SDDM with Niri as Wayland Compositor

Want to use Wayland with SDDM instead of X11? Want to use niri as the Wayland Compositor? You are in the right place!

To use niri as your wayland compositor, and ditch X11, do this:

  1. Create /etc/sddm.conf.d/wayland.conf
[General]
DisplayServer=wayland
GreeterEnvironment=QT_WAYLAND_SHELL_INTEGRATION=layer-shell