Posts

Mini HOWTO: Create a PDF document from multiple images

Sometimes it is required to send someone multiple images. Of course, you can send these images as they are, or you can create and send an archive of these images. But it will be more convenient to send a PDF document. In that case the recipient can easily open the document and he/she will see these images in the sequence you assumed. There is a powerful software suite called ImageMagick . It provides various utilities for any graphics processing demands. Now we are interested in a convert utility. It has many useful features and it is really irreplaceable for the image batch-processing like in our case. The command for converting images is pretty simple: $ convert -define pdf:use-cropbox=true -density 72x72 -resample 72x72 -compress JPEG *.png result.pdf The convert utility takes all PNG-images in the current directory and creates a PDF-document from it. You can modify any options as you want. Let's have a look at some of them: density and resample - these options...

My FOSS projects

Updated list of the projects I'm working on: Mail Dispatcher (role: admin, platform: Python/PyGTK) - A tool for dispatching (basically, deleting) email messages on POP3 server via Plain or SSL connection with advanced filtering capabilities. DHCP Explorer (role: admin, platform: Python) - A console cross-platform tool for locating all available DHCP servers. sdict2db (role: admin, platform: C#/WinForms) - Parser for SDict-based format dictionaries with ability to save in a SQL server (with creating table, index and filling data) and in a text file (SDict text format). DNN Dictionary (role: admin, platform: C#/DotNetNuke) - A DotNetNuke module for translating texts using SDict-based (http://sdict.ru/en/) dictionaries. It works using AJAX mechanism so there is no pages reloading during translating. Geek Workspace (role: admin, platform: Python/PyQt4) - Geek Workspace is a desktop environment aimed for developers, scientists, engineers and students. The key point is a progr...

Creating video conference application with GStreamer

Image
GStreamer is a library for constructing graphs of media-handling components. The applications it supports range from simple Ogg/Vorbis playback, audio/video streaming to complex audio (mixing) and video (non-linear editing) processing. GStreamer is released under the LGPL, so it can be used in commercial applications. The power of GStreamer is in its module infrastructure - you're working with certain "blocks", combine it with "pipes" and got results without any coding (via gst-launch utility). Of course, after playing with gst-launch you can write an application in any language you prefer (GStreamer supports various bindings and due to fact that GStreamer is written in C, I do not see any problems to bind it with an application that is developed in any serious programming language). I do not want to explain GStream basics, but move forward to the blog topic - creating videoconference application. If you want certain tutorial, please take a look to the P...

Mini HOWTO: Programmatically upload a file in Django

Surprisely, there is no any good advice in the Internet how to programmatically upload a file to the FileField field in the Django. I want to cover this issue with the sample that shows how to upload a generic file from the Internet to a Django application. The code is simple: import urllib, mimetypes, os from django.core.files.base import ContentFile #... filename, msg = urllib.urlretrieve(img) ext = mimetypes.guess_extension(msg.type) name, original_ext = os.path.splitext(filename) new_filename = filename if ext != original_ext: new_filename += ext obj.file.save(new_filename, ContentFile(open(filename).read())) First of all, we retrieves a file. urlretrieve returns a tuple <filename, msg>. filename is a name of a temporary file with the downloaded content. msg is a HTTPMessage class instance that contains headers of the file. We use msg to determinate the type of the file. For this guess_extension method is used. It is required for the case when the file is gene...

PhoneyC honeyclient

Overview Let me introduce PhoneyC - pure Python honeyclient implementation. It is a perspective project and it has a huge potential. All features and advantages are described in a corresponding article . Briefly, PhoneyC is a low interaction, virtual honeyclient that emulates the core functionality of a web client and emulates specific vulnerabilities to pinpoint the attack vector. It consists of two core components - a simple web crawler ( honeywalk.py ) and an analysis engine ( honeyclient.py ) with all required auxiliary modules. Further I'll describe installation and usage procedures. Installation As a sample platform I'm using Ubuntu 9.04 Jaunty Jackalope for x84-64 processor. Following the README instructions we have to install python 2.3 and upper, clamav, spidermonkey, vb2py and curl (it is not mentioned in the README file, but it is used internally by the analysis engine): $ sudo apt-get install clamav spidermonkey-bin Python is already installed in the syste...

Git vs Mercurial

Due to latest changes in projects hosting situation (like FTC Sues, Shuts Down N. Calif. Web Hosting Firm , Adobe acts against Flash video stream recorder ) I started thinking about moving on to some DVCS system. Now there are only two serious alternatives: Git and Mercurial . First of all, here are two good articles where these systems are compared: Chosing a distributed VCS for the Python project Analysis of Git and Mercurial In both of these articles Mercurial wins due to: lack of good Git support in Windows system; having Python API. But also in both of these articles it is said that Git has more features and is more powerful than Mercurial. Actually none of the issues above does not concern me personally because I'm not developing in Windows OS now, and I do not require any integration with DVCS. But let me notice that these issues are not so critical right now: there is an awesome TortoiseGit project and it works really good; basically only certain hooks ...

Geek Desktop Solution project

Image
In my free time I have started working on the new GPL project named "Geek Desktop Solution" (GDS). The project is a desktop (like KDE or GNOME ) aimed for keyboard jedi and other technical geeks. It was inspired by SciFi movies especially "Stargate Atlantis" . Rodney McKay, Chief Scientific Officer of the Atlantis Expedition, created his programs (or macros as it was called in the movie) interactively and very fast. I thought how it can be done and found a solution that makes this interactive and fast programming possible. The main concepts of GDS are: All environment items can be programmatically modified by user. The interactive shell is an entry point of the desktop - all operations can be performed using the shell. There is no mouse requirements - the user can operate the desktop using shell or keyboard shortcuts only. But at the same time almost all operations can be performed with the mouse (for touchscreen-based devices without keyboards)....