Skip to content

Instantly share code, notes, and snippets.

@oscarduignan
Last active December 5, 2017 02:14
Show Gist options
  • Save oscarduignan/1e0fafb88d8d8c69162d831937cc2e50 to your computer and use it in GitHub Desktop.
Save oscarduignan/1e0fafb88d8d8c69162d831937cc2e50 to your computer and use it in GitHub Desktop.
Connect to NordVPN more easily on linux (using fish shell, fzf, and fd - gif of finished script in comments)

Assuming you have openvpn, fish, fzf, and fd installed

Grab the NordVPN openvpn config files and unzip them

curl -Lo ~/NordVPN/ovpn.zip --create-dirs https://downloads.nordcdn.com/configs/archives/servers/ovpn.zip
unzip ~/NordVPN/ovpn.zip

Grab the function defined in the file below

curl -Lo ~/.config/fish/functions/nordvpn.fish --create-dirs https://gist.githubusercontent.com/oscarduignan/1e0fafb88d8d8c69162d831937cc2e50/raw/nordvpn.fish

Before you can run the function you need to add your nordvpn username and password on separate lines to ~/.nordvpn

Once that is done you can now run nordvpn and you'll see a list of the openvpn configs to choose from in fzf, when you choose one it will load that connect using that config with openvpn (animated gif in comments)

function nordvpn -d "Connect to NordVPN"
# https://zendesk.nordvpn.com/hc/en-us/articles/213040989-How-to-securely-watch-Netflix-with-NordVPN
echo NordVPN, select your server to connect:
echo "("(set_color red)US Netflix(set_color normal) 707-710, 722-733, 868-875, 884-887,940-947, 952-963, 980-987, 1074-1193, 1196-1215")"
fd -e ovpn . ~/NordVPN | fzf --height 40% | read -l result
[ "$result" ]; and sudo openvpn --config $result --auth-user-pass ~/.nordvpn
commandline -f repaint
end
@oscarduignan
Copy link
Author

peek 2017-12-05 01-50

I haven't tested the installation steps above but they are a condensed version of what I did to get it working for myself locally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment