• Stars
    star
    100
  • Rank 340,703 (Top 7 %)
  • Language
    Shell
  • Created about 10 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Monitor a VPN connection on Linux and kill a process upon disconnect

VPNDemon

for Linux

VPNDemon monitors your VPN connection and kills a target program upon disconnect. It's the safest and easiest way to help prevent DNS leaks and enhance your security while connected over a VPN.

Screenshot 1

It's as simple as this:

  • Run vpndemon.sh.
  • Enter the name of the target process to kill when the VPN disconnects.

That's it!

Install

  1. Download vpndemon.sh and place it in a folder, such as ~/Documents/vpndemon.
cd ~/Documents/vpndemon
bash vpndemon.sh
  1. Enter the name of a program to kill when the VPN disconnects. This can be a substring of the name, such as "chrome", "firefox", etc.

Enter a target process to kill upon VPN disconnect

  1. Click OK to start monitoring.

Monitoring VPN connection

  1. VPNDemon is now monitoring your VPN connection. If your not already connected to your VPN, go ahead and connect now.

Detecting a VPN connection

  1. Try disconnecting your VPN. VPNDemon will detect the disconnect, kill all instances of the target program, and update its status.

Detecting a VPN disconnect

Installing as an Application

  1. Download vpndemon.sh and install.sh. Run install.sh.
cd ~/Documents/vpndemon
sudo bash install.sh
  1. After installing, open the start menu and search for VPNDemon. Right-click the result and select "Add to Panel" or "Add to Desktop".

Technical Details

VPNDemon monitors the VPN connection by listening to events from the linux NetworkManager. When a VPN connect/disconnect event is received, the signal is checked to see which state it relates to. If it's a connect state, the status is simply displayed in the main window. If it's a disconnect state, VPNDemon immediately issues a kill command for all processes that match the target process name:

for i in `pgrep $killProgramName`
do
    kill $i
done

Since the NetworkManager is being listened to, directly via the dbus-monitor, disconnect events are detected almost instantly. Likewise, the target process is killed almost instantly.

VPNDemon should be compatible with any linux system that uses NetworkManager for VPN connections.

Troubleshooting

  1. A log file is saved to /tmp/vpndemon, which contains the list of VPN connect/disconnect events and a list of processes terminated. The log is cleared each time the app is run. However, you can review the log during or after running the app, to help determine any troubleshooting issues.

Preventing DNS Leaks with IPv6

If you want even tighter privacy, you can disable IPv6. This is easy to do. IPv6 incorporates hardware MAC addresses, and since many VPN services do not yet route IPv6 traffic, it creates a potential leak for network activity.

To disable IPv6, edit the file /etc/sysctl.conf and add the following lines:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

After making these changes, refresh the file by running:

sudo sysctl -p

To verify IPv6 is actually disabled, run ifconfig and verify that "inet6" is not present in the output:

ifconfig | grep inet6

License

MIT

Author

Kory Becker http://www.primaryobjects.com/kory-becker

More Repositories

1

AI-Programmer

Using artificial intelligence and genetic algorithms to automatically write programs. Tutorial: http://www.primaryobjects.com/cms/article149
C#
1,087
star
2

voice-gender

Gender recognition by voice and speech analysis
R
338
star
3

strips

AI Automated Planning with STRIPS and PDDL in Node.js
JavaScript
315
star
4

lda

LDA topic modeling for node.js
JavaScript
291
star
5

chatskills

Run and debug Alexa skills on the command-line. Create bots. Run them in Slack. Run them anywhere!
JavaScript
178
star
6

contentblocks

Create simple editable CMS content blocks in node.js. Wrapper for Create.js CMS framework.
JavaScript
118
star
7

Node.js-Bootstrap-Starter-Template

Node.js, Express, Pug, Twitter Bootstrap, Starter Template
Pug
112
star
8

knowledgebase

An expert system using logic-based artificial intelligence and symbolic AI.
JavaScript
75
star
9

TokenAuthMVC

Token-Based Authentication for Web Service APIs in C# MVC .NET
C#
65
star
10

TFIDF

TF*IDF Term Frequency Inverse Document Frequency in C# .NET
C#
59
star
11

deep-learning

Simple example of using the Accord .NET C# library to implement a deep-learning neural network (deep belief network) with machine learning. Solves XOR and an ASCII digit dataset.
C#
59
star
12

MongoDragons

A C# .NET example using MongoDb to create and display scary dragons! Uses a repository pattern and business layer to access data in the cloud via MongoLab.
C#
50
star
13

Gmail-Jabber-Chatbot

C# .NET Jabber Chatbot that Talks on Gmail with XMPP, AIML. Allows execution of custom commands, similar to an IRC bot, and conversation with the ALICE AIML SDK. Chat bot communicates with users through Gmail / GTalk via XMPP.
C#
45
star
14

unity-to-aframe

Convert a Unity 3D scene to A-Frame.
C#
44
star
15

maze

A simple maze solver in Javascript and HTML5, using the Tremaux algorithm to find the path through.
JavaScript
34
star
16

HTML5-Easy-Paint

A simple paint program in HTML5 with continuous draw and image stamps. Especially easy for children to paint!
JavaScript
31
star
17

Fluent-Simple-RPG-Game

C# .NET simple RPG role-playing battle game. Designed as an example of using the Expression Builder pattern with method chaining and progressive interfaces in C#. Demonstrates a basic internal domain specific language design. Also lets you kill some monsters too!
C#
30
star
18

nnsorting

Neural network sorting numbers
JavaScript
30
star
19

Node.js-React-Starter-Template

Node.js Express React 4 Single Page App Starter Template with Bootstrap
JavaScript
28
star
20

colorbot

A neural network color bot that uses machine learning (artificial intelligence) to categorize pictures as red, green, or blue overall. Uses node.js and mongodb.
JavaScript
25
star
21

fashion

The Fashion-MNIST dataset and machine learning models.
R
24
star
22

jquery-react

Integrate React with a JQuery app.
HTML
20
star
23

SingleSignOn

Example project implementing single sign-on with Windows Identity Foundation and forms authentication in C# MVC ASP .NET.
C#
19
star
24

emotion

Artificial intelligence emotion in a conversational UI.
JavaScript
17
star
25

Node.js-Material-Starter-Template

Node.js Jade Material Starter Template
Pug
17
star
26

genetic-programming

Genetic programming for math equations with prefix expression trees.
JavaScript
16
star
27

quantum

A set of simple tutorial programs for quantum computing including a game, Fly Unicorn.
Python
13
star
28

MVC4FormsAuthentication

MVC4 forms authentication example with custom MembershipProvider and Principal, storing user data in forms auth cookie. http://primaryobjects.com/CMS/Article147.aspx
C#
12
star
29

wumpus

Navigate the dungeon, avoid the pits, find the gold, beware of the wumpus. Artificial intelligence based AI game.
JavaScript
11
star
30

mongodragons2

A C# .NET MVC 5 example using MongoDb and AngularJs to create and display scary dragons! Uses a repository pattern and business layer to access data in the cloud via MongoLab.
C#
11
star
31

MVC-Creep-Collector

Example of configuring MVC .NET data annotations from an XML file at run-time, for a C# ASP .NET MVC4 web application, razor, jQuery, client validation.
C#
11
star
32

etf-compare

Compare common holdings of exchange traded funds (ETFs)
R
10
star
33

oracle

Quantum computing "Hello World", using a letter search with Grover's algorithm and Qiskit.
Python
10
star
34

MVC3-CSS3-Slick-Login-Form-with-Security-Example

A sample MVC3 C# ASP .NET web application, providing a slick login form with CSS3 and security authentication. Demonstrates using a custom MembershipProvider, MVC3 attribute-based opt-out security, and storing user details in the Context.User object. View it in action at http://youtu.be/nb4S6Ze1wSk
JavaScript
9
star
35

Dungeon-Map-External-Domain-Specific-Language

Example of mapping a role-playing game dungeon with a C# .NET external domain specific language. Implements a custom programming language in a text file to drive a state machine, allowing the user to create a variety of programs with the external DSL (domain specific language).
C#
9
star
36

maze-generator

A simple maze generator, built with React.
JavaScript
8
star
37

Flying-Creatures

ASP .NET MVC sample application, demonstrating the usage of RavenDB (NoSQL) and jQuery with the MVC Razor view language. Experimental theme of flying creatures (gargoyles, dragons, wraiths, etc) and reading/inserting/deleting from the NoSQL database. Software architecture includes the Repository Pattern and UnitOfWork pattern. User interface uses the jQuery flexigrid control with AJAX to display the creatures. Requires an install of ASP .NET MVC 3 RC (http://goo.gl/7iwC2), RavenDB (http://www.ravendb.org) and the StructureMap DLL (http://goo.gl/VwRUd).
JavaScript
8
star
38

Gradient-Color-Block-MVC-User-Controls

ASP .NET MVC 3 sample of using partial views as user controls with server side-code initialization. The user controls are used to display multiple gradient color blocks on the web page.
C#
7
star
39

SSL-Ghost

Demo of moving in and out of SSL HTTPS in a C# ASP .NET MVC web application. Demonstrates using SSL HTTPS for specific pages in an MVC application (login, change password, etc), while all other pages remain non-SSL.
JavaScript
7
star
40

Frosty-Forest-Adventure

A 3D web-based game developed with ChatGPT4.
JavaScript
6
star
41

strips-fiddle

An online editor for STRIPS AI planning with PDDL. Created with meteor.js.
JavaScript
6
star
42

stock-predictions

Stock market predictions for the S&P 500, submitted by users of a financial forum.
R
6
star
43

DigitRecognizer

Machine Learning digit recognizer (MNIST data-set) in C# .NET
C#
5
star
44

primaryobjects.github.com

Static web site on primaryobjects.github.io
JavaScript
4
star
45

quantum-invaders

A quantum computing alien invaders game, developed with ChatGPT4.
Python
4
star
46

lsystems

Recursive patterns using Lindenmayer systems.
JavaScript
4
star
47

saavyConsumer

Example Amazon Alexa Skill for the Echo, written using alexa-app.
JavaScript
4
star
48

unsupervised

Applying unsupervised learning using K-means clustering.
R
4
star
49

loginimagechanger

Login Image Changer for Linux Mint and Ubuntu lets you automatically change the login background each time your computer starts up.
Shell
4
star
50

jQuery-Modal-Confirmation-Dialog-MVC-Form-Submit

A sample C# MVC3 web application to submit a form and display a modal confirmation dialog with jQuery UI. The confirmation dialog allows the user to confirm the data prior to submitting to the server. Easily modifiable for any web application.
C#
4
star
51

PasteBin-Auto-Post

PasteBin automatic post in C# .NET - example code and helper class to automatically post text on PasteBin. Returns the PasteBin URL upon success. Great tool for remote debugging.
C#
4
star
52

OpenURL-PhoneGap-Plugin

Simple PhoneGap plug-in to launch a URL in a new web browser on the iPhone and Android.
Java
3
star
53

easypost

Example of reading POST data in node.js from both a form submission and from a REST client, using a manager method to abstract res.on('data') and res.on('end').
JavaScript
3
star
54

isolation

Isolation, AI game implemented in Javascript and React, using MiniMax with Alpha Beta Pruning.
JavaScript
3
star
55

contentblocks-demo

ContentBlocks node.js demo. Create simple editable CMS content blocks in node.js. Wrapper for Create.js CMS framework.
JavaScript
3
star
56

punchcard

Generate computer punch cards from text messages.
CSS
3
star
57

squarespace

A collection of render blocks for use on Squarespace.
JavaScript
3
star
58

redant

A Node.js REST service for saving/loading JSON in MongoDb. Created as part of the 2012 Associated Press Technology Summit.
JavaScript
3
star
59

Cross-Domain-Policy-Monster-Service-JSONP

Demonstrates A simple C# .NET MVC web service that creates monsters and returns them in JSON format. Learn how to call the service with JavaScript across domains, for the article: Cross domain policy violation, and how to get around it with JSONP, AJAX, J
C#
3
star
60

easypost-lib

Easy method for reading POST data in Node.js web applications. Supports form submissions and REST client posts. Provides a single location for maintaining the code that reads POST data.
JavaScript
3
star
61

semantic-search

Semantic search web app using the Large Language Model (LLM) Cohere for embeddings to match context and meaning, rather than keywords.
C#
3
star
62

Node.js-Token-API-Starter-Template

Node.js Token API Starter Template for easy token-based authentication.
JavaScript
2
star
63

remoteip-demo

A simple method for getting the client IP address for the remote browser in node.js.
JavaScript
2
star
64

hello-meteor

Hello world for Meteor.js.
JavaScript
2
star
65

eightpuzzle

Eight Puzzle Solver using A*
JavaScript
2
star
66

slidify

Create a presentation with R and Slidify.
CSS
2
star
67

dragon-generator

A super duper scary dragon generator! Reactjs tutorial project.
JavaScript
2
star
68

Code-Kata-4-Data-Munging-C-

C# .NET solution for Code Kata 4 Data Munging project http://codekata.pragprog.com/2007/01/kata_four_data_.html
C#
2
star
69

quantum-tunneling

An analysis of quantum tunneling probability for transistors.
HTML
2
star
70

XML-TreeView

XML TreeView Example
JavaScript
2
star
71

qlearning

A game using Q-Learning artificial intelligence.
JavaScript
2
star
72

XML-Web-Site-Navigation-with-MVC3

An example of loading web navigation from XML with MVC3 partial views in C# ASP .NET
C#
2
star
73

MVC-Smart-Page

MVC C# .NET smart pager for paging search results with slick customizable paging. Fully configurable, including number of results per page, adjacent count, and more. Demo included.
C#
2
star
74

REST-Monster-Factory-Web-Service

MVC .NET REST web service, supporting JSON and XML commands and responses. Web service method calls are available via REST commands (GET, POST, PUT, DELETE). Also demonstrates using AJAX with jQuery to test the web service methods.
JavaScript
2
star
75

monster-collector

An AI monster generator web app using the Large Language Model (LLM) Cohere with the EntityFramework and Sqlite.
C#
2
star
76

boggle

Boggle solver, using React
JavaScript
2
star
77

biotin

Research analysis on the effects of biotin.
HTML
1
star
78

remoteip

A simple method for getting the client IP address for the remote browser in node.js.
JavaScript
1
star
79

TwitterCorpus

A tweet loader for a large Twitter corpus, used for sentiment prediction. The corpus contains 5,513 tweet ids with sentiment rating. The loader is written in C# .NET.
C#
1
star
80

flying-unicorn

A game designed for a quantum computer.
Python
1
star
81

Perl-to-WCF

Simple Hello World example of a Perl program consuming a C# .NET WCF Web Service
C#
1
star
82

missionariescannibals

Missionaries and Cannibals AI problem in R
R
1
star
83

sphere-spin

A quantum computing game, for matching-colored qubits, developed with ChatGPT4.
Python
1
star
84

bogleheads-keywords

Web-based keyword frequency analyzer, created by ChatGPT4.
Python
1
star
85

pastebindemo

C#
1
star
86

blinking

Use a simple programming language to turn LED lights on and off.
JavaScript
1
star
87

chromestats

Collect total-user install counts for your Chrome extension daily.
JavaScript
1
star
88

algorithms

Java
1
star
89

usersonline

List the most recent 100 users visiting your site in node.js Express: Date, Time, IP Address, User Agent, Landing Page, Referring Url.
JavaScript
1
star
90

datasciencecoursera

Johns Hopkins University - Data science tracks via Coursera: Getting and Cleaning Data, Exploratory Data Analysis, Reproducible Research, Human Activity Recognition Using Smartphones Data Set Analysis
HTML
1
star
91

Windows-8-Live-Tiles

Tutorial for creating Windows 8 Live Tile Notifications in C# .NET with WinRT (Metro-style)
C#
1
star
92

Aria-Starblade

A 3D web-based RPG combat game, developed with ChatGPT4.
JavaScript
1
star
93

penney

A map plot of JCPenney store closings.
R
1
star