Skip to content

Instantly share code, notes, and snippets.

@gitmpr
gitmpr / firefox_snap.md
Created July 3, 2025 07:28 — forked from jfeilbach/firefox_snap.md
Ubuntu 24.04 remove Firefox snap and install .deb version

Ubuntu 24.04 Firefox snap replacement

I need a proper Firefox installation and not the snap version. The snap version does not work properly with Smart Cards. Although it seems to be possible to get it to work with smart cards it is extremely difficult and I don't care to try and make it work. This is not a tutorial on how to get your PIV or CAC to work. Also snaps suck. Canonical will heopfully abandon snaps in the future.

Remove Snap Firefox

sudo snap disable firefox
sudo snap remove --purge firefox
error: cannot perform the following tasks:
- Remove data for snap "firefox" (1943) (unlinkat /var/snap/firefox/common/host-hunspell/en_ZA.dic: read-only file system)
#!/usr/bin/env bash
# Define the menu options
menu_options=("Option 0" "Option 1" "Option 2" "Option 3" "Option 4" "Option 5")
num_menu_options=${#menu_options[@]}
# enable/disable looping of the selection
looping=0
#!/usr/bin/env bash
# Define the menu menu_options
menu_options=("Option 0" "Option 1" "Option 2" "Option 3" "Option 4" "option 5")
num_menu_options=${#menu_options[@]}
# enable/disable looping of the selection
looping=0
@gitmpr
gitmpr / sgptrepl.sh
Last active July 29, 2023 17:33
sgpt wrapper bash functions
# sgpt https://github.com/TheR1D/shell_gpt wrapper bash functions that lets me switch to repl mode where the last sgpt
# prompt is fed into the program so that it is saved in the cache and I can continue chatting with the previous prompt input.
# This works by feeding the previous command first argument into the program again to save the prompt as a file into the cache
# use this instead of `sgpt --editor` to be able to continue continue a chat started from an editor invocation
sgpteditor() {
sgpt --editor --chat $(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c 16)
SGPT_EDITOR=1
}
## This script demonstrates how input parameters can be specified in multiple ways and
## a recommended common approach and order of reading, and potentially overwriting these
## parameters if multiple input sources provide a different value for the same parameter.
## configuration parameter value set method precedence order:
## cli args override everything
## env vars take presedence over a config file
## If none of the three are supplied it is nice to fallback to hardcoded sane default values if applicable
## Lower number configuration method overrides higher number
@gitmpr
gitmpr / smoketest.rs
Last active June 5, 2023 22:46
Echo back a string over a socket
use tokio::net::{TcpListener, TcpStream};
use tokio::io::{AsyncReadExt, AsyncWriteExt};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let listener = TcpListener::bind("0.0.0.0:8080").await?;
loop {
let (mut socket, _) = listener.accept().await?;