Doodling in my bashrc.
This commit is contained in:
parent
dbe2ef1ba8
commit
78cf9887a5
25
.bashrc
25
.bashrc
|
@ -145,7 +145,7 @@ urlencode()
|
|||
# Removes *~ and #*# files in curent folder, for a depth limited to 3 folders.
|
||||
clean()
|
||||
{
|
||||
find -maxdepth 3 \
|
||||
find -maxdepth 4 \
|
||||
\( -name '*~' -o -name '#*#' -o -name .tox -o -name .mypy_cache \) \
|
||||
-print0 | xargs -0 rm -vfr
|
||||
}
|
||||
|
@ -170,9 +170,16 @@ wyz()
|
|||
curl https://wyz.fr/ -F"${1##*.}=@$1"
|
||||
}
|
||||
|
||||
code-block()
|
||||
{
|
||||
printf '```%s\n' "$1"
|
||||
cat
|
||||
printf '```\n'
|
||||
}
|
||||
|
||||
paf()
|
||||
{
|
||||
local SECRET="eek8sohxa1quaeghee1I"
|
||||
local SECRET="$(pass paf)"
|
||||
local AUTH="-HAuthorization: Secret $SECRET"
|
||||
local INSTANCE="https://p.afpy.org/"
|
||||
|
||||
|
@ -206,7 +213,8 @@ venv()
|
|||
cat >.envrc <<EOF
|
||||
if ! [[ -d .venv ]]; then
|
||||
echo "Creating venv..."
|
||||
python$1 -m venv .venv
|
||||
# --system-site-packages so from inside venv I access global pylint/flake8/...
|
||||
python$1 -m venv --system-site-packages .venv
|
||||
fi
|
||||
PATH=$(pwd)/.venv/bin/:\$PATH
|
||||
EOF
|
||||
|
@ -250,3 +258,14 @@ digns()
|
|||
done
|
||||
dig "@$(dig NS "$SOA" +short | head -n 1)" "$@"
|
||||
}
|
||||
|
||||
compress-video()
|
||||
{
|
||||
local IFILE="$1"
|
||||
local OFILE="${IFILE%.*}".m4v
|
||||
|
||||
HandBrakeCLI -Z "Fast 720p30" -i "$IFILE" -o "$OFILE"
|
||||
ls -lah "$IFILE" "$OFILE"
|
||||
cp -a --attributes-only "$IFILE" "$OFILE"
|
||||
rm -i "$IFILE"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue