Skip to content

Instantly share code, notes, and snippets.

@danielrode
danielrode / cmp-dnf-gpg-keys.md
Created August 22, 2025 18:53
Compare Fedora system DNF GPG keys with ones from website
# fish shell
for i in (rpm -qa 'gpg-pubkey*')
  rpm -qi $i | gpg --show-keys --fingerprint
end
curl https://fedoraproject.org/fedora.gpg | gpg --with-fingerprint --show-keys --keyid-format long
@danielrode
danielrode / diff_dif.md
Last active May 23, 2025 20:37
Diff Dirs with Rsync

Compare two directories and list files whose sizes differ

rsync -avn --omit-dir-times --no-perms --no-owner --no-group --size-only DIR1 DIR2

Compare two directories, comparing each corresponding file by checksum

rsync -avnc DIR1 DIR2

@danielrode
danielrode / zrok.md
Last active February 14, 2025 03:55
Share a port via Zrok

This example shows

On server:

  1. Install Zrok (only needs done once)
  2. Setup Zrok account: zrok invite (only needs done once)
  3. Connect to Zrok network: zrok enable SHARE_ID
  4. Start service you want to share (such as Minecraft)
  5. Expose port via Zrok:
@danielrode
danielrode / ntfs-guide.sh
Last active May 23, 2025 17:58
Format a Blank Disk Drive as NTFS (example)
# Replace /dev/sde with your desired drive
# Replace WD_Drive with your desired partition name
sudo parted /dev/sde mklabel gpt # When prompted, say "yes"
sudo parted /dev/sde mkpart WD_Drive ntfs 0% 100%
sudo mkfs.ntfs --fast /dev/sde1
# frpc.toml
# On public host (with public IP):
# > podman run --rm -p 7001:7001 -p 1234:1234 -p 4321:4321/udp -p 25565:25565 -p 19132:19132/udp ghcr.io/fatedier/frps:v0.61.1 -p 7001
# On local host:
# - Run Minecraft server via Docker or whatever, then
# > frpc -c frpc.toml
# On friend's host:
# - connect to "<PUBLIC_IP>:1234" in Java Minecraft
@danielrode
danielrode / adhoc-wifi.md
Last active December 30, 2024 06:16
Setup WiFi hotspot/IBSS/ad-hoc/P2P on Void Linux using nmcli

Setup and enable connection

let name = "OfflineAdHoc"
sudo nmcli device wifi hotspot con-name $name ssid $name band bg password pw123456

Disable (set WiFi card back to normal)

@danielrode
danielrode / mc-servers.md
Last active February 14, 2025 04:22
Minecraft Servers
@danielrode
danielrode / containers-demo.md
Last active July 14, 2025 19:43
Demo of Docker containers (their features and uses)

Containers 101

What Are They Good For?

  • Containers package and run Linux software in reproducable ways (similar to bundling an Anaconda environment into a single file that can be shared)
  • Portability: anyone with Docker can run your container
  • Isolation: containers cannot modify the host unless given explicit permission
  • Reproducability: containers run the same code the same way on every host
  • No need to worry about library versions or dependency webs (everything is self-contained)
  • Docker Hub: many easy-to-install pre-built containers
@danielrode
danielrode / build-foot-with-ctrlc-clipboard-copy.sh
Last active September 27, 2024 19:43
Add CTRL+C clipboard copy support to Foot terminal
#/bin/bash
# Clone source foot repo
git clone https://codeberg.org/dnkl/foot/
# Apply patch that adds CTRL+C clipboard copy support
# (if text is selected, CTRL+C will copy it to clipboard,
# otherwise, it will send the typical interrupt signal)
cd foot/
@danielrode
danielrode / programlistsaver.py
Last active December 26, 2015 12:18
Saves a list (to csv format) of the programs installed on your Windows computer. Tested on Windows 7.
#!python3
# Import
import re, subprocess as sp, os
from sys import exit
def main():
#wmic product get Name,Vendor,InstallDate,Version
print("Running wmic...")
spop = sp.Popen(['wmic', 'product', 'get', 'Name,Vendor,InstallDate,Version'], stdout=sp.PIPE, stderr=sp.PIPE).communicate()[0]