- https://github.com/Benjamin-Loison
- Joined on
2022-10-16
aliases prefer LAN over Internet but with a single command
time timeout 1 ssh fp4; echo $?
Output:
real 0m1.004s
user 0m0.003s
sys 0m0.007s
124
time timeout 0.5 ssh…
aliases prefer LAN over Internet but with a single command
time ssh -o ConnectTimeout=1 fp4
echo $?
Output:
ssh: connect to host fairphone-4-5g port 8022: Connection timed out
real 0m1.021s
user 0m0…
aliases prefer LAN over Internet but with a single command
DuckDuckGo search add ssh timeout.
aliases prefer LAN over Internet but with a single command
ssh not_existing
echo $?
ssh: Could not resolve hostname not_existing: Name or service not known
255
ssh pegasus exit
echo $?
0
aliases prefer LAN over Internet but with a single command
To support nickname, may have to write some kind of dict in ~/.bashrc but I do not like this approach. alias should not work I guess, at leats not cleanly.
Current ping is not compatible…
aliases prefer LAN over Internet but with a single command
Related to Benjamin_Loison/openssh/issues/53.
aliases prefer LAN over Internet but with a single command
ssh_on_same_network_preferably Benjamin-Loison-HP-Debian hostname
Output:
Internet proxy
Benjamin-Loison-HP-Debian
aliases prefer LAN over Internet but with a single command
What about other protocols like SCP with scp?
aliases prefer LAN over Internet but with a single command
Being compatible with just targeting a given computer, no matter the running OS hostname would be nice. #28 may help to have an absolute computer address no matter the running OS.
aliases prefer LAN over Internet but with a single command
# [Benjamin_Loison/linux/issues/32](https://gitea.lemnoslife.com/Benjamin_Loison/linux/issues/32)
alias Benjamin-Loison-HP-Debian_ssh='if ping -c 1 Benjamin-Loison-HP-Debian > /dev/null
…
aliases prefer LAN over Internet but with a single command
I suspect that if I try to ssh and depending on exit status try with Internet proxy, then it may be bias by possible correct but broken or exited ssh connection.
aliases prefer LAN over Internet but with a single command
So figuring out if the computer is available on current network seems to take at most about 0m0.119s which is fine.
aliases prefer LAN over Internet but with a single command
ping -c 0 Not-Existing
ping: bad number of packets to transmit.
aliases prefer LAN over Internet but with a single command
ping -c 1 Not-Existing
ping: unknown host Not-Existing
aliases prefer LAN over Internet but with a single command
As get same nslookup output on my flat wifi without Cloudflare DNS.
ping -c 1 Benjamin-Loison-HP-Debian
Output:
PING Benjamin-Loison-HP-Deb…
Just rebooting my Debian 12 GNOME work laptop seems to lead to the issue.
aliases prefer LAN over Internet but with a single command
alias Benjamin-Loison-HP_ssh='ssh Benjamin-Loison-HP_CENSORED'
time nslookup Benjamin-Loison-HP
echo $?
Output:
Server: …
aliases prefer LAN over Internet but with a single command
After talking about it with the person:
-----BEGIN PGP MESSAGE-----
hF4DTQa9Wom5MBgSAQdAjEk4CAOEN6Gf22csdaJEojX9mxG/Y+Xf8kNWyCx+7How
4jbzJF+RE6rbqw7Ur/5GYX…