Tuesday, 21 August 2012

Control your bandwidth using ntop

I was looking for tool which could help me check who is using my bandwidth. Here are requirements which I want from this kind of tool:
  1. local hosts bandwidth distribution - it is helpful when you are loosing your bandwidth and don't know who abuse it in your local network
  2. remote hosts bandwidth distribution - it is useful in situation when you want to have control over DoS attacks for your public homepage or when your QoS are not set well


My first shoot is to check what features can give me my TP-Link TL-WR941ND router. I've installed on it Gargoyle (modification of OpenWRT with some additional features) some time ago. It has some useful monitoring features:
  • bandwidth distribution pie charts which answer for my first requirement but I can't check the time when bandwidth was used there

  • connections track - from this I can check two sides of connection (also remote host) and how much of data was send/received but it also doesn't show this information in time domain and it is served in less friendly, text form

It was no exactly what I'm looking for. Therefor I checked what what can we find in OPKG (OpenWRT Package Management).

Monday, 20 August 2012

Rapid js + css development


Last time I had some work to do in OSGi web module written in Spring MVC. If we have application splitted to well-designed modules, back-end development in this framework run in OSGi environment is quite fast because after some modification we must update only one bundle (without dependencies). But programming in front-end is much less dynamic than in in modern frameworks like Ruby or Groovy. There is no build-in support to update resources "on the fly" after their modification (or I can't find it).

There is many plugins to web browser which help you build front-end from scratch in wysiwyg mode. But I can't find any which could modify resources of already ran application. Also it will be complicated to keep synchronized these modifications with our sources. Therefore I tried to use local links to my project in my application. I put code similar to this below in my page.

After redeploy I found in my Chromium console: Error::Not allowed to load local resource: file:///path/to/my/local/resource.js. After some googling I found solution: adding --allow-file-access-from-files switch to application. Unfortunately it doesn't work on my Chromium v.18. I also checked other switches: --disable-web-security and --allow-file-access but with no effect. I also tried  LocalLinks plugin but with the same result.