[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: DWDW.jpg (54 KB, 976x850)
54 KB
54 KB JPG
/BASH/ GENERAL


Im trying to clear cache on my DNS regularly using this command and i was wondering what anons do to clear their DNS cache on linux?


>sudo systemd-resolve --flush-caches && sudo resolvectl flush-caches && sudo killall -HUP dnsmasq 2>/dev/null; sudo rm -f /var/lib/systemd/resolve/stub-cache
>>
I use this to encrypt my files on go based on time lock.

>openssl enc -aes-256-cbc -salt -in "$1" -out "${1}.enc" -pass pass:$(date +%s) && echo "File encrypted. Password is $(date +%s)"
>>
>>106440849
gemini "please clear my dns cache"
>>
>>106440897
>gemini "please clear my dns cache"
I dont use AI
>>
>>106440933
So your server is fully agentless?
>>
>>106441117
>>106440933
>>106440897
>>106440886
https://github.com/monorhenry-create/Thunderbolt-Cache-Cleaner
>>
Why not restart systemd-resolved?
>>
File: 1730848080325478.png (1.8 MB, 1024x1024)
1.8 MB
1.8 MB PNG
wrote this few years ago
needs to be customized for your own system

$ file.webm
bash: command not found: file.webm
Playing: file.webm
...
$ fish
bash: command not found: fish
fish may be found in the following packages:
community/fish 2.7.1-1 /usr/bin/fish
$ lsd
bash: command not found: lsd
Did you mean: ldd, ld, ls


_mime_run() {
local prog

[[ -f "$1" ]] || return

case "$(file -b --mime-type -- "$1")" in
video/*|audio/*) prog=mpv ;;
image/*) prog=feh ;;
application/pdf) prog=mupdf ;;
text/*) prog="${PAGER}" ;;
*) return 1
esac

"${prog}" "$@"
}

# based on pkgfile's /usr/share/doc/pkgfile/command-not-found.bash
_pacman_check() {
type pkgfile &>/dev/null || return

local pkgs
mapfile -t pkgs < <(pkgfile -bv -- "$1" 2>/dev/null)

(( ${#pkgs[*]} )) || return

printf "%s may be found in the following packages:\n" "$1"
printf " %s\n" "${pkgs[@]}"
}

_spell_check() {
[[ -f ${BASH_ASPELL_DICT} ]] || return
type aspell &>/dev/null || return

aspell -d "${BASH_ASPELL_DICT}" -a --sug-mode=fast <<< "$1" 2>&1 | \
sed -n 's/^&.*: /Did you mean: /p'
}

command_not_found_handle() {
echo "$(basename -- "${SHELL}"): command not found: $1" 1>&2
_mime_run "$@" && return
_pacman_check "$@" && return
_spell_check "$@" && return
}

BASH_ASPELL_DICT=~/.cache/bash-aspell-dict


dict for spell check needs to be generated

while read -d: dir; do
for file in "${dir}"/*; do
[[ -x ${file} ]] || continue
basename -- "${file}"
done
done <<<"${PATH}" | \
aspell --lang=en --dont-validate-words create master "${BASH_ASPELL_DICT}"
>>
>>106441139
Yep. That's what I do after using corpo VPN, which messes up with my DNS.
>>
Do you keep your bashrc lean and clean?

if [[ -d "$XDG_CONFIG_HOME/bash" ]]; then
for file in "$XDG_CONFIG_HOME"/bash/*.bashrc; do
source "$file" || >&2 printf "Error loading: $file (code $?)\n"
#TIMEFORMAT="%Es" && time source "$file" && printf '%s\n\n' "loaded $file" && unset TIMEFORMAT
done
unset file
fi



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.