Start and Stop Softether from command line on linux

extute ip route show and compare route table before and after connecting to the vpn server to get all required addresses


[ "$UID" -eq 0 ] || exec sudo "$0" "$@"

vpnclient start
sleep 2s
vpncmd localhost /client /CMD AccountConnect [ConnectionName]
dhclient [VPN_Adapter]
ip route add [VPN_Server_IP]/32 via [Gateway_Address] dev [Network_Device_Name]
ip route del default via [Gateway_Address] dev [Network_Device_Name]

[ "$UID" -eq 0 ] || exec sudo "$0" "$@"

vpnclient start
sleep 2s
vpncmd localhost /client /CMD AccountConnect GE
dhclient vpn_vpn
ip route add via dev wlp3s0
ip route del default via dev wlp3s0


[ "$UID" -eq 0 ] || exec sudo "$0" "$@"

vpncmd localhost /client /CMD AccountDisconnect GE
vpnclient stop
ip route del default via dev vpn_vpn
ip route del via dev wlp3s0 
ip route del dev vpn_vpn proto kernel scope link src
ip route add default via dev wlp3s0 proto dhcp metric 600
echo 'nameserver' > /etc/resolv.conf
echo 'nameserver' >> /etc/resolv.conf


Write data to text file using bash/shell scripting

You can redirect the output of a command to a file:

cat file > copy_file

or append to it

cat file >> copy_file

If you want to write directly the command is echo ‘text’

echo 'Hello World' > file


# possibility 1:
echo "line 1" >> greetings.txt
echo "line 2" >> greetings.txt

# possibility 2:
echo "line 1
line 2" >> greetings.txt

# possibility 3:
cat <<EOT >> greetings.txt
line 1
line 2



Set Up Time Synchronization on Ubuntu with ntpd

Though timesyncd is fine for most purposes, some applications that are very sensitive to even the slightest perturbations in time may be better served by ntpd, as it uses more sophisticated techniques to constantly and gradually keep the system time on track.

sudo timedatectl set-ntp no
sudo apt-get install ntp
sudo ntpq -p


Extra Repositories for Ubuntu Server 18.04

deb bionic universe multiverse
deb-src bionic universe multiverse

deb bionic universe
deb-src bionic universe
deb bionic-updates universe
deb-src bionic-updates universe

deb bionic multiverse
deb-src bionic multiverse
deb bionic-updates multiverse
deb-src bionic-updates multiverse

deb bionic-security universe
deb-src bionic-security universe
deb bionic-security multiverse
deb-src bionic-security multiverse