Skip to content

Instantly share code, notes, and snippets.

View souhaiebtar's full-sized avatar
:octocat:
Focusing

souhaiebtar

:octocat:
Focusing
View GitHub Profile
@souhaiebtar
souhaiebtar / uv_tool_cheat_sheet.md
Created July 21, 2025 08:29
[uv tool python] uv tool python cheat sheet #python

Install only the dev group (without base dependencies):

uv sync --only-group dev Install multiple groups at once:

uv sync --group dev --group prod Install all groups:

uv sync --all-groups

@souhaiebtar
souhaiebtar / windows_terminal_config.json
Created July 20, 2025 10:08
[windows terminal config] windows terminal config #msys #linux
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
@souhaiebtar
souhaiebtar / ssh_config_key.sh
Created June 30, 2025 10:34
[ssh config] ssh config #ssh #config
To configure your .ssh/config file to use two different GitHub accounts with separate SSH keys, follow these steps based on best practices:
Generate distinct SSH key pairs for each GitHub account, if you haven't already, for example:
ssh-keygen -t rsa -C "[email protected]" -f ~/.ssh/id_rsa_account1
ssh-keygen -t rsa -C "[email protected]" -f ~/.ssh/id_rsa_account2
Add the SSH keys to the ssh-agent:
ssh-add ~/.ssh/id_rsa_account1
ssh-add ~/.ssh/id_rsa_account2
Configure your ~/.ssh/config file with Host aliases pointing to GitHub but specifying different IdentityFiles:
@souhaiebtar
souhaiebtar / beyond-compare-reset-trial.ps1
Created May 19, 2025 10:01
[beyond compare 4 5] beyond compare reset trial #beyond #compare
reg delete "HKCU\Software\Scooter Software\Beyond Compare 5" /v "CacheID" /f
reg delete "HKCU\Software\Scooter Software\Beyond Compare 4" /v "CacheID" /f
@souhaiebtar
souhaiebtar / disableVerification-insecure.bash
Last active June 17, 2025 19:14
[noCheckCurlWget] noCheckCurlWget #curl #wget
echo "check_certificate = off" >> ~/.wgetrc
echo "insecure" >> ~/.curlrc
@souhaiebtar
souhaiebtar / firefox_snap.md
Created May 2, 2025 09:52 — 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)
@souhaiebtar
souhaiebtar / debian ignore-skip signature-key-verification-check.sh
Last active April 25, 2025 10:53
[debian ignore-skip signature-key-verification-check] debian ignore-skip signature-key-verification-check #debian #skip #check
# source: https://askubuntu.com/questions/74345/how-do-i-bypass-ignore-the-gpg-signature-checks-of-apt #link-check-available 4/25/2025
sudo apt -o Acquire::AllowInsecureRepositories=true \
-o Acquire::AllowDowngradeToInsecureRepositories=true \
update
sudo apt -o Acquire::AllowInsecureRepositories=true \
-o Acquire::AllowDowngradeToInsecureRepositories=true \
-y upgrade
@souhaiebtar
souhaiebtar / create_environment_variable_no_history.sh
Created April 22, 2025 19:15
[create environment Variable no history] create environment Variable no history #powershell #bash #zsh #environment #variable
#### Powershell
# Prompt securely for the API Key
$apiKeyTemp = Read-Host "Enter your API Key"
# Set the environment variable using the temporary variable
$env:API_KEY = $apiKeyTemp
# Optional: Clear the temporary variable from memory
@souhaiebtar
souhaiebtar / starhip.toml
Created March 30, 2025 11:03
[starship config] starship config #starship #terminal
# SOURCES
# https://starship.rs/config
# https://starship.rs/presets/nerd-font.html#configuration
# DEBUG via:
# starship explain
# STARSHIP_LOG=trace
"$schema" = 'https://starship.rs/config-schema.json'
@souhaiebtar
souhaiebtar / backup_and_restore_postgres_database.sh
Created March 5, 2025 13:35
[Backup and restore a postgres dump] Backup and restore a mysql #postgres #database #db
pg_dump -U postgres -d qanda_db -F c -b -v -f output_file.dump
pg_restore -U postgres -v -d test123 .\output_file.dump