Auto saved by Logseq

This commit is contained in:
Andrea Fazzi 2023-03-29 10:12:54 +02:00
parent 4c5efacc56
commit 78c7eb4315

View file

@ -1,27 +1,17 @@
- **11:33** [[quick capture]]: Alpaca: A strong open-source instruction-following model [Alpaca: A strong open-source instruction-following model](https://news.ycombinator.com/item?id=35136624) #LLM
- [Idea](https://stackoverflow.com/questions/66377590/reconnect-wireguard-to-another-vpn-server-if-ping-fails) per far riconnettere il client #wireguard al nodo #vpn se il il ping fallisce #homelab
- ```bash
$gateway_IP=10.6.0.1
#!/bin/bash
while true
do
if /bin/ping -c 1 $gateway_IP
then
sudo wg-quick up wg0
tries=0
while [[ $tries -lt 3 ]]
do
if /bin/ping -c 1 $server1Ip
then
tries=0
continue
fi
tries=$((tries+1))
done
sudo wg-quick down wg0
sudo wg-quick up wg0
gateway=10.6.0.1
count=$(ping -c 3 $gateway | grep from* | wc -l)
if [ $count -eq 0 ]; then
echo "VPN gateway seems unreachable. Restarting the VPN client..." | systemd-cat -p warning
wg-quick down wg0 && wg-quick up wg0
else
echo "VPN gateway is reachable, no action required!" | systemd-cat -p info
fi
done
```
- **16:51** [[quick capture]]: Scrcpy 2.0 mirrors Android devices with audio forwarding [Scrcpy 2.0 mirrors Android devices with audio forwarding](https://news.ycombinator.com/item?id=35151298) #Android #teaching
-