Skip to content

Instantly share code, notes, and snippets.

@StrangeTcy
Last active April 11, 2023 18:04
Show Gist options
  • Save StrangeTcy/03fd7685c9b28aaaf0da375e4627afee to your computer and use it in GitHub Desktop.
Save StrangeTcy/03fd7685c9b28aaaf0da375e4627afee to your computer and use it in GitHub Desktop.
from tqdm.auto import tqdm
from time import sleep
import subprocess as sp
locations = ['smart', 'defr3', 'defr1', 'denu', 'jpto', 'jpsh', 'jpyo', 'jpto2', 'usnj3', 'usnj1', 'usny', 'usat', 'usmi2', 'usmi', 'uswd', 'usda', 'usch', 'uslp', 'usal', 'ussf', 'usla3', 'usla2', \
'usse', 'usde', 'ussl1', 'usta1', 'usph', 'usnj2', 'usda2', 'usla1', 'usla5', 'ussm', 'sgju', 'sgcb', 'sgmb', 'hk2', 'hk1', 'aume', 'auwo', 'ausy', 'aupe', 'aubr', 'auad', 'ausy2', 'nlth', 'nlam', 'nlro', \
'kr2', 'ph', 'se', 'se2', 'my', 'dk', 'inuk', 'insi', 'lk', 'pk', 'ukdo', 'uklo', 'ukel', 'ukmi', 'ukwe', 'kz', 'th', 'id', 'nz', 'tr', 'eg', 'tw3', 'dz', 'vn', 'frma', 'frpa2', 'frpa1', 'frst', 'fral',\
'mo', 'kh', 'cz', 'mn', 'at', 'la', 'mm', 'ch2', 'ch', 'itco', 'itmi', 'np', 'cato', 'cava', 'cato2', 'camo', 'uz', 'bd', 'bt', 'bnbr', 'xv', 'mx', 'br2', 'br', 'pa', 'cl', 'ar', 'bo', 'cr', 'co', 've', 'ec', 'gt', 'pe', 'uy', 'bs', 'ro', 'im', 'esma', 'esba', 'esba2', 'ie', 'is', 'no', 'be', 'fi', 'gr', 'pt', 'am', 'pl', 'lt', 'lv', 'ee', 'ad', 'me', 'ba', 'lu', 'hu', 'bg', 'by', 'ua', 'mt', 'li', 'cy', 'al', 'hr', 'si', 'sk', 'mc', 'je', 'mk', 'md', 'rs', 'ge', 'za', 'il', 'ke']
# [11:]
for num, loc in enumerate(tqdm(locations)):
sp.run(["expressvpn", "disconnect"])
print(f"Testing location #{num}, {loc}...")
print("Switching our vpn:")
sp.run(["expressvpn", "connect", f"{loc}"])
input("Did it work?")
sleep(1)
print("Restarting our network manager...")
sp.run(["expressvpn", "disconnect"])
sp.run(["sudo", "service", "network-manager", "restart"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment