Friday, May 18, 2007


Compiling MPlayer on linux-amd64

I now have a new desktop computer (DELL Precision Workstation 390n, RH Enterprise 4) and already spent a few days setting it up in various ways. Most of the time, it has been straightforward, but setting up MPlayer was much less than trivial.

Here is an overview of the main steps required to install it (MPlayer 1.0rc1-4.1.1 © 2000-2006)

1. 64-bit vs. 32-bit problems

(This section will not apply to you if your OS is 32-bit)

MPlayer must be compiled in 32-bit mode since it invokes proprietary Windows codecs and therefore some basic 32-bit environment must be available. 2. Setting up MPlayer problems 3. Mysterious problems Following a successful compilation, mplayer was able to start and to display movie files, however, any attempt to change playback speed was causing a crash in function vo_update_osd, file libvo/sub.c. Here is what I did to solve the problem: 4. Bonus track

Labels: , ,

Tuesday, May 15, 2007


My favorite Firefox extensions

Adblock PlusAds blocker
Dictionary TooltipBrings dictionary lookup results in instantaneous pop-up frame
FissionProgress bar in the address bar (Safari Style)
Forecastfox l10nInternational weather forecasts
Gmail NotifierNotifies you about new GMail
Google NotebookDirect access to Google Notebook while browsing
Google ToolbarEveryone knows what it is :-)
IE ViewView current page in IE
SageA lightweight RSS aggregator
Save As ImageAdds the ability to save a page, frame, or part of either as an image.
User Agent SwitcherLie to a web server about your browser :-)
Web DeveloperAdds a menu and a toolbar to the browser with various web developer tools
StylishAllows for page-specific style customization
Dictionary SearchVery basic tool that allows submission of selected word to any search engine
Deepest SenderExtension for blog posting, supports LJ/WP/Blogger
Also Firefox "buttons" :

P.S. [9-Jul-07] Two more useful extensions: LiveJournal Addons (see also here) and Locationbar².

P.S. [9-Jul-07]. Also add to the list of useful extensions Google Browser Sync.

P.S. [13-Sep-07]. Hebrew Calendar

P.S [18-Mar-08]. dragdropupload

P.S [16-Apr-08]. Multiple Tab Handler

P.S [05-May-08]. FireStox


Tuesday, May 08, 2007


Using getmail/procmail to peek into IMAP server

I am using IMAP (in fact, Microsoft Exchange) server to read my mail. Now, I want some automated tool to take a sneak peek at all new e-mails which come my way and if these e-mails deemed "important", let's say, forward them to another e-mail account.

This could be easily done on a UNIX platform using getmail/procmail combination, but there is a fair amount of configuration required to achieve this goal, including patching getmail source in the process, so let me for the future reference underline the steps required and give some examples of configuration files I used.

1. Install procmail.,/p>

Currently, the latest version is 3.22 and source code can be copied directly from here (September 2001)

To install, you can do

make install
but before you do, make sure that your /bin/sh is in fact bash (install it if necessary) and not regular Unix sh; if not, replace first line of file initmake with #! /bin/bash.

After installation, make sure "man procmailrc" works for you (you will need it!) and if not, adjust your $MANPATH and/or copy all *.[15] files from "new" to an appropriate location.

2. Install getmail.

Currently, the latest version 4.7.4 is available here (April 2007). Note that you must have Python installed as getmail is Python-based.

Before you build/install getmail, make one change to file getmailcore/ : replace line

return self._getmsgpartbyid(msgid, '(RFC822)')
with line
return self._getmsgpartbyid(msgid, '(BODY.PEEK[])')
as suggested in this e-mail thread, in order to prevent your new messages from being marked as "read' ('seen' in IMAP language).

As a side note, alternative approach (instead of using 'PEEK' command) could have been to manually mark messages fetched as 'unseen'. Unfortunately, Python imaplib does not have an interface to do so like Perl module Mail::IMAPClient does, where there is a special function deny_seeing. We can however look at the implementation of this function:
sub deny_seeing {
  my($self, @msgs) = @_;
  if ( ref($msgs[0]) =~ /ARRAY/ ) { @msgs = @{$msgs[0]} };
  $self->unset_flag('\\Seen', @msgs);
sub unset_flag {
  my($self, $flag, @msgs) = @_;
  if ( ref($msgs[0]) =~ /ARRAY/ ) { @msgs = @{$msgs[0]} };
  $flag =~ /^\\/ or $flag = "\\" . $flag
     if $flag =~ /^(Answered|Flagged|Deleted|Seen|Draft)$/i;
  $self->store( join(",",@msgs), "-FLAGS.SILENT (" . $flag . ")" );
to understand that in Python this probably could have been done by calling doing something like that (untested): (message_set, "-FLAGS.SILENT (\\Seen)" )
getmail, like any Python module, is installed in 2 steps:
python build
python install

3. Make new directory ~/.getmail and create there file getmailrc like that:

type = SimpleIMAPRetriever
server =
username = myusername
port = 143
password = mypassword
mailboxes = ("Inbox",)
type = MDA_external
path = /usr/bin/procmail
arguments = ('~/.getmail/procmailrc',)

(fill out proper IMAP server credentials). If you need help with getmail configuration file, see here.

4. In the same directory ~/.getmail, create new file procmailrc like that :

# Put ## before LOGFILE if you want no logging (not recommended)
# Set to yes when debugging
# Remove ## when debugging; set to no if you want minimal logging

:0: procmail.lock
* ^From:.+(Petya|Vasya|Kolyan|


(Turn off debugging as per comments in the above file when satisfied). If you need help with procmail configuration files, use "man procmailrc".

5. Test your new setup as needed by using command:

getmail  --dont-delete --new
and then satisfied, add something like this in your crontable:
1,6,11,16,21,26,31,36,41,46,51,56 * * * * /usr/local/bin/getmail -q -l -n

You are all set!

Labels: , , , ,

This page is powered by Blogger. Isn't yours?