Posts

Monitoring network bandwidth usage

Image
During the development of my monitoring tool, I've faced a little challenge - find a crossplatform (Linux/FreeBSD) way to monitor network bandwidth usage. Surprisingly, there is no simple way to do it. In this post I'll reveal my research and the solution I've found and implemented. Linux One of the ways to do it is using ifconfig output: $ ifconfig eth0 eth0      Link encap:Ethernet  HWaddr 00:23:54:15:54:96           inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0           inet6 addr: fe80::223:54ff:fe15:5496/64 Scope:Link           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1           RX packets:23242 errors:0 dropped:0 overruns:0 frame:0           TX packets:22369 errors:0 dro...

Useful Python executable modules

Image
In the article "Using Python command line" I've described some executable modules and now want to give more details about the most interesting ones. I do not pretend to cover everything, just want to point out some directions where you can go if you find this useful. SimpleHTTPServer The executable module which I use if there is no possibility to send files from one computer to another by other methods (ssh, smb, ftp etc). It is not so fast, but can be very useful sometimes. The usage is very simple - just change directory to the required one, and start SimpleHTTPServer: calendar Very simple module - just shows the year calendar: urllib Very simple download manager. Useful if you want to download a file or a page via command line, but don't have wget utility (for example, in Windows). Now you don't even need to open IE for FF downloading: $ python -m urllib "http://download.mozilla.org/?product=firefox-3.6.6&os=win&lang=en-US" > firefox_se...

Twitter account

I've set up the  twitter account , so you can follow me. I don't have much time to post full blog messages here, but there are many issues and thoughts which I can share via Twitter. And anyway Twitter is a good networking, communication and news tool, so everybody can gain benefits from it. Stay in touch!

Mini HOWTO: Upgrade PostgreSQL database in Fedora

The main problem in upgrading PostgreSQL databases is downgrading to previous version of the RDBMS, especially if you accidentally updates the software but forget to make the database dump. I have faced the same problem and find it's not so easy task. So let me show my solution for this: The problem: after OS upgrade I have PostgreSQL 8.4, and can't start it because the database format is incompatible and suited for PSQL 8.3 only. Install required YUM-configuration for the version of PosgreSQL you want to install, for my case PostgreSQL 8.3. There is an excellent http://yum.pgrpms.org/ website, which provides required rpms: $ sudo rpm -ivh http://yum.pgsqlrpms.org/reporpms/8.3/pgdg-fedora-8.3-7.noarch.rpm Remove the current PostgreSQL installation. It requires few steps (there is no easy way to delete postgresql-libs because there are too many dependencies): Get the list of postgresql packages: $ rpm -qa | grep postgresql postgresql-server-8.4.3-1.fc12.i686 postgresql-...

Using Python command line

Recently I had a task to write a command file for Windows that run a simple Python commands via python –c command . The manual says that command may contain multiple statements separated by newlines. Unfortunately, Windows console doesn’t allow it (and Ctrl-T trick doesn’t help) so I had to find a workaround. The intuition and language reference helped me to find out that the simple statements can be separated by semicolons like in C/C++ (however, these languages allow to separate all the commands, not the only simple ones). Let me give an example. Imagine that accidentally I want to know the error message corresponding to the error code 9. Of course, I can read manuals and documentation, but there is a more simple way: $ python -c "import os;print os.strerror(9)" Bad file descriptor But this "trick" works only with simple statements. It is not allowed to mix simple and compound statements, so the following command will not work: python -c "import os;...

IELTS Results

My results: Listening: 7.5 Reading: 7.5 Writing: 6.5 Speaking: 6.5 Overall Band Score: 7.0 My wife's results: Listening: 7.0 Reading: 7.0 Writing: 6.5 Speaking: 8.5 Overall Band Score: 7.5 Results are acceptable in despite of the problems with the equipment during the exam, and that it was boring and tedious, especially writing section.

Trac Ticket Workflow

Trac is the wiki and issue tracking system that is the most used for my software development projects. Let me share few hints about its ticket workflow, especially about the statuses, the roles of the participants, and let me give an example of the workflow config. But if you are interested in other things like Trac plugins, source browser, customizing, etc, let me know. All the information given below regards the workflow described at the end of the article. The original Trac workflow is missed vital features like the support for ticket verifying, or the required ticket statuses range, so I do not use it in my projects. The description of the main statuses: new - the ticket has been created; in-progress - the developer has began to work with the ticket; fixed - the ticket is fixed (the problem issued in the ticket is solved); verified - the ticket is verified (tester or PM has verified that the ticket is fixed correctly); closed - the ticket is closed (it's not...