Skip to content

Instantly share code, notes, and snippets.

View minhtrancccp's full-sized avatar
💭
I may be slow to respond.

Minh Tran minhtrancccp

💭
I may be slow to respond.
View GitHub Profile
@minhtrancccp
minhtrancccp / help.sh
Created June 22, 2024 02:56
an extension to the help builtin of bash, with stdout colorisation and paging of bat
#!/bin/bash
# based on https://github.com/sharkdp/bat#highlighting---help-messages
help() {
{
set -x
command help "$@" 2>/dev/null
type -P "$1" && if echo "$@" | grep -Eq '(\s-h|help)(\s|$)'; then "$@"; else "$@" --help; fi
} |& bat -plhelp
}
@minhtrancccp
minhtrancccp / helpfix.sh
Last active April 26, 2024 18:41
a hopefuly more improved version of the `helpfix` function
#!/bin/bash
helpfix() {
local status=$?
test $status -eq 0 && return
local command
local stdout
command=$(mktemp)
@minhtrancccp
minhtrancccp / proton-vpn-stable.repo
Last active February 7, 2024 18:01
protonvpn installlation log, use scriptreplay to replay the terminal session
[proton-vpn-stable]
name=proton-vpn-stable
baseurl=https://repo.protonvpn.com/fedora-39-stable/
enabled=1
type=rpm
gpgcheck=1
gpgkey=https://repo.protonvpn.com/fedora-39-stable/public_key.asc