This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Exit immediately if a command exits with a non-zero status | |
set -e | |
# Function to output error messages | |
error() { | |
echo "Error: $1" >&2 | |
exit 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some cookies are misusing the recommended “SameSite“ attribute 2 | |
Cookie “q_auth_d97c331f-595d-4592-8b1a-6166bbeea031” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite localhost:8442 | |
Cookie “q_session_chunk_2” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribut |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Source: https://miloserdov.org/?p=2667 | |
sudo swapoff /swapfile | |
sudo swapon --priority 100 /swapfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Check for dependencies | |
if ! command -v fzf &> /dev/null; then | |
echo "fzf is required but it's not installed. Exiting." | |
exit 1 | |
fi | |
locale="en_US" | |
locale=${locale%%_*} # Extract just the first part (e.g., "en" from "en_US") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Convert drawio to Image | |
on: | |
push: | |
paths: | |
- '**/*.drawio' | |
jobs: | |
convert: | |
runs-on: ubuntu-latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
outputFile="config/manab_en.csv" | |
# Convert CSV to a simpler format and use fzf for searching | |
awk -F',' '{gsub(/"/, "", $1); gsub(/"/, "", $2); printf "%-15s %s\n", $1, $2}' "$outputFile" | fzf --ansi --preview-window=hidden:wrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
awk '{if (!match($0, /^[[:print:]\t\n\r]+$/)) print NR, $0}' ~/.bash_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find bookmarks/ -type f -name "bookmarks.csv" -print0 | while IFS= read -r -d $'\0' file; do tail -n +2 "$file" | csvquote | awk -F "," '{ gsub(/^[ \t]+|[ \t]+$/, "", $2); print $2 }' | csvquote -u | sed 's/"//g'; done | grep -v '^\s*$' | fzf | xargs -r firefox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Your system locale, for example "en_US". You might dynamically get this with `echo $LANG` or `locale`. | |
locale="en_US" | |
locale=${locale%%_*} # Extract just the first part (e.g., "en" from "en_US") | |
# Find .desktop files that can handle HTTP/HTTPS and are not mimeinfo.cache | |
desktop_files=$(grep -rE "x-scheme-handler/(http|https)" /usr/share/applications/ ~/.local/share/applications/ | grep -E ".desktop:" | awk -F ":" '{ print $1 }' | sort -u) | |
# Create an associative array to hold appName => Exec mapping |
NewerOlder