Posts

CodeExample plugin for Trac version 1.0 has been released

Image
The CodeExample renders a code example box that supports syntax highlighting. It support three types of examples: simple, correct, and incorrect. I've made the major changes to the plugin and now it is fully compatible with Trac 0.11 and Trac 0.12. Changelog from version 0.3: Support for multiply repositories (Trac 0.12 and upper) has been added. Collapsing/expanding code blocks have been implemented. Ability to change title has been added. Options using has been reimplemented. Two examples (the first gets source from repository, the second contains the code inside): {{{ #!CodeExample ## type = good ## title = GPGData sample code ## repo = MacGPGME ## path=GPGData.m ## regex="static void releaseCallback\(.*" ## lines=4 #!objective-c }}} {{{ #!CodeExample ## type = bad #!haskell fibs = 0 : 1 : [ a + b | a <- fibs | b <- tail fibs ] }}} These will be rendered as: See details on trac-hacks CodeExampleMacro...

Using Farstream for videoconferencing

Image
I see a lot of comments about Gstreamer videoconferencing abilities, so I want to continue this topic and say a few words about the Farstream project. Gstreamer is the one of Collabora's flagship projects. This company is developing other projects based on Gstreamer, and Farstream is exact project for audio and video conferencing. With Farstream, businesses can easily create a multi-platform, multi-user audio/video conference solution that supports a wide range of codecs. Simply put, Farstream (formerly Farsight) is an advanced VoIP/video streaming engine capable of dealing with all known audio/video conferencing protocols. Quote from the project description: Philippe Kalaf began the Farstream project in 2005. He was aiming to create a simple-to-use framework that implemented multiple audio/video streaming protocols. Most of the initial work on Farstream focused on the protocol agnostic API and the RTP plugin. Over the years, the RTP plugin has matured into a very c...

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;...