Mobile app for netman can be found here
Manually keeping track of the internet usage in IUT is tedious work. Netman is a small tool that does that dull job for us, saving us a few extra minutes to focus on more productive things. We can add our credentials and netman will send us our internet usage report via email.
- Install python 3.x, pip and git if you don't have them already.
- Clone and install the dependencies:
git clone --depth 1 https://github.com/L1ghtweight/netman.git
cd netman
pip install -r requirements.txt
NOTE: Administrative privileges may be needed to install pip packages in windows.
- We'll need a gmail account to send mails. To set up the email:
- First, enable 2FA from here.
- Then, go to
App Passwords
, selectMail
andWindows computer
and hitGenerate
. - You will be given a password, copy it.
Google's official guide regarding this step can be found here.
NOTE: Using a throwaway mail is highly recommended.
- Inside the
netman
folder, create a file namedsecrets.py
and store your email and password you just copied in this format:
email = "[email protected]"
password = "password"
- Inside the
netman
folder, create the a file namedcredentials.json
and add your IUT internet credentials inside the file in the following format:
{
"name1": {
"username": "username1",
"password": "password1",
"email": "email@email",
"us": true
},
"name2": {
"username": "username2",
"password": "password2",
"email": "email@email",
"us": false
}
}
- Follow the structure given in the file.
- Setting the
us
variable totrue
means you will get notified about all of the users' usage through email. Otherwise, you'll get usage of yourself only.
- We can now run the script with the command
python netman.py
.
NOTE: You need to be connected to IUT internet so that the iusers page is accessible.
We can schedule the script to get a periodic update.
- For windows we can use the pre-installed
Task Scheduler
.
- For Linux we can use
crontab
. - Using the
netman_cron.sh
script is recommended.
As secrets.py
and credentials.py
files are not encrypted, it is necessary to keep them safe from prying eyes.
Using a database: Seems like an overkill for such a simple task.
Password protecting the files: Password would be required whenever an instance is run. If used as a scheduled task, this would become a hassle.