Recentely I've become a user of a great VPN service offered by Airvpn.
I decided, in order to secure and encrypt my connection well, to use it inside an SSL tunnel.
This I achieved by following the guide shown here.
I'm not using the airvpn client and I was getting slightly tired with turning on and off
the stunnel and the openvpn connection in seperate terminals whenever I needed to connect or disconnect.
This script is the result of that tiredness.
In order to use this tool, you should accomplish the next steps:
sudo -s
). /home/your_user_name/airvpn/
cd
into its folder. cp * /home/your_user_name/airvpn/
). pip install -r requirements.txt
to install the needed requirements. Pay attention that installing wx (which is needed in order to show the
system tray indicator) inside virtualenv is kinda pain in the ass. I would
recommend to avoid it and install it directly on the system. Now you're ready to run it.
execute sudo python airvpn_toggler.py on
, when the script asks you which country you wish to exit from, choose your deisred
country code and that's it.
You'll know you're good if (1) The script tells you that it has finished successfully. (2) A new system tray icon apeears,
or (3) Issue curl -s ipinfo.io/"$(wget http://ipinfo.io/ip -qO -)" | egrep -w "city|region|country"
and see the results.
If you wish to turn off the connection, you can either execute "sudo python airvpn_toggler.py off" or right-click the small system tray icon and choose "Turn Airvpn off".
In addition, I have a small alias which execute this script in a shorter manner -
First, make the script executable by the default bash env with sudo chmod +x airvpn_toggler.py
Then, in my aliases file I have the following:
alias at='toggleAirvpn'
toggleAirvpn() {
cwd=$(pwd)
cd /home/your_user_name/airvpn
sudo /home/your_user_name/airvpn/airvpn_toggler.py $1
cd $cwd
}
(don't forget to source it after the change, i.e . ~/.bashrc
)
and I run by it issuing at on
or at off
Cheers.