Skip to content

Instantly share code, notes, and snippets.

View marcbelmont's full-sized avatar
🐧

Marc Belmont marcbelmont

🐧
View GitHub Profile
@marcbelmont
marcbelmont / firefox-apparmor-fix.md
Created December 31, 2024 16:26
The AppArmor profile for Firefox is too restrictiv

The AppArmor profile for Firefox is too restrictive and does not allow certain operations. It can result in the following error message:

kernel: audit: type=1400 audit(1735660893.908:4139): apparmor="DENIED" operation="file_mmap" class="file" profile="firefox" name="/opt/amdgpu/lib/x86_64-linux-gnu/libdrm_radeon.so.1.123.0" pid=53603 comm="glxtest" requested_mask="m" denied_mask="m" fsuid=1000 ouid=0
kernel: audit: type=1400 audit(1735660614.942:4117): apparmor="DENIED" operation="file_mmap" class="file" profile="firefox" name="/opt/amdgpu/lib/x86_64-linux-gnu/libdrm.so.2.123.0" pid=51946 comm=5244442050726F63657373 requested_mask="m" denied_mask="m" fsuid=1000 ouid=0
kernel: audit: type=1400 audit(1735660318.232:4073): apparmor="DENIED" operation="open" class="file" profile="firefox" name="/sys/fs/cgroup/user.slice/user-1000.slice/session-2.scope/cpu.max" pid=49380 comm=57656220436F6E74656E74 requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

To resolve this issue, you can take the foll

@marcbelmont
marcbelmont / fzf_launcher.sh
Last active January 29, 2025 02:16
This Bash script acts as an interactive command launcher using `fzf`, a command-line fuzzy finder. Let's break down its functionality and features:
#!/bin/bash
set -e
history_file="$HOME/.fzf/history"
commands_file="$HOME/.fzf/commands"
cache_expiration=43200 # 12 hours
# Function to regenerate the commands cache if it's missing or outdated
regenerate_commands_cache() {
if [[ ! -f "$commands_file" || $(( $(date +%s) - $(stat -c %Y "$commands_file") )) -gt "$cache_expiration" ]]; then