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 |
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: Go | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: |
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 | |
podman run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21 go get | |
podman run --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp golang:1.21 go build -v | |
#!/bin/bash | |
goVersion() { |
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
https://python-jsonschema.readthedocs.io/en/stable/validate/ | |
https://python-jsonschema.readthedocs.io/en/stable/api/jsonschema/protocols/#jsonschema.protocols.Validator.validate | |
https://json-schema.org/understanding-json-schema/basics#basics |
NewerOlder