Check remaining transfer limit

For two month I have been using a Broadband network connection at home. It’s an LTE connection, it’s fast and reliable. In my flat the network signal is strong.

I use Linux Mint on my laptop, so naturally I wanted to use a modem, which is working under Linux. I have a Huawei E3276 USB modem, which is working just fine.

The Internet service would be great, however my ISP does impose a transfer limit. I’ve got a contract for 15 GB of downloaded data per month. It looks like not much, but it’s enough for my usage. I work in IT, so I have enough computer and Internet access during my work. At home I just read articles and blog posts, some Youtube movies or even a bigger download.

When the transfer goes off, my connection speed is limited to 512 Kbit/s. Fortunately the connection isn’t cut off completely or I don’t have to pay additionally for bytes downloaded above limit.

To quickly check how much transfer is remaining in current month I wrote a Python script. The scripts in order to work needs vnstat Linux command line tool.

$ ./transferLimit.py 
Downloaded:	11661.48 MiB
Limit:		   11500 MiB
Remaining:	 -161.48 MiB

The script is on my BitBucket: TransferLimitCheck

Advertisements

2 thoughts on “Check remaining transfer limit

  1. Looks like a nice Python code for me even it’s kind of overkill by using Python, shell script seems to be able to handle the parsing and formatting.

    That 512 cap feels like my first ADSL, 512/64, more than a decade ago. But I do think 15GB should be enough for blog or news reading, unfortunately, websites nowadays have serious *diet* issue, all get fed like technology is free — well, sort of is.

    Anyway, good job, even I don’t use `vnstat`. By the way, if you really want to share, you should license you code.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s