<?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-8518021139708603317</id><updated>2012-01-27T11:49:33.425+02:00</updated><category term='ruby'/><category term='test'/><category term='unix'/><category term='bugs'/><category term='books'/><category term='vmware'/><category term='development'/><category term='lang'/><category term='thinapp'/><category term='network'/><category term='tcl'/><category term='browsers'/><category term='startups'/><title type='text'>Alexander Gromnitsky's Notes</title><subtitle type='html'>People who are afraid to criticism make bad decisions</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>70</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6336511018546017106</id><published>2012-01-27T11:49:00.000+02:00</published><updated>2012-01-27T11:49:33.432+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Rubygems rdoc spec exclude &amp; rdoc task exclude</title><content type='html'>&lt;p&gt;One more or less popular error in gemspec:&lt;/p&gt;&lt;pre class='literal-block'&gt;spec = Gem::Specification.new {|i|
  [...]

  i.rdoc_options &amp;lt;&amp;lt; '-m' &amp;lt;&amp;lt; 'doc/README.rdoc' &amp;lt;&amp;lt; '-x' &amp;lt;&amp;lt; 'lib/**/templates/**/*'
  i.extra_rdoc_files = FileList['doc/*']

  [...]
}&lt;/pre&gt;&lt;p&gt;In this example a pattern after &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-x&lt;/span&gt;&lt;/tt&gt; option is invalid. rdoc internally constructs an &lt;tt class='docutils literal'&gt;Regexp&lt;/tt&gt; object from argument to &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-x&lt;/span&gt;&lt;/tt&gt; option:&lt;/p&gt;&lt;ul class='simple'&gt; &lt;li&gt;If you supply a string &lt;tt class='docutils literal'&gt;'foo'&lt;/tt&gt; it will end up as &lt;tt class='docutils literal'&gt;/foo/&lt;/tt&gt; argument to a &lt;tt class='docutils literal'&gt;Regexp.new&lt;/tt&gt;.&lt;/li&gt; &lt;li&gt;If you have several &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-x&lt;/span&gt;&lt;/tt&gt; options like &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-x&lt;/span&gt; foo &lt;span class='pre'&gt;-x&lt;/span&gt; bar&lt;/tt&gt;, the argument will be &lt;tt class='docutils literal'&gt;/foo|bar/&lt;/tt&gt;.&lt;/li&gt; &lt;/ul&gt;&lt;p&gt;(At first rdoc constructs an array from all &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-x&lt;/span&gt;&lt;/tt&gt; options and then converts it into 1 regexp.)&lt;/p&gt;&lt;p&gt;Now, &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;'lib/**/templates/**/*'&lt;/span&gt;&lt;/tt&gt; is obviously a bogus regexp and rdoc will loudly complain about it during gem installation. &lt;a class='footnote-reference' href='#id2' id='id1'&gt;[1]&lt;/a&gt; How did it appear in the spec in the first place?&lt;/p&gt;&lt;p&gt;A developer just copied a string from &lt;tt class='docutils literal'&gt;RDoc&lt;/tt&gt; task which might look like:&lt;/p&gt;&lt;pre class='literal-block'&gt;RDoc::Task.new('html') do |i|
      i.main = &amp;quot;doc/README.rdoc&amp;quot;
      i.rdoc_files = FileList['doc/*', 'lib/**/*.rb']
      i.rdoc_files.exclude 'lib/**/templates/**/*'
end&lt;/pre&gt;&lt;p&gt;This rake task works as intended: &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;'lib/**/templates/**/*'&lt;/span&gt;&lt;/tt&gt; parameter is a valid one because &lt;tt class='docutils literal'&gt;i.rdoc_files&lt;/tt&gt; is a &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;Rake::FileList&lt;/span&gt;&lt;/tt&gt; object and &lt;tt class='docutils literal'&gt;exclude&lt;/tt&gt; method of that object expects such kind of patterns and doesn't understand regexps.&lt;/p&gt;&lt;p&gt;So, don't mix up those patterns it the spec and in the &lt;tt class='docutils literal'&gt;RDoc&lt;/tt&gt; task itself.&lt;/p&gt;&lt;table class='docutils footnote' frame='void' id='id2' rules='none'&gt; &lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt; &lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id1'&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;The right one would be something like &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;'lib/.+/templates/'&lt;/span&gt;&lt;/tt&gt;.&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6336511018546017106?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6336511018546017106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2012/01/rubygems-rdoc-spec-exclude-rdoc-task.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6336511018546017106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6336511018546017106'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2012/01/rubygems-rdoc-spec-exclude-rdoc-task.html' title='Rubygems rdoc spec exclude &amp; rdoc task exclude'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-846977221369867790</id><published>2011-12-23T18:28:00.000+02:00</published><updated>2011-12-23T18:28:16.271+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Molloy Problem</title><content type='html'>&lt;p&gt;Molloy problem is a quest of figuring out a way to 'consume' 16 stones
from 4 pockets. Each step must take a unique stone, so that all 16
stones will be processed. An example of valid sequences (stones are
numbered from 1 to 16):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
[5, 12, 16, 15, 8, 4, 10, 2, 1, 9, 6, 13, 14, 11, 7, 3]
[16, 8, 1, 15, 13, 9, 2, 5, 11, 7, 10, 14, 4, 3, 6, 12]
&lt;/pre&gt;
&lt;p&gt;Invalid sequences:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
[11, 3, 8, 13, 9, 9, 8, 11, 2, 10, 12, 4, 4, 2, 2, 15]
[4, 7, 2, 6, 5, 7, 5, 16, 13, 8, 1, 16, 14, 9, 11, 2]
&lt;/pre&gt;
&lt;p&gt;Using any type of external memory such as keeping a list of already
'consumed' stones is forbidden.&lt;/p&gt;
&lt;p&gt;Some background. The quest came from 'Molloy' novel by Samuel
Beckett. The scene of Molloy on a seaside is considered as a classic one
in some &lt;span class="html"&gt;&lt;del&gt;quite boring and useless&lt;/del&gt;&lt;/span&gt; art circles. You can
read the English translation of &lt;a class="reference external" href="http://www.samuel-beckett.net/molloy1.html"&gt;the relevant part of the novel&lt;/a&gt; online. Go read, it's
just several pages.&lt;/p&gt;
&lt;p&gt;At the beginning, Molloy divided 16 stones in 4 groups (by the number of
undamaged pockets he had), where each group contained exactly 4 stones:&lt;/p&gt;
&lt;object data="http://gromnitsky.users.sourceforge.net/articles/molloy-problem/p1.svg" type="image/svg+xml"&gt;
http://gromnitsky.users.sourceforge.net/articles/molloy-problem/p1.svg&lt;/object&gt;
&lt;p&gt;While he was sucking a stone from pocket say #1, he was moving 1 stone
from pocket say #2 to pocket #1, then 1 stone from pocket #3 to pocket
#2, then 1 stone from pocket #4 to pocket #3. After finishing with the
stone in his mouth, Molloy would put it to pocket #4 so that all pockets
would contain exactly 4 stones before the next iteration.&lt;/p&gt;
&lt;p&gt;Such arrangement caused a problem for him: there was no guarantee that
every time he took &lt;em&gt;the different&lt;/em&gt; stone:&lt;/p&gt;
&lt;blockquote&gt;
'... by an extraordinary hazard, the 4 stones circulating thus might
always be the same 4. In which case, far from sucking the 16 turn and
turn about, I was really only sucking 4, always the same, turn and
turn about.'&lt;/blockquote&gt;
&lt;p&gt;At this point I thought that the quest can be used as an interview
question.&lt;/p&gt;
&lt;p&gt;It took some time for Molloy to solve the problem, so any decent
non-poser developer can achieve the same result. If the interviewee
behaves arrogant, force him to write the solution in the code, for
example, give him a ready abstract class which he would extend and
override 1 method of reshuffling the stones.&lt;/p&gt;
&lt;p&gt;(The example in Ruby &lt;a class="reference external" href="https://gist.github.com/1514630"&gt;is here&lt;/a&gt;. If
the interviewee still behaves arrogant, ask him why (&amp;amp; if) the story
with abstract class looks foreign in Ruby.)&lt;/p&gt;
&lt;p&gt;Later on Molloy realized that 4 stones in 4 pockets is a red herring
that kept him from the solution. So he redistributes 16 stones in 3
groups by 6, 5, 5 stones correspondingly, leaving 1 pocket empty, and
finally constructs the algorithm:&lt;/p&gt;
&lt;object data="http://gromnitsky.users.sourceforge.net/articles/molloy-problem/p2.svg" type="image/svg+xml"&gt;
http://gromnitsky.users.sourceforge.net/articles/molloy-problem/p2.svg&lt;/object&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;Take a stone from pocket #1, suck it and place in pocket #4.&lt;/li&gt;
&lt;li&gt;Do it until pocket #1 becomes empty.&lt;/li&gt;
&lt;li&gt;Take a stone from pocket #2, suck it and place in pocket #1.&lt;/li&gt;
&lt;li&gt;Do it until pocket #2 becomes empty.&lt;/li&gt;
&lt;li&gt;Take a stone from pocket #3, suck it and place in pocket #2.&lt;/li&gt;
&lt;li&gt;Do it until pocket #3 becomes empty.&lt;/li&gt;
&lt;li&gt;Take a stone from pocket #4, suck it and place in pocket #3.&lt;/li&gt;
&lt;li&gt;Do it until pocket #4 becomes empty.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Which, of course, doesn't guarantee unique sequences but does guarantee
that in every iteration each stone would not be left behind.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-846977221369867790?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/846977221369867790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/12/molloy-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/846977221369867790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/846977221369867790'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/12/molloy-problem.html' title='Molloy Problem'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-636800016189180207</id><published>2011-09-01T04:30:00.002+03:00</published><updated>2011-09-01T04:30:55.801+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>FreeBSD 8.2, open-vm-tools and VMware Workstation</title><content type='html'>&lt;p&gt;(A note for russian-speaking dudes: поцаны, прежде чем писать мне письма
мелким почерком &amp;quot;у меня ни работаит шарные папки&amp;quot; или храбро скачивать
х.з. какую версию порта откуда, откройте для себя 'vmware' тэг в левой
колонке. Я верю что вы можете. На русский этот потс мне переводить лень,
звиняйте панове.)&lt;/p&gt;
&lt;p&gt;A custom port of open-vm-tools-2011.08.21-471295 for FreeBSD 8.2 can be
obtained by typing:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% git clone https://github.com/gromnitsky/open-vm-tools-minimum.git
&lt;/pre&gt;
&lt;p&gt;The port contains only a minimum version of VMware guest tools. It
doesn't include kernel modules, hgfs client and wrappers for vmtoolsd.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Why?&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p class="first"&gt;The 'shared folders' option needs a guest support for vmblock file
system and a hgfs kernel module. If one tries to say&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# mount -t vmhgfs .host:/shared-folder /mnt/hgfs
&lt;/pre&gt;
&lt;p&gt;He may get a kernel panic in FreeBSD 8.2. So, no shared folders
&lt;span class="html"&gt;&lt;del&gt;for Jakucha&lt;/del&gt;&lt;/span&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;vmblock is also required by drag&amp;amp;drop function provided by a
vmusr/libdndcp.so plugin for vmtoolsd. Despite my attempts to repeat
&lt;a class="reference external" href="http://gromnitsky.blogspot.com/2009/05/freebsd-72-and-vmware-workstation.html"&gt;the struggle in 7.2&lt;/a&gt;,
I couldn't achieve the same results with this version of
open-vm-tools. So, no drag&amp;amp;drop and vmblock (fuse or .ko version) is
useless.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;I don't see a point of having external vmxnet driver instead of
working em(4). And vmmemctl is like a furniture in the loft.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;What have we in the so called minimum version?&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Time sync.&lt;/li&gt;
&lt;li&gt;Copy/paste under X.&lt;/li&gt;
&lt;li&gt;VIX support.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The difference from previous versions:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;vmware-user was removed and completely replaced by plugins for
vmtoolsd utility.&lt;/li&gt;
&lt;li&gt;GTK program vmware-toolbox was removed in favor of console version
vmware-toolbox-cmd.&lt;/li&gt;
&lt;li&gt;Unity plugin was excluded. It is too boring to explain why.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Delete all previous installations of open-vm-tools-minumum or
open-vm-tools. &lt;em&gt;This is mandatory&lt;/em&gt;, not optional.&lt;/p&gt;
&lt;p&gt;After gitclonning cd to the &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;open-vm-tools-minumum&lt;/span&gt;&lt;/tt&gt; directory and
decide: do you need X support for your virtual machine or it is just a
console server?  If the second variant is true, type:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# make WITHOUT_X11=1 install clean
&lt;/pre&gt;
&lt;p&gt;otherwise&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# make install clean
&lt;/pre&gt;
&lt;p&gt;Then add to &lt;tt class="docutils literal"&gt;/etc/rc.conf&lt;/tt&gt; line:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
vmware_vmtoolsd_vmsvc_enable=YES
&lt;/pre&gt;
&lt;p&gt;and type:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# /usr/local/etc/rc.d/vmware_vmtoolsd_vmsvc start
&lt;/pre&gt;
&lt;p&gt;OK, now you have time sync and VIX.&lt;/p&gt;
&lt;p&gt;If you've installed full variant with X support add this line to your
~/.xinitrc:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
vmtoolsd -n vmusr &amp;amp;
&lt;/pre&gt;
&lt;p&gt;(Don't miss the ampersand.)&lt;/p&gt;
&lt;p&gt;Now if you start X (if X is already running type previous command in a
xterm) you'll get copy/paste function between host and FreeBSD guest.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;VIX Tests&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The good news is: VIX works with FreeBSD guests and doens't require
those kernel modules that were cutted.&lt;/p&gt;
&lt;p&gt;To test VIX, we will use vmrun program (it comes with modern versions of
Workstation). In Windows hosts it usually sit in &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;C:\Program&lt;/span&gt;
Files\VMware\VMware VIX&lt;/tt&gt; directory.&lt;/p&gt;
&lt;p&gt;Get a list of all running virtual machines:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;gt;vmrun list
Total running VMs: 2
D:\vm\FreeBSD Stable\FreeBSD Stable.vmx
D:\vm\FreeBSD test\FreeBSD test.vmx
&lt;/pre&gt;
&lt;p&gt;Get a list of all running processed in a virtual machine (it requires a
name &amp;amp; a password of a particular user in the guest):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;gt;vmrun -T ws -gu bob -gp asecretpass listProcessesInGuest \
 &amp;quot;D:\vm\FreeBSD test\FreeBSD test.vmx&amp;quot;
Process list: 50
pid=77251, owner=bob, cmd=/usr/local/bin/vmtoolsd -n vmsvc
pid=60007, owner=bob, cmd=/bin/csh
[...]
&lt;/pre&gt;
&lt;p&gt;If vmrun hands for a long time there is a problem with vmtoolsd and its
plugins in the guest. Check if vmtoolsd is running:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% ps -ax | grep vmtoolsd
  823  ??  S      1:02.33 /usr/local/bin/vmtoolsd -n vmsvc
&lt;/pre&gt;
&lt;p&gt;And note the '-n vmsvc' option. Look into &lt;tt class="docutils literal"&gt;/var/log/messages&lt;/tt&gt; file.&lt;/p&gt;
&lt;p&gt;Something more interesting: copy a file from the host to the guest. This
doesn't require any 'shared folders' or hgfs kernel modules. It works
even if a network in the guest is down:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
&amp;gt;vmrun -T ws -gu bob -gp asecretpass CopyFileFromHostToGuest \
      &amp;quot;D:\vm\FreeBSD test\FreeBSD test.vmx&amp;quot; d:\1.jpg &amp;quot;/tmp/1.jpg&amp;quot;

Cool, eh?
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Cooking FreeBSD &amp;amp; Xorg under VMware Workstation 7.1&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;(The text below is for users who are new to configuring FreeBSD under
VMware Workstation.)&lt;/p&gt;
&lt;p&gt;Modern versions of Workstation automatically turn on emulation of Intel
PRO/1000 network card if you choose 'FreeBSD' as an operating system
while creating a new virtual machine. FreeBSD recognizes that device as
em0. If it doesn't, turn off the virtual machine, close Workstation and
insert &lt;tt class="docutils literal"&gt;ethernet0.virtualDev = &amp;quot;e1000&amp;quot;&lt;/tt&gt; line into your .vmx file.&lt;/p&gt;
&lt;p&gt;A long time ago mouse and video drivers were distributed only with a
proprietry version of vmvare-tools. Today (it's like 4 years now) they
are included with xorg and exist in FreeBSD ports collection. Install
x11-drivers/xf86-video-vmware and x11-drivers/xf86-input-vmmouse ports.&lt;/p&gt;
&lt;p&gt;The mouse configuring may be tricky. By default VMware Workstation
emulates your mouse a ps/2 one with 5 buttons, disregarding if it a
usual USB mouse on the host or a touchpad. You can force Workstation to
exclusively grab the HID device (USB mouse) but then it will dissapear
from the host. (VMware guest tools for MS Windows ship a special ps/2
driver which supports 6 &amp;amp; 7 mouse buttons (binded to back &amp;amp; forward in
browsers) but I don't know any for FreeBSD.)&lt;/p&gt;
&lt;p&gt;If you need mouse in syscons &amp;amp; X simultaneously, &lt;em&gt;do not&lt;/em&gt; use moused
option '-3' to emulate middle button for 2-buttons touchpad because
you'll have problems with double click in X.&lt;/p&gt;
&lt;p&gt;Xorg vmmouse driver (12.6.9) supports only 2 options (after &lt;tt class="docutils literal"&gt;Protocol&lt;/tt&gt;
&amp;amp; &lt;tt class="docutils literal"&gt;Device&lt;/tt&gt;): &lt;tt class="docutils literal"&gt;Buttons&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;ZAxisMapping&lt;/tt&gt;. Setting &lt;tt class="docutils literal"&gt;Buttons&lt;/tt&gt;
option to '7' won't bring you working 6 &amp;amp; 7 mouse buttons, though. (xev
just ignores them.)&lt;/p&gt;
&lt;p&gt;To turn on sound, type:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# kldload snd_es137x
&lt;/pre&gt;
&lt;p&gt;and add to &lt;tt class="docutils literal"&gt;/boot/loader.conf&lt;/tt&gt; file:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
snd_es137x_load=&amp;quot;YES&amp;quot;
&lt;/pre&gt;
&lt;p&gt;If your laptop has the screen resolution 1280x800, add to &lt;tt class="docutils literal"&gt;xorg.conf&lt;/tt&gt;
section &lt;tt class="docutils literal"&gt;Monitor&lt;/tt&gt; the line:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
Modeline &amp;quot;1280x800&amp;quot; 70.00 1280 1312 1344 1376 800 801 804 850
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-636800016189180207?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/636800016189180207/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/09/freebsd-82-open-vm-tools-and-vmware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/636800016189180207'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/636800016189180207'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/09/freebsd-82-open-vm-tools-and-vmware.html' title='FreeBSD 8.2, open-vm-tools and VMware Workstation'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1978939545823513813</id><published>2011-08-30T03:43:00.001+03:00</published><updated>2011-08-30T03:43:38.250+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>FreeBSD 9 newfs block size and fragment size</title><content type='html'>&lt;p&gt;In FreeBSD 9.0 beta1 2 new defaults for newfs(8) were introduced:&lt;/p&gt;&lt;pre class='literal-block'&gt;
#define DFL_FRAGSIZE    4096
#define DFL_BLKSIZE     32768&lt;/pre&gt;&lt;p&gt;Previous values (FreeBSD &amp;#8804; 8.2) were 2 times smaller. This means that by default new UFS filesystems will have 2 times less inodes.&lt;/p&gt;&lt;p&gt;This can be an unpleasant surprise if you want to quick install FreeBSD into a virtual machine with a small virtual hdd. For example, a quite modest setup with 4GB virtual hdd may bring you a &lt;tt class='docutils literal'&gt;/usr&lt;/tt&gt; partition ~ 2.7GB. How many inodes is that?&lt;/p&gt;&lt;p&gt;The rough formula is:&lt;/p&gt;&lt;blockquote&gt; 1024&lt;sup&gt;2&lt;/sup&gt;&lt;cite&gt;s&lt;/cite&gt; / 4&lt;cite&gt;f&lt;/cite&gt;&lt;/blockquote&gt;&lt;p&gt;where &lt;cite&gt;s&lt;/cite&gt; is a partition size in MB and &lt;cite&gt;f&lt;/cite&gt; is a magic number called &lt;cite&gt;fragment size&lt;/cite&gt;. The new default is 4096 bytes (controlled by &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-f&lt;/span&gt;&lt;/tt&gt; newfs(8) option).&lt;/p&gt;&lt;p&gt;So, for our example, the &lt;tt class='docutils literal'&gt;/usr&lt;/tt&gt; partition will contain max 172,800 inodes. &lt;a class='footnote-reference' href='#id2' id='id1'&gt;[1]&lt;/a&gt; Isn't that enough? (And why should I care?)&lt;/p&gt;&lt;p&gt;For a partitions larger than, say 6GB, you'll rarely ever bother with the word inode. But for smaller ones &lt;cite&gt;and&lt;/cite&gt; such as &lt;tt class='docutils literal'&gt;/usr&lt;/tt&gt; which usually holds full ports tree directory, you can put yourself into a strange situation when after a fresh FreeBSD install your &lt;tt class='docutils literal'&gt;/usr&lt;/tt&gt; has ~ plenty of a free space but almost no free inodes.&lt;/p&gt;&lt;p&gt;Returning to our 2.7GB partition example, just after the installation and csup'ing of the ports tree, the number of files is:&lt;/p&gt;&lt;pre class='literal-block'&gt;
# find /usr | wc -l
163114 &lt;/pre&gt;&lt;p&gt;Or 94.4% of max possible files.&lt;/p&gt;&lt;p&gt;To make things worse, a new installer in FreeBSD 9.0 beta1 doesn't allow you to specify the &lt;cite&gt;fragment size&lt;/cite&gt; &amp;amp; &lt;cite&gt;block size&lt;/cite&gt; (&lt;cite&gt;b&lt;/cite&gt;) values at all. The last one is important too, because the condition &lt;cite&gt;b&lt;/cite&gt;/8 &amp;#8804; &lt;cite&gt;f&lt;/cite&gt; &amp;#8804; b must be satisfied.&lt;/p&gt;&lt;table class='docutils footnote' frame='void' id='id2' rules='none'&gt; &lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt; &lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id1'&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;After that number you'll get a dismal message from the kernel: &lt;tt class='docutils literal'&gt;/usr: create/symlink failed, no inodes free&lt;/tt&gt;.&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1978939545823513813?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1978939545823513813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/08/freebsd-9-newfs-block-size-and-fragment.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1978939545823513813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1978939545823513813'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/08/freebsd-9-newfs-block-size-and-fragment.html' title='FreeBSD 9 newfs block size and fragment size'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7799639540076178065</id><published>2011-08-08T16:44:00.000+03:00</published><updated>2011-08-08T16:44:22.468+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Emacs, xkb &amp; xxkb</title><content type='html'>&lt;p&gt;The song that never ends.&lt;/p&gt;&lt;p&gt;Every kid has its own scheme. Through the years I've picked out mine.&lt;/p&gt;&lt;p&gt;The prerequisites:&lt;/p&gt;&lt;ol class='arabic simple'&gt; &lt;li&gt;You have tuned up xkb and know what key is your X layout switcher. (In the past I've used left Ctrl to toggle en/ru, but recently switched to capslock.)&lt;/li&gt; &lt;li&gt;You're using xxkb as your X Window indicator of the current layout. Not from Gnome, not from KDE, etc.&lt;/li&gt; &lt;/ol&gt;&lt;p&gt;We want: use capslock for emacs &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;toggle-input-method&lt;/span&gt;&lt;/tt&gt; too. We don't want to modify xorg system files or hack part of emacs written in C.&lt;/p&gt;&lt;p&gt;The problem is that emacs (under xorg-7.5.1, for example) ignores &lt;tt class='docutils literal'&gt;ISO_Next_Group&lt;/tt&gt; completely. You cannot bind anything to the key that emits that event.&lt;/p&gt;&lt;p&gt;But there is &lt;a class='reference external' href='http://kurilka.livejournal.com/321514.html?style=mine'&gt;a clever trick I've googled&lt;/a&gt;.  You translate &lt;tt class='docutils literal'&gt;ISO_Next_Group&lt;/tt&gt; to some unused key in emacs, for example Super-A. (Super == left win key on my machine.):&lt;/p&gt;&lt;pre class='literal-block'&gt; (setf (gethash #xfe08 x-keysym-table) (aref (kbd &amp;quot;s-a&amp;quot;) 0)) &lt;/pre&gt;&lt;p&gt;&lt;tt class='docutils literal'&gt;#xfe08&lt;/tt&gt; is &lt;tt class='docutils literal'&gt;ISO_Next_Group&lt;/tt&gt; code. Then bind Super-A to toggle emacs keyboard layout:&lt;/p&gt;&lt;pre class='literal-block'&gt; (global-set-key (kbd &amp;quot;s-a&amp;quot;) '(lambda () (toggle-input-method))) &lt;/pre&gt;&lt;p&gt;OK. Next we need somehow disable system X switcher for all emacs windows. For xxkb this is done by adding this to its configuration file:&lt;/p&gt;&lt;pre class='literal-block'&gt; XXkb.app_list.wm_class_class.alt_group1: Emacs &lt;/pre&gt;&lt;p&gt;And that's all.&lt;/p&gt;&lt;p&gt;As a bonus, I've added another very handy indicator of the current input method in emacs: cursor color.&lt;/p&gt;&lt;pre class='literal-block'&gt;;; default cursor color for all X frames
(add-to-list 'default-frame-alist '(cursor-color . "black"))

;; toggle the input method and the cursor color in one place
(global-set-key (kbd "s-a") '(lambda ()
                             (interactive)
                             (toggle-input-method)
                             (if window-system
                                 (set-cursor-color
                                  (if current-input-method
                                      "red3"
                                    "black")))
                             ))
&lt;/pre&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7799639540076178065?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7799639540076178065/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/08/emacs-xkb-xxkb.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7799639540076178065'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7799639540076178065'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/08/emacs-xkb-xxkb.html' title='Emacs, xkb &amp; xxkb'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1145109144873663620</id><published>2011-08-05T13:47:00.000+03:00</published><updated>2011-08-05T13:47:35.036+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Why pkg_version or portmaster -L Are Slow</title><content type='html'>&lt;p&gt;Long time no see.&lt;/p&gt;&lt;p&gt;If you ever wondered why (in FreeBSD) any program that prints installed packages vs. available updates from the Ports is so &lt;em&gt;freaking slow&lt;/em&gt;, then I have an answer for you and a maybe even a solution.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;tl;dr:&lt;/strong&gt; install &lt;a class='reference external' href='http://rubygems.org/gems/pkg_noisrev'&gt;pkg_noisrev&lt;/a&gt; gem. &lt;a class='footnote-reference' href='#id3' id='id1'&gt;[1]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Why it is So Freaking Slow?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Just grabbing the installed list is simple: you read &lt;tt class='docutils literal'&gt;/var/db/pkg&lt;/tt&gt; directory and you are done. The interesting part is how to check this data with the Ports tree.&lt;/p&gt;&lt;p&gt;Every correctly installed package records its &lt;em&gt;origin&lt;/em&gt; in &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;/var/db/pkg/package-name-1.2.3/+CONTENTS&lt;/span&gt;&lt;/tt&gt; file. An origin is a relative path to the &lt;tt class='docutils literal'&gt;/usr/ports&lt;/tt&gt; directory, for example for zip-3.0 package, the origin is &lt;tt class='docutils literal'&gt;archivers/zip&lt;/tt&gt;.&lt;/p&gt;&lt;p&gt;Having that we can theoretically read corresponding Makefile (&lt;tt class='docutils literal'&gt;/usr/ports/archivers/zip/Makefile&lt;/tt&gt; in our example) and compute the version number of the particular port. The problem is that 'the version' is a string that can containg 3 components (3 different Makefile varibles): port version, revision and epoch. Somethimes there is no port version but exists so called vedor version. Sometimes Makefile doesn't containt any version information at all but include (via a bsd make &lt;tt class='docutils literal'&gt;.include&lt;/tt&gt; directive) another Makefile that can include another and so on.&lt;/p&gt;&lt;p&gt;So, to extract that information you need either:&lt;/p&gt;&lt;ul class='simple'&gt;&lt;li&gt;Properly parse Makefile and recursively expand all its variables, read all includes, etc, i.e. write your own mini &lt;tt class='docutils literal'&gt;make&lt;/tt&gt; utility.&lt;/li&gt;
&lt;li&gt;Run &amp;quot;&lt;tt class='docutils literal'&gt;make &lt;span class='pre'&gt;-V&lt;/span&gt; PKGVERSION&lt;/tt&gt;&amp;quot; command in the port directory.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;You can guess what path was chosen by authors of the system &lt;tt class='docutils literal'&gt;pkg_version&lt;/tt&gt; program or famous &lt;tt class='docutils literal'&gt;portmaster&lt;/tt&gt; manager.&lt;/p&gt;&lt;p&gt;Think: run &lt;tt class='docutils literal'&gt;make&lt;/tt&gt; for &lt;em&gt;every&lt;/em&gt; package name; if you have 2,000 packages installed, &lt;tt class='docutils literal'&gt;make&lt;/tt&gt; will run exactly 2,000 times.&lt;/p&gt;&lt;p&gt;To make thing worse, this is not the end of The Problem. Next quiz after obtaining the version number is how to &lt;em&gt;compare&lt;/em&gt; 2 versions: the installed one and one from the Ports tree. They are not just simple numbers as in lovery rubygems. For example, what is newer: &lt;tt class='docutils literal'&gt;4.13a&lt;/tt&gt; or &lt;tt class='docutils literal'&gt;4.13.20110529_1&lt;/tt&gt;?  Is there is a difference between &lt;tt class='docutils literal'&gt;0.3.9.p1.20080208_7&lt;/tt&gt; and &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;0.3.9-pre1.20080208_7&lt;/span&gt;&lt;/tt&gt;?&lt;/p&gt;&lt;p&gt;The system &lt;tt class='docutils literal'&gt;pkg_version&lt;/tt&gt; utility contains a tedious comparation aloritm (&lt;tt class='docutils literal'&gt;/usr/src/usr.sbin/pkg_install/lib/version.c&lt;/tt&gt;), reproduction of which is very boring. &lt;a class='footnote-reference' href='#id4' id='id2'&gt;[2]&lt;/a&gt; So boring, that portmaster just calls &lt;tt class='docutils literal'&gt;&amp;quot;pkg_version &lt;span class='pre'&gt;-t&lt;/span&gt; v1 v2&amp;quot;&lt;/tt&gt; to compare a pair of version number strings. Yes, if you have 2,000 packages installed, portmaster will execute &lt;tt class='docutils literal'&gt;make&lt;/tt&gt; program 2,000 times + 2,000 times &lt;tt class='docutils literal'&gt;pkg_version&lt;/tt&gt; program.&lt;/p&gt;&lt;p&gt;The last bit of slowness of such applications as &lt;tt class='docutils literal'&gt;pkg_version&lt;/tt&gt; or &lt;tt class='docutils literal'&gt;portmaster&lt;/tt&gt; is an iterative model. They read the whole packages list and process items one after another with 0 attempts to do things in parallel.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Can we do all that faster?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Yes, we can. &lt;a class='reference external' href='http://github.com/gromnitsky/pkg_noisrev'&gt;A simple pkg_noisrev utility&lt;/a&gt; does that 4-5 times faster.&lt;/p&gt;&lt;p&gt;It tries to do a primitive parsing of Makefiles and if that fails &lt;em&gt;only then&lt;/em&gt; executes &lt;tt class='docutils literal'&gt;make&lt;/tt&gt;. It ships with the &lt;em&gt;comparator&lt;/em&gt; extracted from &lt;tt class='docutils literal'&gt;pkg_version&lt;/tt&gt; as a shared library that can be loaded once via Ruby &lt;tt class='docutils literal'&gt;dllopen&lt;/tt&gt; method. It creates several threads and does things in parallel.&lt;/p&gt;&lt;p&gt;So, if you were running &amp;quot;&lt;tt class='docutils literal'&gt;portmaster &lt;span class='pre'&gt;-L&lt;/span&gt;&lt;/tt&gt;&amp;quot; in the past, run &amp;quot;&lt;tt class='docutils literal'&gt;pkg_noisrev &lt;span class='pre'&gt;--likeportmaster&lt;/span&gt;&lt;/tt&gt;&amp;quot; now.&lt;/p&gt;&lt;table class='docutils footnote' frame='void' id='id3' rules='none'&gt;&lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt;
&lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id1'&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;It requires Ruby 1.9.2.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;table class='docutils footnote' frame='void' id='id4' rules='none'&gt;&lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt;
&lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id2'&gt;[2]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;And, I dare to say, unsafe, because &lt;tt class='docutils literal'&gt;pkg_version&lt;/tt&gt; doesn't have any tests you can reuse, so you can easily come up with some nasty bugs in your implementation.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1145109144873663620?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1145109144873663620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/08/why-pkgversion-or-portmaster-l-are-slow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1145109144873663620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1145109144873663620'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/08/why-pkgversion-or-portmaster-l-are-slow.html' title='Why pkg_version or portmaster -L Are Slow'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-5344346331876922062</id><published>2011-05-26T16:29:00.000+03:00</published><updated>2011-05-26T16:29:42.861+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><title type='text'>The Best of edw519</title><content type='html'>&lt;p&gt;&lt;a class='reference external' href='http://edweissman.com/53640595'&gt;The famous book&lt;/a&gt; from one HN user can be read in 1-2 days (you can safely skip first 2 chapters.)&lt;/p&gt;&lt;p&gt;I've counted the number of interesting (to me) posts in the book: 57 of 256, or ~22.27%. Not bad.&lt;/p&gt;&lt;p&gt;The most hilarious chapter was #9.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-5344346331876922062?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/5344346331876922062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/best-of-edw519.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5344346331876922062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5344346331876922062'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/best-of-edw519.html' title='The Best of edw519'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6689544671351567655</id><published>2011-05-13T23:43:00.001+03:00</published><updated>2011-05-13T23:47:04.708+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Ruby Require Time</title><content type='html'>&lt;p&gt;Last week in ruby-core mail list were circulating some horror charts of
Ruby 'require' time for many .rb files. The most relevant &lt;a class="reference external" href="https://gist.github.com/c8d0d422a9203e1fe492"&gt;is this one&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I can confirm the rather unpleasant statistics. I took the benchmark
snippet from the link above and rewrote it into Rakefile. All it does is
a creation of 18,000 empty files, and after that forces Ruby to 'require' them.&lt;/p&gt;
&lt;p&gt;To run this benchmark on your machine, &lt;a class="reference external" href="https://gist.github.com/971270"&gt;grab the source&lt;/a&gt;, place it into a file named
&lt;tt class="docutils literal"&gt;Rakefile&lt;/tt&gt; in a temporally directory, and type &lt;tt class="docutils literal"&gt;rake benchmark&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;This is what I got in FreeBSD 8.2 under VMware Workstation 7.1.4:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
$ rake clean benchmark # in RVM
(in /opt/samba/tmp/b)
rm -rf rec-files
mkdir -p rec-files
ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-freebsd8.2]
              user     system      total        real
500 requires  0.171875   0.171875   0.343750 (  0.372954)
1000 requires  0.460938   0.453125   0.914062 (  1.006835)
1500 requires  1.039062   0.539062   1.578125 (  1.703206)
2000 requires  1.382812   0.632812   2.015625 (  2.186040)
2500 requires  2.953125   0.804688   3.757812 (  4.125621)
3000 requires  5.265625   0.625000   5.890625 (  6.766446)
3500 requires  7.609375   1.062500   8.671875 ( 10.501926)
4000 requires 11.039062   0.671875  11.710938 ( 12.816059)
&lt;/pre&gt;
&lt;p&gt;versus scary:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% rake clean benchmark
(in /opt/samba/tmp/b)
rm -rf rec-files
mkdir -p rec-files
ruby 1.9.2p0 (2010-08-18 revision 29036) [i386-freebsd8]
              user     system      total        real
500 requires  0.156250   0.195312   0.351562 (  0.391295)
1000 requires  0.953125   0.390625   1.343750 (  1.459771)
1500 requires  3.171875   0.773438   3.945312 (  4.448573)
2000 requires  7.132812   1.390625   8.523438 ( 10.009462)
2500 requires 13.554688   1.859375  15.414062 ( 17.039073)
3000 requires 23.382812   2.976562  26.359375 ( 31.123249)
3500 requires 36.859375   3.734375  40.593750 ( 44.460490)
4000 requires 54.843750   5.453125  60.296875 ( 66.162403)
&lt;/pre&gt;
&lt;img alt="https://lh6.googleusercontent.com/_W-OHaMHyRAE/Tc2UUY8j7nI/AAAAAAAAARQ/GY2PZJGGQz4/s800/ruby-require-stat.png" src="https://lh6.googleusercontent.com/_W-OHaMHyRAE/Tc2UUY8j7nI/AAAAAAAAARQ/GY2PZJGGQz4/s800/ruby-require-stat.png" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6689544671351567655?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6689544671351567655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/ruby-require-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6689544671351567655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6689544671351567655'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/ruby-require-time.html' title='Ruby Require Time'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh6.googleusercontent.com/_W-OHaMHyRAE/Tc2UUY8j7nI/AAAAAAAAARQ/GY2PZJGGQz4/s72-c/ruby-require-stat.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6256548738178662558</id><published>2011-05-13T22:56:00.000+03:00</published><updated>2011-05-13T22:56:37.865+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Ruby Rogues</title><content type='html'>&lt;p&gt;In case you didn't know, there is a brand new &lt;a class='reference external' href='http://rubyrogues.com/'&gt;podcast about Ruby&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Its main difference is a nice panel discussion as opposed to a standard format with several &lt;span class='html'&gt;&lt;del&gt;boring&lt;/del&gt;&lt;/span&gt; hosts and a guest.&lt;/p&gt;&lt;p&gt;Unfortunately, Aaron Patterson suddenly disappeared in 2-d episode. I hope they will bring him back.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6256548738178662558?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6256548738178662558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/ruby-rogues.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6256548738178662558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6256548738178662558'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/ruby-rogues.html' title='Ruby Rogues'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7626320457580978570</id><published>2011-05-04T07:55:00.002+03:00</published><updated>2011-05-04T17:02:05.946+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>How to be a StackOverflow Sucker</title><content type='html'>&lt;p&gt;I.e. how to be a 'senior' SO user (who joined after the beta in the fall of '08) and still up to this day to have &amp;lt; 1K rep.&lt;/p&gt;&lt;p&gt;The ultimate reference.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #0.&lt;/strong&gt; Newer read the front page.&lt;/p&gt;&lt;p&gt;What on earth can be interesting there? Just a bunch of windoze C-fucking-sharp .blah useless crap. Or boring Java. Real programmers do not engage in that.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #1.&lt;/strong&gt; Subscribe in your RSS reader to 1 tag--you favorite language, like you know, Cobol or Tcl or PL/I and stick to it.&lt;/p&gt;&lt;p&gt;Because of a doleful situation with people's IQ, there won't be much questions marked with this tag and each question will have max 16 views in 10 years.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #2.&lt;/strong&gt; Look for questions asked by a sentient being with reputation equal to 1.&lt;/p&gt;&lt;p&gt;Chances that that sentient being has any idea how SO works are slightly less that 0%.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #3.&lt;/strong&gt; Never try to clarify the question by posting a comment.&lt;/p&gt;&lt;p&gt;Obviously, if the question is bad or unclear it is better to answer anyway.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #4.&lt;/strong&gt; Look for questions asked by a sentient being which has asked over 9000 questions already, has 15 rep. and 0% rate of accepted answers.&lt;/p&gt;&lt;p&gt;See the desc. of step #2.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #5.&lt;/strong&gt; Search for a questions asked a year ago.&lt;/p&gt;&lt;p&gt;Don't forget to look into a user's profile--if 6 months ago is the last time the user was on the site--he is your client. Immediately begin to write the answer.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #6.&lt;/strong&gt; Give a free advice not directly related to the question.&lt;/p&gt;&lt;p&gt;Everybody loves free advices. Especially the unbidden ones. For example, if the user asks for a Ruby gem doing X, tell him that Ruby is so 2009 and all cool kids are using Scala nowadays.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #7.&lt;/strong&gt; Search for an old popular question with 32768 answers.&lt;/p&gt;&lt;p&gt;Carefully add your 32769. Don't waste your time by reading previous 32768.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #9.&lt;/strong&gt; Complain in your cozy blog that English is not your mother tongue language and you just cannot compete with those crazy students on SO.&lt;/p&gt;&lt;p&gt;Everybody sane knows that English is not the only one language in the world and it is better in 2011 to write about programming in Russian.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #10.&lt;/strong&gt; Post questions with a schema of all 512 tables of your database.&lt;/p&gt;&lt;p&gt;Asking how to refactor them helps too.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #11.&lt;/strong&gt; Ignore markdown.&lt;/p&gt;&lt;p&gt;Write a wall of text in the answer. Combine a code snippet into a 1 long line.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Step #12.&lt;/strong&gt; Write a harrowing story about SO (like this one), instead of answering SO questions.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7626320457580978570?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7626320457580978570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/how-to-be-stackoverflow-sucker.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7626320457580978570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7626320457580978570'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/05/how-to-be-stackoverflow-sucker.html' title='How to be a StackOverflow Sucker'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-2554835478214005747</id><published>2011-04-30T22:55:00.002+03:00</published><updated>2011-04-30T23:34:46.883+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>From Sinatra to Rails</title><content type='html'>&lt;p&gt;... and from Sequel to ActiveRecord.&lt;/p&gt;&lt;p&gt;I don't know why but Rails 3.1 beta reminds me a Heffalump. Create a new project, uncomment in &lt;tt class='docutils literal'&gt;Gemfile&lt;/tt&gt; 'edge Rails' lines and type &lt;tt class='docutils literal'&gt;bundle install &lt;span class='pre'&gt;--path&lt;/span&gt; vendor&lt;/tt&gt;. And then type:&lt;/p&gt;&lt;pre class='literal-block'&gt;$ bundle list|grep '\* '|wc -l
   39
$ bundle list
Gems included by the bundle:
  * actionmailer (3.1.0.beta)
  * actionpack (3.1.0.beta)
  * activemodel (3.1.0.beta)
  * activerecord (3.1.0.beta)
  * activeresource (3.1.0.beta)
  * activesupport (3.1.0.beta)
  * ansi (1.2.3)
  * arel (2.0.7.beta.20110429111451 6330a18)
  * bcrypt-ruby (2.1.4)
  * builder (3.0.0)
  * bundler (1.0.12)
  * coffee-script (2.2.0)
  * coffee-script-source (1.0.1)
  * erubis (2.7.0)
  * execjs (0.3.0)
  * hike (0.7.1)
  * i18n (0.6.0beta1)
  * json (1.5.1)
  * mail (2.3.0)
  * mime-types (1.16)
  * multi_json (1.0.0)
  * polyglot (0.3.1)
  * rack (1.2.1 37d2b2f)
  * rack-cache (1.0.1)
  * rack-mount (0.7.2)
  * rack-ssl (1.3.2)
  * rack-test (0.5.7)
  * rails (3.1.0.beta cc35d5c)
  * railties (3.1.0.beta)
  * rake (0.8.7)
  * sass (3.1.1)
  * sprockets (2.0.0 ebd683e)
  * sqlite3 (1.3.3)
  * thor (0.14.6)
  * tilt (1.3)
  * treetop (1.4.9)
  * turn (0.8.2)
  * tzinfo (0.3.27)
  * uglifier (0.5.1)
&lt;/pre&gt;&lt;p&gt;'We are not amused.'&lt;/p&gt;&lt;img alt='https://lh4.googleusercontent.com/_W-OHaMHyRAE/TbxkEsh1cbI/AAAAAAAAAQM/0om-5GfLtsU/s800/rails-and-sinatra.jpg' src='https://lh4.googleusercontent.com/_W-OHaMHyRAE/TbxkEsh1cbI/AAAAAAAAAQM/0om-5GfLtsU/s800/rails-and-sinatra.jpg'/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-2554835478214005747?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2554835478214005747/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/from-sinatra-to-rails.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2554835478214005747'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2554835478214005747'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/from-sinatra-to-rails.html' title='From Sinatra to Rails'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh4.googleusercontent.com/_W-OHaMHyRAE/TbxkEsh1cbI/AAAAAAAAAQM/0om-5GfLtsU/s72-c/rails-and-sinatra.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4963346392930986371</id><published>2011-04-20T22:41:00.000+03:00</published><updated>2011-04-20T22:41:37.749+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Rubygems and FreeBSD</title><content type='html'>&lt;p&gt;The newest rubygems 1.7.2 introduced the remarkable behaviour with native FreeBSD ruby 1.9.2: rubygems generates a spec with invalid date, and this date is completely valid for rubygems 1.7.2 on FreeBSD.&lt;/p&gt;&lt;p&gt;But, when such gem is installed into a Linux machine (or even into a FreeBSD machine with &lt;em&gt;ruby in RVM&lt;/em&gt;), a user would see after the installation:&lt;/p&gt;&lt;pre class='literal-block'&gt;Invalid gemspec in [/home/alex/.rvm/gems/ruby-1.9.2-p180/\
specifications/NAME-x.y.z.gemspec]: \
invalid date format in specification: "2011-04-20 00:00:00.000000000Z"
&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;And such 'broken' gem is impossible to remove&lt;/strong&gt; unless you manually delete files in &lt;tt class='docutils literal'&gt;`gem env | grep &lt;span class='pre'&gt;-A2&lt;/span&gt; PATHS`&lt;/tt&gt; directories.&lt;/p&gt;&lt;p&gt;So, the annoying but the only one reliable method of building &lt;em&gt;working&lt;/em&gt; gems is:&lt;/p&gt;&lt;ul class='simple'&gt;&lt;li&gt;Install RVM with ruby 1.9.2 into Fedora.&lt;/li&gt;
&lt;li&gt;Clone your source repository from FreeBSD machine in Fedora.&lt;/li&gt;
&lt;li&gt;Build gem and push it to rubygems.org &lt;em&gt;from that Fedora&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4963346392930986371?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4963346392930986371/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/rubygems-and-freebsd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4963346392930986371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4963346392930986371'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/rubygems-and-freebsd.html' title='Rubygems and FreeBSD'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1744426522616271131</id><published>2011-04-18T05:14:00.001+03:00</published><updated>2011-04-18T05:19:08.565+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>Lightweight Markup Language &amp; Roff</title><content type='html'>&lt;p&gt;I was writing a small crappy OPML parser for &lt;a class='reference external' href='http://uraniacast.sourceforge.net/'&gt;uraniacast&lt;/a&gt; and by getting towards the end, I fell in a mood of reminding myself to write a manpage for it.&lt;/p&gt;&lt;p&gt;In the past, every time when I had to do that, I did what everyone did 20 years ago: typed &lt;tt class='docutils literal'&gt;man mdoc&lt;/tt&gt;. The day before yesterday I looked at the calendar and realized that it was 2011. &amp;quot;Indeed&amp;quot;, I said to myself, &amp;quot;you're a fool. What for such heroism? There are probably a plenty of LMLs on the internetz that can magically convert their input to roff. Right?&amp;quot;&lt;/p&gt;&lt;p&gt;Probably.&lt;/p&gt;&lt;p&gt;So I typed &lt;tt class='docutils literal'&gt;gem install ronn&lt;/tt&gt; and started to fill the file that was intended to become the manpage.&lt;/p&gt;&lt;p&gt;Quite promptly, I noticed an inconvenience: in any software project no matter how small there are always some parts of the documentation that must be (a) in several files (b) equal to each other (c) up to date. A version number, for example. And you want that that parts came from 1 source to be inserted into n files every time when something like &lt;tt class='docutils literal'&gt;make release&lt;/tt&gt; is happening.&lt;/p&gt;&lt;p&gt;There is 0 support for that in ronn. You can't suddenly write&lt;/p&gt;&lt;pre class='literal-block'&gt;&amp;lt;%= IO.read('../src/lib/uraniacast.tcl').
       match(/variable ver &amp;quot;(.+)&amp;quot;/)[1] %&amp;gt; &lt;/pre&gt;&lt;p&gt;right in the middle of document. All ronn does is producing roff.&lt;/p&gt;&lt;p&gt;&amp;quot;Fine&amp;quot;, I said, &amp;quot;Let's bring in erb&amp;quot;.&lt;/p&gt;&lt;p&gt;Now, we have 1 source file &lt;tt class='docutils literal'&gt;manpage.erb&lt;/tt&gt; which must be transformed at least twice to become an accomplished object. This is like a butterfly formation &lt;a class='footnote-reference' href='#id2' id='id1'&gt;[1]&lt;/a&gt;: starting with a larva (erb file), maturing as a pupa (markdown), releasing into an imago (roff).&lt;/p&gt;&lt;p&gt;So I dismissed that and start looking for another LML. &amp;quot;Maybe&amp;quot;, I thought, &amp;quot;Maybe over there exists a combined version of the LML + a parody on a small macro language&amp;quot;.&lt;/p&gt;&lt;p&gt;After spending some time wandering around another markdown implementations, I landed on asciidoc planet. A vain attempt.&lt;/p&gt;&lt;p&gt;It drew my attention because of (a) so called replacements (b) so called attributes. I thought that with a2x utility I could do it: define some 'replacements' in a configuration file and slip them into a2x. Sure enough, a2x doesn't give a damn about 'replacements' or 'attributes' if they occur in a literal block. Fuuuuuuck.&lt;/p&gt;&lt;p&gt;&amp;quot;Fine&amp;quot;, I said, &amp;quot;Let's bring in m4&amp;quot;.&lt;/p&gt;&lt;p&gt;Why dear g-d, why my every journey ends up with m4? I hate m4 &amp;amp; I cannot live without it. This is pathetic.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Once really addicted, users pursue writing of sophisticated m4 applications even to solve simple problems, devoting more time debugging their m4 scripts than doing real work.&lt;/p&gt;&lt;p class='attribution'&gt;&amp;mdash;from GNU m4 manual.&lt;/p&gt;&lt;/blockquote&gt;&lt;table class='docutils footnote' frame='void' id='id2' rules='none'&gt;&lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt;
&lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id1'&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Technically, the first step is an egg.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1744426522616271131?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1744426522616271131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/lightweight-markup-language-roff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1744426522616271131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1744426522616271131'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/lightweight-markup-language-roff.html' title='Lightweight Markup Language &amp; Roff'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-2385681638696475034</id><published>2011-04-07T16:17:00.000+03:00</published><updated>2011-04-07T16:17:19.906+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><title type='text'>Broken Printing in Internet Explorer 9</title><content type='html'>&lt;p&gt;Уже думал у меня принтер навернулся, но все оказалось гораздо хуже.&lt;/p&gt;&lt;p&gt;Единственное применение IE, какое я за долгие годы нашел--генерация postscript для дальнейшего разбития .ps файла так, чтобы выходила двухсторонняя печать на принтере, который умеет только с 1 стороны. Разбитье происходит скриптиком на FreeBSD, но это не важно.&lt;/p&gt;&lt;p&gt;Важно то, что IE генерировал самые красивые страницы, на 2-м месте сидит Opera, потом Firefox, потом все остальное.&lt;/p&gt;&lt;p&gt;И тут на днях я что-то печатал с infoq, а принтер, отпечатав половину--затих и остановился. Что я только блин не делал. Тряс картридж, как шаман? Тряс. Выключал/включал принтер, как бухгалтерша? Включал/выключал. Конвертировал .ps в .pdf и пробовал печатать из Adobe Reader, как идиот? Конвертировал и пробовал. Нихера.&lt;/p&gt;&lt;p&gt;И только случайно проскролив в Reader'е до страницы, на которой заминка, обнаружилось, как:&lt;/p&gt;&lt;ol class='arabic simple'&gt;&lt;li&gt;Reader ругается на отсутствие шрифта. Название шрифта самое неудобоваримое: какой-то случайный набор из &lt;tt class='docutils literal'&gt;[:alnum:]&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;На той &amp;quot;плохой&amp;quot; странице в некоторых словах &lt;tt class='docutils literal'&gt;о сутст у т&lt;/tt&gt; буквы.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&amp;quot;Ага&amp;quot;, подумал я. &amp;quot;Вот вам бабушка и IE 9.&amp;quot;&lt;/p&gt;&lt;p&gt;Пустив заранее от-thinapp'ленный IE 8 и сгенерировав .ps файл оттуда, выяснилось, что:&lt;/p&gt;&lt;ol class='arabic simple'&gt;&lt;li&gt;8-й генерирует нормальный postscript со всеми embedded шрифтами, как и раньше.&lt;/li&gt;
&lt;li&gt;Ренерируемый файл от IE 8 раза в 3 меньше чем от IE 9.&lt;/li&gt;
&lt;li&gt;Распечатать &amp;quot;плохой&amp;quot; вариант от 9-го можно только прогнав его (файл) через ps2ps. И такой от-distiller'ный файл принтер хоть и печатает, но задыхается--.ps файл получается каких-то совсем слонопотамовых размеров.&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Короче говоря, сломали печать в IE 9, вот об чем я хотел рассказать.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-2385681638696475034?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2385681638696475034/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/broken-printing-in-internet-explorer-9.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2385681638696475034'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2385681638696475034'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/04/broken-printing-in-internet-explorer-9.html' title='Broken Printing in Internet Explorer 9'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4734779859938782151</id><published>2011-03-19T03:19:00.000+02:00</published><updated>2011-03-19T03:19:46.217+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Серенькие будни Sequel</title><content type='html'>&lt;p&gt;Если не смотреть на sql, который генерируют &lt;a class='reference external' href='http://en.wikipedia.org/wiki/Object-relational_mapping'&gt;ORM&lt;/a&gt;, можно чувствовать себя хорошо. Если посмотреть на sql, который генерирует ORM, можно почувствовать себя очень хорошо, из-за того что не нужно получаемый sql ни набирать руками ни не дай б-г читать глазами.&lt;/p&gt;&lt;p&gt;Положим, у нас есть 2 отношения &lt;a class='footnote-reference' href='#id2' id='id1'&gt;[1]&lt;/a&gt;: articles и tags. Обе модели &lt;em&gt;которых&lt;/em&gt;, связанны как many-to-many. Отношения самые примитивные:&lt;/p&gt;&lt;pre class='literal-block'&gt;create_table(:articles) do
  primary_key :id
  String :title, null: false
  DateTime :updated, null: false
end

create_table(:tags) do
  primary_key :id
  String :name, null: false
end

create_table(:articles_tags) do
  primary_key :id
  foreign_key :tag_id, :tags
  foreign_key :article_id, :articles
end&lt;/pre&gt;&lt;p&gt;Задачка: поискать в tags.name строчечьку foo и вывести связанные articles в обратном порядке. Для Sequel это выглядит так:&lt;/p&gt;&lt;pre class='literal-block'&gt;Article.order(:updated.desc).
  filter(id: DB[:articles_tags].select(:article_id).
   join(:tags, id: :tag_id).
   filter(:tags__name.like('%foo%'))).each {|i|
  puts i.title
}&lt;/pre&gt;&lt;p&gt;Любой согласится--это гораздо читабельнее sql! Ну, ok, согласится, когда ему покажут отот sql:&lt;/p&gt;&lt;pre class='literal-block'&gt;#&amp;lt;Sequel::SQLite::Dataset: &amp;quot;SELECT * FROM `articles` WHERE (`id` IN
(SELECT `article_id` FROM `articles_tags` INNER JOIN `tags` ON
(`tags`.`id` = `articles_tags`.`tag_id`) WHERE (`tags`.`name` LIKE
'%mike%'))) ORDER BY `updated` DESC&amp;quot;&amp;gt;&lt;/pre&gt;&lt;p&gt;jfc.&lt;/p&gt;&lt;table class='docutils footnote' frame='void' id='id2' rules='none'&gt;&lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt;
&lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id1'&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;Если иногда вставлять это реликтовое слово в разговор посреди ланча, то после n-го по счету выговаривания вами &lt;em&gt;отношения&lt;/em&gt;, добродушный собеседник начнет есть в &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;(n-1)/3&lt;/span&gt;&lt;/tt&gt; раз медленнее.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4734779859938782151?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4734779859938782151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/03/sequel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4734779859938782151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4734779859938782151'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/03/sequel.html' title='Серенькие будни Sequel'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6210830171259377790</id><published>2011-02-26T01:03:00.001+02:00</published><updated>2011-02-26T01:05:18.662+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>reStructuredText &amp; PDF</title><content type='html'>&lt;p&gt;Новость дня: случайно узнал как включать в pdf, генерируемый rst2pdf'ом, &lt;a class='reference external' href='http://programmers.stackexchange.com/questions/48442/markup-language-with-pdf-output/48748#48748'&gt;svg-картинки&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Вообще, reStructuredText никто из русскоговорящих практически не пользует &lt;a class='footnote-reference' href='#id3' id='id1'&gt;[1]&lt;/a&gt;. Есть небольшая группа пайфонщиков, которые не штопают уеб-сайты; если погуглить, можно найти несколько каких-то кислых любителей криво переводить чужие англоязычные бложики и все.&lt;/p&gt;&lt;p&gt;Я вставляю reStructuredText куда только можно, наверное, несколько лет, хотя на пайфончике мне писать нечего, ввиду наличия Ruby. Такой дуализм вводит некоторых чуваков в когнитивный диссонанс, когда они видят исходник на Ruby с документаций генерация которой требует пайфоновских docutils и/или rst2pdf.&lt;/p&gt;&lt;p&gt;Недостаток у reStructuredText, пожалуй, только 1: у него нет, как например, в texinfo, conditional commands: из-за этого, чтобы производить из 1 .rest файла (содержащего формулы &lt;a class='footnote-reference' href='#id4' id='id2'&gt;[2]&lt;/a&gt;&lt;/p&gt;&lt;img class="align-center" src="http://gromnitsky.users.sourceforge.net/articles/rst-and-pdf/oo-satisfaction.png" /&gt;&lt;p&gt;и ссылочки на svg) output в 2 разных форматах (pdf и xhtml), приходится прогонять тот .rest файл сквозь m4.&lt;/p&gt;&lt;p&gt;Зато &lt;em&gt;не нужно&lt;/em&gt; никакого установленного latex: формулы вставляются либо с помощью matplotlib (для pdf) или itex2MML (MathML для xhtml), а аргентинский rst2pdf даже умеет рисовать текст в несколько колонок. Yay! Yay!&lt;/p&gt;&lt;p&gt;(Этот же текст в &lt;a class='reference external' href='http://gromnitsky.users.sourceforge.net/articles/rst-and-pdf/0065.pdf'&gt;pdf&lt;/a&gt; и &lt;a class='reference external' href='http://gromnitsky.users.sourceforge.net/articles/rst-and-pdf/0065.m4'&gt;reST&lt;/a&gt; форматах.)&lt;/p&gt;&lt;object class="align-center" data="http://gromnitsky.users.sourceforge.net/articles/rst-and-pdf/rst.svg" type="image/svg+xml"&gt;http://gromnitsky.users.sourceforge.net/articles/rst-and-pdf/rst.svg&lt;/object&gt;&lt;table class='docutils footnote' frame='void' id='id3' rules='none'&gt;&lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt;
&lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id1'&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;As usual, this is a good sign of a nice peace of software.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;table class='docutils footnote' frame='void' id='id4' rules='none'&gt;&lt;colgroup&gt;&lt;col class='label'/&gt;&lt;col/&gt;&lt;/colgroup&gt; &lt;tbody valign='top'&gt;
&lt;tr&gt;&lt;td class='label'&gt;&lt;a class='fn-backref' href='#id2'&gt;[2]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;An unscientific &amp;amp; dumb way to predict a user's satisfaction (in %) of using a shared OpenOffice document on a network drive depending on number of pages in the document (p), revisions (r) and participating users (u).&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6210830171259377790?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6210830171259377790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/02/restructuredtext-pdf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6210830171259377790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6210830171259377790'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/02/restructuredtext-pdf.html' title='reStructuredText &amp; PDF'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4326653646591253818</id><published>2011-02-15T18:32:00.000+02:00</published><updated>2011-02-15T18:32:10.555+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>Non-Recursive Rake</title><content type='html'>&lt;p&gt;Для рубироидов: текст про нерекурсивный Rake и почему использовать его без рекурсии проще, про аллюзию на make и т.д., можно &lt;a class="reference external" href="http://bit.ly/e7qO5j"&gt;прочесть вот тут&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;(Content-type там application/xhtml+xml из-за инлайновых svg, поэтому с IE туда заходить бесполезно.)&lt;/p&gt;&lt;p&gt;Cheers.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4326653646591253818?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4326653646591253818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/02/non-recursive-rake.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4326653646591253818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4326653646591253818'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/02/non-recursive-rake.html' title='Non-Recursive Rake'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-3299286809558678525</id><published>2011-02-10T12:09:00.000+02:00</published><updated>2011-02-10T12:09:06.895+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><title type='text'>rubygems &amp; check -t</title><content type='html'>&lt;p&gt;Эпопея перехода на 1.5.x, если кто не следит, в самом разгаре.&lt;/p&gt;&lt;p&gt;Больше всего мне понравилось поведение 1.5.0 на своих gem'ах: локально все собирается и устанавливается, в если запушить их на rubygems.org и инсталлировать оттуда, они валятся с удобным сообщением:&lt;/p&gt;&lt;pre class='literal-block'&gt;undefined class/module YAML::PrivateType &lt;/pre&gt;&lt;p&gt;Гм-гм. Отправленный мною репорт на &lt;a class='reference external' href='http://help.rubygems.org/discussions/problems'&gt;http://help.rubygems.org/discussions/problems&lt;/a&gt;, нечаянно попал у модераторов в &lt;tt class='docutils literal'&gt;/dev/null&lt;/tt&gt;. Эх, Эрик ты такой Ходел. Пришлось откатываться на 1.3.7 и плача джанкать запушенные gem'ы.&lt;/p&gt;&lt;p&gt;А еще в 1.5.0 прихлопнули опцию &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;-t&lt;/span&gt;&lt;/tt&gt; для субкоммандочки &lt;tt class='docutils literal'&gt;check&lt;/tt&gt;. И ввиду появления &lt;a class='reference external' href='http://gem-testers.org'&gt;http://gem-testers.org&lt;/a&gt;, она вряд ли выплывет опять. Получается, я совершенно напрасно везде для minitest проверял, откуда тест запускается и чтобы только 1 раз автомагически и не дай б-г чтоб не ругался &lt;tt class='docutils literal'&gt;block in process_args&lt;/tt&gt;, евпочя.&lt;/p&gt;&lt;p&gt;Такая пичалька.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-3299286809558678525?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/3299286809558678525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/02/rubygems-check-t.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3299286809558678525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3299286809558678525'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/02/rubygems-check-t.html' title='rubygems &amp; check -t'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6966279306905109333</id><published>2011-01-12T21:18:00.000+02:00</published><updated>2011-01-12T21:18:45.859+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><title type='text'>An advice</title><content type='html'>&lt;p&gt;From Stroustrup's &lt;a class='reference external' href='http://bit.ly/gpTT7x'&gt;recent interview&lt;/a&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;em&gt;Danny Kalev&lt;/em&gt;: Finally, what are your New Years' resolutions?&lt;/p&gt;&lt;p&gt;&lt;em&gt;Bjarne Stroustrup&lt;/em&gt;:&lt;/p&gt;&lt;ul class='simple'&gt;&lt;li&gt;To get C++0x formally approved as an ISO standard.&lt;/li&gt;
&lt;li&gt;To produce a good first draft of The C++ Programming Language (4th Edition).&lt;/li&gt;
&lt;li&gt;To spend more time with my grandchildren.&lt;/li&gt;
&lt;li&gt;To have at &lt;em&gt;least one interesting new technical insight&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/blockquote&gt;&lt;p&gt;Dude, I have an insight for you:&lt;/p&gt;&lt;p&gt;Throw away your 28 years old crap into a wheelie bin &amp;amp; start using the sane, modern language: Go.&lt;/p&gt;&lt;p&gt;Such a brave but long-awaited move will:&lt;/p&gt;&lt;ul class='simple'&gt;&lt;li&gt;liberate you from producing an invaluable 20,000 pages book;&lt;/li&gt;
&lt;li&gt;automagically give an ability to spend more time with grandchildren.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;With hope&lt;/p&gt;&lt;p&gt;AG&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6966279306905109333?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6966279306905109333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2011/01/advice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6966279306905109333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6966279306905109333'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2011/01/advice.html' title='An advice'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8919673019865912413</id><published>2010-11-22T02:08:00.000+02:00</published><updated>2010-11-22T02:08:36.948+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><title type='text'>Японса развлекается</title><content type='html'>&lt;p&gt;Mary had a little lambda, its syntax white as snow:&lt;/p&gt;&lt;pre class="literal-block"&gt;% tail -30 ~/.emacs.d/lisp/twittering-mode/twittering-mode.el

(provide 'twittering-mode)
;;; twittering.el ends here

         (progn  (when  (
          boundp  (  intern (
           mapconcat 'identity '
           (&amp;quot;twittering&amp;quot; &amp;quot;oauth&amp;quot;
             &amp;quot;consumer&amp;quot; &amp;quot;key&amp;quot; ) &amp;quot;-&amp;quot;
              )  )  )   (eval  ` (
               setq ,(intern (mapconcat
                (quote identity) (quote
                 (&amp;quot;twittering&amp;quot;    &amp;quot;oauth&amp;quot;
                  &amp;quot;consumer&amp;quot; &amp;quot;key&amp;quot;)  )&amp;quot;-&amp;quot;
                  ))  (base64-decode-string
                (apply  'string  (mapcar   '1-
               (quote (83 88 75 114 88 73 79 117
             101 109 109 105 82 123 75 120 78 73
            105 122 83 69 67 78   98 49 75 109 101
          120 62 62))))))))(       when ( boundp  (
         intern (mapconcat '      identity'(&amp;quot;twittering&amp;quot;
        &amp;quot;oauth&amp;quot; &amp;quot;consumer&amp;quot;         &amp;quot;secret&amp;quot;) &amp;quot;-&amp;quot;)))(eval `
       (setq  ,(intern   (         mapconcat 'identity '(
      &amp;quot;twittering&amp;quot; &amp;quot;oauth&amp;quot;          &amp;quot;consumer&amp;quot; &amp;quot;secret&amp;quot;) &amp;quot;-&amp;quot;))
     (base64-decode-string          (apply 'string (mapcar '1-
    (quote   (91   70                    113 87 83 123 75 112
   87 123 75 117 87 50                109 50  102  85 83 91 101
  49 87 116 100 73 101                  106 82 107 67 113  90 49
 75 68  99  52  79 120                   80 89  91  51  79 85 71
110 101  110 91  49                      100 49   58  71)))))) )))
&lt;/pre&gt;&lt;p&gt;The remains of the day can be killed by reading (&amp;amp; using)&lt;br /&gt;
&lt;a class="reference external" href="https://github.com/hayamiz/twittering-mode/"&gt;https://github.com/hayamiz/twittering-mode/&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/8518021139708603317-8919673019865912413?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8919673019865912413/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/11/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8919673019865912413'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8919673019865912413'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/11/blog-post.html' title='Японса развлекается'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-2599334873973371951</id><published>2010-10-28T09:06:00.000+03:00</published><updated>2010-10-28T09:06:29.923+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Patches for Claws Mail</title><content type='html'>&lt;p&gt;Думал избавить claws mail от идиотской манеры гадить в &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;~/.claws-mail/newscache&lt;/span&gt;&lt;/tt&gt;, а там оказалось не все так просто.&lt;/p&gt;&lt;p&gt;Оно сначала делает кэш, а потом читает с получившегося локального файла письмо. И точно также с imap. Пошуршал по плагинам--глухо. Зато обнаружил функцию &lt;tt class='docutils literal'&gt;folder_func_to_all_folders()&lt;/tt&gt; и готовую функцию удаления кэша из 1 фолдера.&lt;/p&gt;&lt;p&gt;Тоскуя по mutt, нельзя не вспомнить как он дает прыгать к новому письму не открывая его и не трогая при этом флаги read/unread. Ужасно удобно, когда заходишь в newsgroup, где томятся 2584 старых письма и светятся 315 новых, раскиданных по 491 треду. В claws mail прыжок к новому письму всегда автоматически его (письмо) открывает, что иногда доводит меня до бешенства.&lt;/p&gt;&lt;p&gt;В общем, патчи для версии 3.7.6 &lt;a class='reference external' href='http://gromnitsky.users.sourceforge.net/patch/claws-mail/'&gt;лежат тут&lt;/a&gt;. Кто собирает порт в FreeBSD--просто киньте их в директорию &lt;tt class='docutils literal'&gt;files&lt;/tt&gt; порта и собирайте порт как обычно. После инсталляции, в меню Tools появится пункт Purge Cache, а Go to Next/Previous Unread Message начнет работать правильно.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-2599334873973371951?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2599334873973371951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/patches-for-claws-mail.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2599334873973371951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2599334873973371951'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/patches-for-claws-mail.html' title='Patches for Claws Mail'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-3099907263165566429</id><published>2010-10-12T10:01:00.000+03:00</published><updated>2010-10-12T10:01:03.208+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>Бег за поездом</title><content type='html'>&lt;p&gt;&lt;a class='reference external' href='http://bit.ly/bgfIyc'&gt;Плагин для bwkfanboy&lt;/a&gt;, который выковыривает последние 20 ответов любого пользователя в Quora (чтобы дать bwkfanboy сгенерировать atom feed) прожил ажно 2 дня. В quora чуть изменили JS, который у них проставляет дату ответа и все.&lt;/p&gt;&lt;p&gt;Сейчас плагин работает опять, но чувствую, что такая правка станет частым компаньоном утреннего кофе.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-3099907263165566429?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/3099907263165566429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3099907263165566429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3099907263165566429'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/blog-post.html' title='Бег за поездом'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-9212727047090257887</id><published>2010-10-12T03:15:00.003+03:00</published><updated>2010-10-12T03:18:09.638+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>iTunes U RSS feeds</title><content type='html'>&lt;p&gt;Часто, публичное в iTunes U которое читалось не last fall, а обновляется
сейчас, хочется качать как подкаст без помощи толстопузого iTunes, что
как бы официально нельзя. Ну, конечно, разумеется можно, только нужно
для каждого курса знать URL секретной feed.&lt;/p&gt;&lt;p&gt;Если я правильно понял, университеты либо просто дают iTunes U свою feed
(тогда URL ее, как правило, указан на сайте университета), либо
закачивают файлы в эппловскую тучу, которая генерирует RSS сама. То
есть, в любом случаи iTunes U сперва тянет feed и ничем это от обычного
подкастинга не отличается.&lt;/p&gt;&lt;p&gt;Например, на talks в &lt;a class="reference external" href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=384902524"&gt;Yale Entrepreneurial Institute&lt;/a&gt;,
подписаться никак, кроме как через благодаря посредством iTunes не
дают. Но если посмотреть, например, wireshark'ом, куда iTunes незаметно
лезет за файлами, то мы видим &lt;a class="reference external" href="http://deimos3.apple.com/WebObjects/Core.woa/Feed/yale.edu-dz.4357409176.04357409178"&gt;вот такую URL&lt;/a&gt;:&lt;/p&gt;&lt;pre class="literal-block"&gt;http://deimos3.apple.com/WebObjects/Core.woa/Feed/yale.edu-dz.4357409176.04357409178
&lt;/pre&gt;&lt;p&gt;Content-Type у нее почему-то text/html, но эта обычная, скучная rss
2.0. Проблемы начинаются, если скачать несколько (например, 4) enlosures
одну за другой. В зависимости от степени тупости вашего podcacher'а,
можно получить 1 (один) файл enclosure.mp3 содержащий либо 1-ю по списку
enlosure либо 4-ю, но не все 4 файла по отдельности.&lt;/p&gt;&lt;p&gt;Почему? URL на mp3 файлы в у iTunes U вот такой:&lt;/p&gt;&lt;pre class="literal-block"&gt;http://deimos3.apple.com/WebObjects/[всякое].4721501315/enclosure.mp3
&lt;/pre&gt;&lt;p&gt;где изменяется только набор цифр, а предполагаемое имя для файла дается
всегда одинаковое &lt;tt class="docutils literal"&gt;enclosure.mp3&lt;/tt&gt;--что привело предыдущую версию
&lt;a class="reference external" href="http://uraniacast.sourceforge.net/"&gt;uraniacast&lt;/a&gt; в тихое
помешательство. Впрочем, в хедерах той URL стоит &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;Content-Disposition:&lt;/span&gt;
inline; filename=2001_conde.mp3&lt;/tt&gt;, что дает некоторую надежду, если
попытаться сказать podcacher'у: &amp;quot;смотри на Content-Disposition, а не на
URL&amp;quot;.&lt;/p&gt;&lt;p&gt;To make long story short. Теперь в uraniacast 0.16 можно указывать
feed-specific downloader, а не только глобальный для всех. Для
замученного Yale Entrepreneurial Institute получилось так:&lt;/p&gt;&lt;pre class="literal-block"&gt;# a crappy link from itunes
set feed(biz.yale.entrepreneurial_institute) {
    url {http://deimos3.apple.com/WebObjects/Core.woa/Feed/yale.edu-dz.4357409176.04357409178}
    sort decreasing
    fetch {curl -OJ --noproxy * %u}
}
&lt;/pre&gt;&lt;p&gt;Huzza!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-9212727047090257887?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/9212727047090257887/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/itunes-u-rss-feeds.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/9212727047090257887'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/9212727047090257887'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/itunes-u-rss-feeds.html' title='iTunes U RSS feeds'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4380485490717431326</id><published>2010-10-01T02:44:00.000+03:00</published><updated>2010-10-01T02:44:05.985+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>Horror Story From z1</title><content type='html'>&lt;pre class="literal-block"&gt;Date: Tue, 28 Sep 2010 19:49:27 -0700
From: Ilya L &amp;lt;lvi123&amp;#64;yahoo.com&amp;gt;
Newsgroups: alt.russian.z1
Subject: Re: Chase online

On 9/28/10 5:52 PM, Sol Windborn wrote:

&amp;gt;&amp;gt; Только для чего-то наколенного, наверное. В нетривиальном коде
&amp;gt;&amp;gt; найдется кусочек, который на stdout вывалит debug message и кранты.
&amp;gt;
&amp;gt; Если что-то плюется отладкой на консоль, то это, скорее, наколенное.
&amp;gt; Ненавижу. Убивать сразу.

        У меня был чрезвычайно печальный опыт с приложением, которое с какой-то
забытой целью закрывало свой stderr. Наверное, чтобы ничего на консоль
не лезло. Наш код открывал /dev/sda. И так как descriptor #2 был unused,
этот /dev/sda туда и попадал. И отладка, которая печаталась once in a
blue moon, писалась в master boot record. Application занимался backup-ом :)
&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4380485490717431326?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4380485490717431326/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/horror-story-from-z1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4380485490717431326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4380485490717431326'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/10/horror-story-from-z1.html' title='Horror Story From z1'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8393439115723324725</id><published>2010-09-16T23:16:00.000+03:00</published><updated>2010-09-16T23:16:12.661+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Как делать не нужно</title><content type='html'>&lt;p&gt;systemd в Fedora 14 не будет. Lennart, конечно, &lt;a class='reference external' href='http://lists.fedoraproject.org/pipermail/devel/2010-September/142858.html'&gt;обиделся&lt;/a&gt;:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;This is a really unfriendly move: I cannot win a game where the moment the game nears it ends completely new rules are created. Quite frankly, this is a recipe to piss people off, not to make people love developing for Fedora. Yes, I am very disappointed, Fedora.&lt;/p&gt;&lt;p&gt;It's also nice to not even bother to ping me for the FESCO discussion. This all reads like a page from the book &amp;quot;How to piss people off and scare them away in 7 days&amp;quot;. You make up new rules, and then don't bother to invite the folks mostky affected when you apply them.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Еще один такой unfriendly move и я не удивлюсь, если Lennart пойдет работать в Apple или (что будет наказанием, которое RH заслужило) в Ubuntu.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8393439115723324725?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8393439115723324725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/blog-post_16.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8393439115723324725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8393439115723324725'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/blog-post_16.html' title='Как делать не нужно'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-814950846850758220</id><published>2010-09-04T03:20:00.000+03:00</published><updated>2010-09-04T03:20:13.832+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><title type='text'>Левая сторона---правая сторона</title><content type='html'>&lt;p&gt;UI вопрос, который &lt;a class='reference external' href='http://bit.ly/cWxceJ'&gt;гложет немногих&lt;/a&gt;: почему абсолютно все ставят scrollbar &lt;strong&gt;справа&lt;/strong&gt;?&lt;/p&gt;&lt;p&gt;Ответы какие-то скучные: &amp;quot;исторически&amp;quot; или потому, что якобы когда пользователь заканчивает читать абзац, это случается у правого края окна или потому что курсор мыши мерещится мозолистой рукой, которая бы закрывала собой текст, если бы тот scrollbar был слева.&lt;/p&gt;&lt;p&gt;Разумеется, все эти аргументы (кроме &amp;quot;исторического&amp;quot;)--полная чепуха. Кто-то в майкросовте в 1987 году спросонья засунул scrollbar и кнопочки закрытия окошка справа, а как виндюк захватил все, дизайнеры интерфейсов, кивая друг другу, тонкою мыслью сплели себе на несчастных головах паранджу.&lt;/p&gt;&lt;ol class='arabic' start='0'&gt;&lt;li&gt;&lt;p class='first'&gt;Современный пользователь не читает внимательно страницу от корки до корки: он прыгает по абзацам, ищет глазами списки, короткие предложения и картинки. Если он смотрит на страницу на left-to-right языке, его глаза натыкаются на углы абзацев &lt;em&gt;слева&lt;/em&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p class='first'&gt;Когда пользователь просмотревший все абзацы, хочет проскролить ниже или узнать свою текущую позицию на странице, ему приходится двигать глазами &lt;em&gt;вправо&lt;/em&gt;--прямо к scrollbar, то есть в &lt;strong&gt;противоположном направлении&lt;/strong&gt;. Чем шире окно, в которое он пялится, тем мучительнее для него это действие.&lt;/p&gt;&lt;p&gt;Примером клинического маразма тут является броузеры у которых кнопки назад/вперед расположены слева вверху, а scrollbar, разумеется, на другой стороне экрана. Хотел бы я знать, какой идиот это первым придумал (у Бернереса-Ли на &lt;a class='reference external' href='http://upload.wikimedia.org/wikipedia/en/3/32/WorldWideWeb_screenshot.gif'&gt;скриншоте его первого броузера&lt;/a&gt; scrollbar &lt;em&gt;слева&lt;/em&gt;, потому что а) он писал его под NeXT, где scrollbar везде слева по умолчанию, б) у него есть мозг).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p class='first'&gt;Если пользователь таки допустим читает абзац целиком и этот абзац оказывается в самом низу страницы, то глаза пользователя будут в правом углу только тогда, когда конец последнего предложения абзаца заканчивается ближе к правой стороне.&lt;/p&gt;&lt;p&gt;Всегда ли это верно? В каких случаях абзацы идеально подогнаны в &lt;em&gt;идеальные&lt;/em&gt; прямоугольники? Возможно ли вообще это реализовать, если страница растягивается/сжимается динамически в зависимости от размеров окна, а не прибита гвоздями в свои n пикселов шириной? Как абзацы будут себя вести, если пользователь изменил масштаб шрифта в броузере?&lt;/p&gt;&lt;p&gt;По контрасту, левый угол заполнен всегда, вне зависимости от длины абзаца, даже если абзац состоит из 1 буквы и 1 точки.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p class='first'&gt;Некоторые говорят, что курсор мыши им визуально мешает, когда он слева от текста, тогда когда справа обычно посвободнее, поэтому им более комфортно тыкать в scrollbar справа.&lt;/p&gt;&lt;p&gt;Это тот случай, когда дизайнеры наперед зная то, что scrollbar всегда будет справа, экономят место и специально убирают поле слева, а потом храбро приводят такие страницы в доказательство.&lt;/p&gt;&lt;p&gt;Это как если ввести левостороннее движение, но машины делать только с левым рулем и громко возмущаются до чего же не комфортно стало ездить.&lt;/p&gt;&lt;p&gt;Кто сомневается, рекомендую &lt;a class='reference external' href='http://gromnitsky.users.sourceforge.net/tcl/scrollbar.tcl'&gt;взять вот этот Tk скрипт&lt;/a&gt; и попробовать поскролить в ситуации, когда поля у текста одинаковы.&lt;/p&gt;&lt;a class='reference external image-reference' href='http://lh6.ggpht.com/_W-OHaMHyRAE/TIGK59o9PzI/AAAAAAAAAIw/omC9l2fvNeo/s1024/scrollbar_test.png'&gt;&lt;img alt='http://lh6.ggpht.com/_W-OHaMHyRAE/TIGK59o9PzI/AAAAAAAAAIw/omC9l2fvNeo/s400/scrollbar_test.png' src='http://lh6.ggpht.com/_W-OHaMHyRAE/TIGK59o9PzI/AAAAAAAAAIw/omC9l2fvNeo/s400/scrollbar_test.png'/&gt;&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;Вообще, чем больше об этой ерунде думать, тем больше кажется что в идеале нужно было сделать 2 вертикальных scrollbar'а: слева и справа, причем так, чтобы (в зависимости от количества использования) scrollbar меняла цвет на более темный если ее используют чаще. Так пользователь мог бы, с течением времени, выбрать вариант самостоятельно.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-814950846850758220?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/814950846850758220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/blog-post_04.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/814950846850758220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/814950846850758220'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/blog-post_04.html' title='Левая сторона---правая сторона'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_W-OHaMHyRAE/TIGK59o9PzI/AAAAAAAAAIw/omC9l2fvNeo/s72-c/scrollbar_test.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7231333626011104850</id><published>2010-09-03T22:39:00.002+03:00</published><updated>2010-09-03T23:16:22.992+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>A tip for developers</title><content type='html'>&lt;p&gt;Из &lt;a class='reference external' href='http://bit.ly/cDnqCV'&gt;веселого coderpath&lt;/a&gt; с неким Джеймсом Голиком:&lt;/p&gt;&lt;blockquote&gt; If more programmers read [academic] papers rather then blogs, the level of discussion &amp;amp; the quality of the work they are doing would be a lot higher in general.&lt;/blockquote&gt;&lt;p&gt;Распечатайте эту фразу и приклейте себе на монитор, дорогие потисипэнты HN.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7231333626011104850?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7231333626011104850/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/tip-for-developers.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7231333626011104850'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7231333626011104850'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/tip-for-developers.html' title='A tip for developers'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6509944118843643797</id><published>2010-09-03T21:11:00.002+03:00</published><updated>2010-09-03T22:43:29.627+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><title type='text'>Всем бояться полчаса</title><content type='html'>&lt;p&gt;Гибсон в последнем &lt;a class='reference external' href='http://bit.ly/bTeh8h'&gt;security now&lt;/a&gt; так обличил собирателей fingerprint'ов, которые умудряются не трогая cookies все равно составить уникальный отпечаток вашей машины с точностью 83-94%, что можно предсказать как будут бороться с этим в будущем те, кто захочет попадать в маленький неучтенный процент.&lt;/p&gt;&lt;ol class='arabic simple' start='0'&gt; &lt;li&gt;Пользовать самую распространенную ОС.&lt;/li&gt; &lt;li&gt;Пользовать самый распространенный броузер, не меняя в нем настроек, которые трогают все &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;Accept-*&lt;/span&gt;&lt;/tt&gt; хедеры. Причем, если задача есть затесаться в стаде, например, русскоязычных овечек, то брать не локализованную версию броузера, который будет по умолчанию конструировать хедер &lt;tt class='docutils literal'&gt;&lt;span class='pre'&gt;Accept-Language:&lt;/span&gt; &lt;span class='pre'&gt;en-us&lt;/span&gt;&lt;/tt&gt; --это слишком явно выделять себя из толпы.&lt;/li&gt; &lt;li&gt;Не ставить никаких дополнительных шрифтов.&lt;/li&gt; &lt;li&gt;Не ставить никаких плагинов, кроме Java и Flash.&lt;/li&gt; &lt;li&gt;Таймзона должна совпадать с той, которая предполагается для вашего IP.&lt;/li&gt; &lt;li&gt;Т.к. виндючек часы давно синхронизирует самостоятельно, то иметь сильно не синхронизированное время--отличительный признак.&lt;/li&gt; &lt;li&gt;Пытаться определить наиболее распространенный CPU и screen resolution и пользовать только их (желаю успеха).&lt;/li&gt; &lt;/ol&gt;&lt;p&gt;Самое интересное в этом то, что изменение нескольких параметров (для того, чтобы попытаться сменить fingerprint) не поможет, потому что граждане, которые fingerprint'ы собирают, проанализируют разницу между 2 отпечатками и увидят что вы, дорогуша--это опять вы. Пример: обновилась версия Flash и вы радостно подумали что fingerprint у вашего броузера стал другой?  Ha-ha, как бы не так.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6509944118843643797?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6509944118843643797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6509944118843643797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6509944118843643797'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/09/blog-post.html' title='Всем бояться полчаса'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-5274693345160426736</id><published>2010-08-23T18:52:00.001+03:00</published><updated>2010-08-23T19:00:21.966+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Minimal open-vm-tools for FreeBSD 8.1</title><content type='html'>&lt;p&gt;&lt;i&gt;(For newcomers: есть &lt;a class="reference external" href="http://gromnitsky.blogspot.com/2009/11/freebsd-80-and-vmware-workstation.html"&gt;предыдущие&lt;/a&gt;
серии.)&lt;/i&gt;&lt;/p&gt;&lt;p&gt;Обновленный package для 8.1 &lt;a class="reference external" href="http://gromnitsky.users.sourceforge.net/open-vm-tools/open-vm-tools-minimum-253928_1.tar.gz"&gt;лежит вот тут&lt;/a&gt;. Это
версия от 2010.04.25; в более новых грохнули vmware-user, а все его
функции перенесли в плагины для vmtoolsd, что означает то, что мне нужно
читать код vmtoolsd заново. До выхода 8.2 делать я этого не буду, хотя
там много интересного, если верить анонсам.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-5274693345160426736?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/5274693345160426736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/08/minimal-open-vm-tools-for-freebsd-81.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5274693345160426736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5274693345160426736'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/08/minimal-open-vm-tools-for-freebsd-81.html' title='Minimal open-vm-tools for FreeBSD 8.1'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-377442931604713210</id><published>2010-05-28T15:43:00.000+03:00</published><updated>2010-05-28T15:49:50.603+03:00</updated><title type='text'>О горькой судьбе математишанс</title><content type='html'>&lt;p&gt;A joke from &lt;a class="reference external" href="http://bit.ly/bFRLlz"&gt;mathoverflow&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A mathematician who studied a very abstract topic was annoyed that his
peers in more applied fields always made fun of him.&lt;/p&gt;
&lt;p&gt;One day he saw a sign &amp;quot;talk today on the theory of gears&amp;quot;, and said to
himself &amp;quot;I'll go to that! What could be more practical than a talk on
gears?&amp;quot;.&lt;/p&gt;
&lt;p&gt;He arrives at the talk, eager to learn applicable knowledge. The
speaker goes up to the podium and addresses the crowd: &amp;quot;Welcome to
this talk on the theory of gear. Today I will be speaking about gears
with an irrational number of teeth&amp;quot;.&lt;/p&gt;
&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-377442931604713210?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/377442931604713210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/05/blog-post_28.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/377442931604713210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/377442931604713210'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/05/blog-post_28.html' title='О горькой судьбе математишанс'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-135292011040029760</id><published>2010-05-21T16:10:00.002+03:00</published><updated>2010-05-22T00:09:13.075+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='startups'/><title type='text'>Новости у нас такие</title><content type='html'>&lt;p&gt;Не прошло и полгода после заявки, как меня пустили в &lt;a class="reference external" href="http://bit.ly/dydyjV"&gt;Quora&lt;/a&gt;. Это q&amp;amp;a, отдаленно смахивающий на
StackExchange, только где все на одном сайте. Мне оно больше напоминает
обычную социальную сеточку, где видно твой каждый чих (включая такое
невинное действие как upvote).&lt;/p&gt;
&lt;p&gt;Пока там интересны слухи: кто, почему, куда, за сколько перешел в SV из
одного здания через дорогу в другое. Или такие вопросы как &lt;em&gt;Why is
e-commerce such a hot area in venture capital now?&lt;/em&gt; или &lt;em&gt;What does
Rapleaf do?&lt;/em&gt;. Уже есть аккаунты некоторых конкурентов Quora, например
Калаканиса и Спольского. Последний, например, успел отметился голосованием
в вопросе &lt;a class="reference external" href="http://bit.ly/dmUQWW"&gt;Who is the hottest male startup founder?&lt;/a&gt;, охохо.&lt;/p&gt;
&lt;p&gt;Слушал на днях omega tau подкаст про space medicine. В симбиозе со
&lt;a class="reference external" href="http://imagine.gsfc.nasa.gov/docs/ask_astro/answers/970603.html"&gt;ссылкой&lt;/a&gt; из
HN, заставило, как не устают писать в бложиках, задуматься о вечном.&lt;/p&gt;
&lt;p&gt;Пытаюсь рекламировать node.js--народ безмолвствует: никому не хочется
выбрасывать руби, все обленились как коты на солнышке в сиесту. Хотя вот
Райан в свежем видео показывает &lt;a class="reference external" href="http://yhoo.it/btnrnX"&gt;цифры&lt;/a&gt; от
которых, как не устают писать в бложиках, захватывает дух.&lt;/p&gt;
&lt;p&gt;Солнышко, кстати, совсем не радует отсутствием.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-135292011040029760?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/135292011040029760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/05/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/135292011040029760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/135292011040029760'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/05/blog-post.html' title='Новости у нас такие'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7899876365132836396</id><published>2010-04-04T13:49:00.001+03:00</published><updated>2010-04-04T13:51:50.305+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>A Simple FVWM Vector Buttons Viewer</title><content type='html'>&lt;p&gt;Говорят, когда-то в Киеве жил человек, который мог глядя на&lt;/p&gt;
&lt;pre class="literal-block"&gt;
ButtonStyle 6 Vector 13 60x20&amp;#64;0 60x40&amp;#64;0 80x40&amp;#64;1 80x60&amp;#64;0 60x60&amp;#64;0 60x80&amp;#64;0 \
                        40x80&amp;#64;0 40x60&amp;#64;1 20x60&amp;#64;0 20x40&amp;#64;1 40x40&amp;#64;1 40x20&amp;#64;1 \
                        60x20&amp;#64;1
&lt;/pre&gt;
&lt;p&gt;через 15 секунд сказать, что это стрелочка:&lt;/p&gt;
&lt;img alt="1 KB" src="http://farm5.static.flickr.com/4004/4489421554_729fc3757f_o.png" /&gt;
&lt;p&gt;Тому, кто такими способностями не обладал, оставалось 2 варианта:
наплевать (популярный) или пользовать готовые кнопки из коллекции на
fvwm.org.&lt;/p&gt;
&lt;p&gt;Но теперь, в наши светлые времена, можно &lt;a class="reference external" href="http://gromnitsky.users.sourceforge.net/js/fvwm-vector/"&gt;пойти на вот эту страничку&lt;/a&gt;, и не
мучительно визуализировать the spec в голове, а вставить его в textarea
и нажать кнопошку Draw. (Для рисования оно использует canvas, поэтому в
IE тестировать бесполезно.)&lt;/p&gt;
&lt;p&gt;Отправил ссылку в fvwm mail list, надеясь получить комментарии &amp;quot;ага!&amp;quot;,
&amp;quot;наконец-то&amp;quot;, &amp;quot;эх, уж теперича мы!&amp;quot;, и шо вы думаете? За полтора дня ее
в совершеннейшем молчании посмотрели ажно 10 человек, а так--нуль
внимания, those bastards.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7899876365132836396?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7899876365132836396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/04/simple-fvwm-vector-buttons-viewer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7899876365132836396'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7899876365132836396'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/04/simple-fvwm-vector-buttons-viewer.html' title='A Simple FVWM Vector Buttons Viewer'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-382483256217583050</id><published>2010-03-12T15:46:00.002+02:00</published><updated>2010-03-12T15:51:15.885+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><title type='text'>Quotes from 97 Things Every Programmer Should Know</title><content type='html'>&lt;p&gt;I thought it &lt;a href='http://bit.ly/asUg9V'&gt;would be a collection&lt;/a&gt; of super-duper, mega wise unpalatable
truth, but in reality it was the set of truisms, cliches and
platitudes. In brief, I'm disappointed. There of course exists some
interesting advices (&amp;lt;20), mostly applicable for very young developers.&lt;/p&gt;
&lt;p&gt;Here are examples of the most useful:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Giles Colborne&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When you get stuck, you look around. When users get stuck, they narrow
their focus. [...] It becomes harder for them to see solutions
elsewhere on the screen. It's one reason why help text is a poor
solution to poor user interface design. If you must have instructions
or help text, make sure to locate it right next to your problem
areas. A user's narrow focus of attention is why tool tips are more
useful than help menus.&lt;/p&gt;
&lt;p&gt;[...] Spending an hour watching users is more informative than
spending a day guessing what they want.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Filip van Laenen&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Make sure code formatting is part of the build process, so that
everybody runs it automatically every time they compile the code.&lt;/li&gt;
&lt;li&gt;Use static code analysis tools to scan the code for unwanted
antipatterns.  If any are found, break the build.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Rajith Attapattu&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;em&gt;Many incremental changes are better than one massive change&lt;/em&gt;. [...]
It is no fun to see a hundred test failures after you make a
change. This can lead to frustration and pressure that can in turn
result in bad decisions. A couple of test failures at a time is easier
to deal with, leading to a more manageable approach.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Mattias Karlsson&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Be gentle during code reviews. Ensure that comments are
&lt;em&gt;constructive&lt;/em&gt;, not &lt;em&gt;caustic&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;[...] Code reviews will flow more easily if the team has coding
conventions that are checked by tools. That way, code formatting will
never be discussed during the code review meeting.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Jon Jagger&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Deliberate practice means repetition. It means performing the task
with the aim of increasing your mastery of one or more aspects of the
task. It means repeating the repetition.&lt;/p&gt;
&lt;p&gt;[...] Ask yourself, how much of your time do you spend developing
someone else's product? How much developing yourself?&lt;/p&gt;
&lt;p&gt;[...] Deliberate practice is about learning--learning that changes
you, learning that changes your behavior.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Mike Lewis&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
Don't be afraid of your code. Who cares if something gets temporarily
broken while you move things around? A paralyzing fear of change is
what got your project into this state to begin with. Investing the
time to refactor will pay for itself several times over the lifecycle
of your project.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Alan Griffiths&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
[...] the hard part [of the programming]--the thinking--is the least
visible and least appreciated by the uninitiated.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Johannes Brodwall&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When I start a new project from scratch, there are no [compiler]
warnings, no clutter, no problems. But as the codebase grows, if I
don't pay attention, the clutter, the cruft, the warnings, and the
problems can start piling up. [...] If I leave the warnings, someone
else will have to wade through what is relevant and what is not. Or
more likely, that person will just ignore all the warnings, including
the significant ones.&lt;/p&gt;
&lt;p&gt;Warnings from your build are useful. You just need to get rid of the
noise to start noticing them.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Dan Bergh Johnsson&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
Know your next commit. If you cannot finish, throw away your changes,
then define a new task you believe in with the insights you have
gained. Do speculative experimentation whenever needed, but do not let
yourself slip into speculative mode without noticing. Do not commit
guesswork into your repository.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Daniel Lindner&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
You need to give your project a voice. [...] The idea of XFDs [Extreme
Feedback Device] is to drive a physical device such as a lamp, a
portable fountain, a toy robot, or even a USB rocket launcher, based
on the results of the automatic analysis. Whenever your limits are
broken, the device alters its state.  In case of a lamp, it will light
up, bright and obvious. You can't miss the message even if you're
hurrying out the door to get home.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Jon Jagger&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
Lack of visible progress is synonymous with lack of progress. [...]
It's best to develop software with plenty of regular visible
evidence. Visibility gives confidence that progress is genuine and not
an illusion, deliberate and not unintentional, repeatable and not
accidental.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Linda Rising&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
[...] in all the years I've taught and worked side by side with
programmers, it seems that most of them thought that since the
problems they were struggling with were difficult, the solutions
should be just as difficult for everyone.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Giles Colborne&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Another way of avoiding formatting errors is to offer cues--for
instance, with a label within the field showing the desired format
(&amp;quot;DD/MM/YYYY&amp;quot;).&lt;/p&gt;
&lt;p&gt;[...] Cues are different from instructions: cues tend to be hints;
instructions are verbose. Cues occur at the point of interaction;
instructions appear before the point of interaction. Cues provide
context; instructions dictate use.  In general, instructions are
ineffective at preventing error.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Uncle Bob&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;A professional programmer does not pass that responsibility off on
others.&lt;/p&gt;
&lt;p&gt;[Professionals] take responsibility for their own careers.  They take
responsibility for making sure their code works properly. They take
responsibility for the quality of their workmanship. They do not
abandon their principles when deadlines loom. Indeed, when the
pressure mounts, professionals hold ever tighter to the disciplines
they know are right.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Alex Miller&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;When I was first placed in a technical leadership role, I felt that my
job was to protect my beautiful software from the ridiculous stream of
demands coming from product managers and business analysts. I started
most conversations seeing a request as something to defeat, not
something to grant.&lt;/p&gt;
&lt;p&gt;At some point, I had an epiphany that maybe there was a different way
to work that merely involved shifting my perspective from starting at
no to starting at yes. In fact, I've come to believe that starting
from yes is actually an essential part of being a technical leader.&lt;/p&gt;
&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-382483256217583050?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/382483256217583050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/03/quotes-from-97-things-every-programmer.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/382483256217583050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/382483256217583050'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/03/quotes-from-97-things-every-programmer.html' title='Quotes from 97 Things Every Programmer Should Know'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7225170210398683133</id><published>2010-03-10T23:55:00.002+02:00</published><updated>2010-05-22T00:10:04.202+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><title type='text'>gem 1.3.6, Ruby 1.9 and FreeBSD</title><content type='html'>&lt;p&gt;Кстати о rubygems. Для несчастных владельцев gem'ов, кои требуется тихо
класть на rubygems.org, версия gem, которая идет в комплекте с ruby
1.9.1 лишена команды push. А без нее&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% gem push pkg/глюкало-0.1.3.gem
&lt;/pre&gt;
&lt;p&gt;не скажешь. Чтобы эта счастье там появилось, требуется обновить rubygems
командочкой &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;gem&lt;/span&gt; &lt;span class="pre"&gt;update&lt;/span&gt; &lt;span class="pre"&gt;--system&lt;/span&gt;&lt;/tt&gt;. Это все не является тайной, но
выполнивши указанную командочку под FreeBSD и набрав &lt;cite&gt;gem list&lt;/cite&gt;, мы
получим:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
*** LOCAL GEMS ***

(пустой список)
&lt;/pre&gt;
&lt;p&gt;Караул! Куда делись все мои инсталлированные gems?&lt;/p&gt;
&lt;p&gt;В начале этого года в freebsd-ruby мяли неверность gem path выглядевшую
как /usr/local/lib/ruby19/gems/1.9. В порту появился патч, исправлявший
ее на &amp;quot;правильную&amp;quot; /usr/local/lib/ruby/gems/1.9. После ручного
обновления rubygems, gem path снова сбрасывается на кривую
/usr/local/lib/ruby19/gems/1.9. Именно ее пытается прочесть новая версия
и, конечно, не находит там ни единого установленного gem'а.&lt;/p&gt;
&lt;p&gt;То есть, чтобы направить rubygems на истинный путь, вам придется руками
подредактировать файл
/usr/local/lib/ruby/site_ruby/1.9/rubygems/defaults.rb. Патч:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
--- defaults.rb.orig  2010-03-01 14:13:23.000000000 +0200
+++ defaults.rb       2010-03-01 14:13:38.000000000 +0200
&amp;#64;&amp;#64; -20,10 +20,6 &amp;#64;&amp;#64;
         if defined? RUBY_FRAMEWORK_VERSION then
               File.join File.dirname(ConfigMap[:sitedir]), 'Gems',
                                 ConfigMap[:ruby_version]
-    # 1.9.2dev reverted to 1.8 style path
-    elsif RUBY_VERSION &amp;gt; '1.9' and RUBY_VERSION &amp;lt; '1.9.2' then
-      File.join(ConfigMap[:libdir], ConfigMap[:ruby_install_name], 'gems',
-                ConfigMap[:ruby_version])
         else
               File.join(ConfigMap[:libdir], ruby_engine, 'gems',
                                 ConfigMap[:ruby_version])
&lt;/pre&gt;
&lt;p&gt;Теперь наберите:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% gem env | grep -A2 PATH
&lt;/pre&gt;
&lt;p&gt;и убедитесь что все работает как надо.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7225170210398683133?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7225170210398683133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/03/gem-136-ruby-19-and-freebsd.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7225170210398683133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7225170210398683133'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/03/gem-136-ruby-19-and-freebsd.html' title='gem 1.3.6, Ruby 1.9 and FreeBSD'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7278574459782457106</id><published>2010-03-10T22:52:00.000+02:00</published><updated>2010-03-10T22:53:17.518+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>podgraph</title><content type='html'>&lt;p&gt;If you are like me--a person who hates to fire up wysiwyg editors (or
even worse--an editor in a browser) to make a blog post, then you may
like a tiny Ruby program called &lt;strong&gt;podgraph&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It parses an XHTML file and creates a proper MIME mail from it. &amp;quot;Proper&amp;quot;
means that if you have included some local images in your html, they
will be encoded and bundled with the mail as &lt;em&gt;inline&lt;/em&gt; images (see
RFC2387).&lt;/p&gt;
&lt;p&gt;After creating the mail, podgraph can automatically send it somewhere,
probably to your mail-to-blog gateway.&lt;/p&gt;
&lt;p&gt;To install podgraph 0.0.1, make sure that you have Ruby 1.9 on your machine
and type as root:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# gem install podgraph
&lt;/pre&gt;
&lt;p&gt;For the help, type:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% ri Podgraph
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As starting &lt;a class="reference external" href="http://podgraph.posterous.com/"&gt;a brand new blog&lt;/a&gt; at
posterous.com, I came up with an old problem: &lt;em&gt;how to post to &amp;lt;my lousy
blog&amp;gt; from Emacs?&lt;/em&gt; There is no working posterous client for Emacs (at
least I don't know any), but thank g-d we can use just html emails for
simulating that.&lt;/p&gt;
&lt;p&gt;A long time ago before joining to Ruby camp, I fell in love with
python's reStructuredText. It gives me an ability not to struggle with
damn html tags but to write blog posts in (more or less) human readable
text and &lt;em&gt;then&lt;/em&gt; convert it to lame html.&lt;/p&gt;
&lt;p&gt;So, at the present time any posting to posterous looks like this:&lt;/p&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;&lt;p class="first"&gt;Editing (in Emacs) &lt;em&gt;file.rest&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Typing &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;gmake&lt;/span&gt;&lt;/tt&gt; in the directory with &lt;em&gt;file.rest&lt;/em&gt;. Makefile:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
PODGRAPH := ~/lib/software/alex/podgraph/trunk/bin/podgraph
#PODGRAPH := podgraph

.PHONY : clean html

XHTML := $(addsuffix .html,$(basename $(wildcard *.rest)))

all: html

.SUFFIXES: .rest .html .sent

.rest.html:
   rst2html -o koi8-r &amp;lt; $&amp;lt; &amp;gt; $&amp;#64;

.html.sent:
   $(PODGRAPH) $&amp;lt;
   touch $&amp;#64;

html: $(XHTML)

clean:
   rm -f *.html
&lt;/pre&gt;
&lt;p&gt;Which brings to me &lt;em&gt;file.html&lt;/em&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Previewing in the browser the result: &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;firefox3&lt;/span&gt; &lt;span class="pre"&gt;file.html&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Typing &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;gmake&lt;/span&gt; &lt;span class="pre"&gt;file.sent&lt;/span&gt;&lt;/tt&gt;--and podgraph suddenly creates the MIME mail
and delivers it to posterous.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Btw, the whole process tested only on FreeBSD. I don't see any possible
Linux quirks here, but if you'll find some, don't forget to tell me.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7278574459782457106?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7278574459782457106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/03/podgraph.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7278574459782457106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7278574459782457106'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/03/podgraph.html' title='podgraph'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6942862513008933442</id><published>2010-02-10T09:46:00.001+02:00</published><updated>2010-02-10T09:48:02.199+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>List installed packages sorted by date/size in FreeBSD</title><content type='html'>&lt;p&gt;For tcsh:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
alias pkg.size 'pkg_info | awk '\''{print $1}'\'' | xargs pkg_info -sQ | sort -n -t: -k2 -r | awk -F: '\''{printf(&amp;quot;%12s\t%s\n&amp;quot;, $2, $1)}'\'' '
alias pkg.date 'ls -ltT /var/db/pkg/*/+CONTENTS | sed -E &amp;quot;s/.*(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(.+)\/var\/db\/pkg\/(.+)\/\+CONTENTS/\1\2\3/&amp;quot;'
&lt;/pre&gt;
&lt;p&gt;Resize your browser window if you can't see the end of the lines. Pay
attention to all quotes in 2 lines above, otherwise aliases may not
work.&lt;/p&gt;
&lt;p&gt;Then, for example, you can print package list sorted by size:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% pkg.size
   277980976    jdk-doc-1.6.0.10
   158015255    diablo-jdk-1.6.0.07.02
         ...
        2226    bigreqsproto-1.0.2
        1815    font-micro-misc-1.0.0
&lt;/pre&gt;
&lt;p&gt;Or print package list sorted by installed date:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% pkg.date
Feb  9 10:46:06 2010 firefox-3.6,1
Feb  9 08:35:54 2010 inn-2.4.6_1
...
Jan  8 04:48:58 2009 pkg-config-0.23_1
Jan  8 04:48:57 2009 kbproto-1.0.3
&lt;/pre&gt;
&lt;p&gt;Not a big deal but still useful.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6942862513008933442?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6942862513008933442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/02/list-installed-packages-sorted-by.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6942862513008933442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6942862513008933442'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/02/list-installed-packages-sorted-by.html' title='List installed packages sorted by date/size in FreeBSD'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1411726177635484599</id><published>2010-02-05T02:52:00.001+02:00</published><updated>2010-05-22T00:12:08.007+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby'/><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><title type='text'>The answer to The Quiz from PragPub #8</title><content type='html'>&lt;p&gt;Зашифрованный код на ст. 37 журнала--кусок программы &lt;a class="reference external" href="http://bit.ly/bJmwsu"&gt;ELIZA переписанной
на Lua&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Расшифровщик на Ruby 1.9 можно &lt;a class="reference external" href="http://bit.ly/bWHRHq"&gt;взять отсюда&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Картинка процесса:&lt;/p&gt;
&lt;a class="reference external image-reference" href="http://farm5.static.flickr.com/4047/4330792439_b6782b1fd1_b.jpg"&gt;&lt;img alt="687 KB" src="http://farm5.static.flickr.com/4047/4330792439_b6782b1fd1.jpg" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1411726177635484599?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1411726177635484599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/02/answer-to-quiz-from-pragpub-8.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1411726177635484599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1411726177635484599'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/02/answer-to-quiz-from-pragpub-8.html' title='The answer to The Quiz from PragPub #8'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm5.static.flickr.com/4047/4330792439_b6782b1fd1_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7801411912151580042</id><published>2010-01-19T08:40:00.001+02:00</published><updated>2010-01-19T08:41:29.048+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startups'/><title type='text'>Quote of the day</title><content type='html'>&lt;p&gt;From &lt;a class="reference external" href="http://bit.ly/8RsVS0"&gt;TWiST #36 Bonus&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I don't need the advice. I don't ask for advice nor should you be
giving me advice. You are not qualify to give me advice &lt;strong&gt;if&lt;/strong&gt; your
website looks like it from 1998.&lt;/p&gt;
&lt;p class="attribution"&gt;&amp;mdash;Jason Calacanis&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;And you know what? Jason is totally right. I hate folks who just like to
wreck an idea only because they have never tried to do anything by
themselves.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7801411912151580042?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7801411912151580042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/01/quote-of-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7801411912151580042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7801411912151580042'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/01/quote-of-day.html' title='Quote of the day'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8789368406830027032</id><published>2010-01-15T07:23:00.001+02:00</published><updated>2010-01-15T07:25:25.285+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startups'/><title type='text'>Ахахаха!</title><content type='html'>&lt;p&gt;Как выяснилось из последнего (#51) &lt;a class="reference external" href="http://bit.ly/5dHrJw"&gt;The Startup Success Podcast&lt;/a&gt;, Патрик Фулей, в воодушевлении от льющихся
кругом в песок деньжищах, решил подставить ладошку--пойти в micro ISV.&lt;/p&gt;
&lt;p&gt;Начало питча детонирует:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Боб&lt;/em&gt;: Дай мне задать тебе вопрос. То есть, ты хочешь начать с Amazon
S3? Приведет ли это к тому, что ты будешь &lt;strong&gt;уволен из Microsoft&lt;/strong&gt;?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Патрик&lt;/em&gt;: Нет, &lt;strong&gt;потому что&lt;/strong&gt; я использую Silverlight 4, а там есть
новые фичи для drag &amp;amp; drop и выделения нескольких файлов--это делает
user experience гораздо более приятным.&lt;/p&gt;
&lt;p&gt;И я фактически буду хостить приложение на Windows Azure, то есть даже
если Amazon будет первым storage target, на которую я смотрю--это в
действительности не то, что я собираюсь имплементировать, ведь это
будет не единственная storage target, которую я собираюсь
рассматривать.&lt;/p&gt;
&lt;p&gt;Я буду также &lt;strong&gt;предположительно&lt;/strong&gt; давать возможность класть файлы на
Azure storage и нет никакой причины не делать ftp/sftp, ну вы знаете,
обычный file storage, etc.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Да уж. Как бы потом не пришлось, в порядке ответа на запросы клиентов
(например: um, silverlight? are you insane? omg, when this madness will
end?), не выкинуть Silverlight и окончательно не пересесть на соседнюю
комфортабельную тучу конкурентов, а то в текущей версии оно как попа
между 2-х стульев.&lt;/p&gt;
&lt;p&gt;Вообще, конечно, веселый сотрудник Microsoft, создающий пародию на
box.net с хранением пользовательского мусора на амазоне--это, надо
понимать, такое небрежное уведомление об широких взглядах и, можно даже
сказать, прогрессивной формуле &amp;quot;не конторой единой&amp;quot;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8789368406830027032?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8789368406830027032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2010/01/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8789368406830027032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8789368406830027032'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2010/01/blog-post.html' title='Ахахаха!'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7337614433645643504</id><published>2009-12-21T02:27:00.001+02:00</published><updated>2009-12-21T04:51:01.573+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>How to embed Glade XML files into an executable</title><content type='html'>&lt;p&gt;Ну, есть 2 способа:&lt;/p&gt;
&lt;ol class="arabic simple"&gt;
&lt;li&gt;&lt;a class="reference external" href="http://bit.ly/53oRCo"&gt;Популярный&lt;/a&gt;, когда создается relocatable ELF
object, который gcc присобачивает к исполняемому файлу. Портабельность
метода сомнительна.&lt;/li&gt;
&lt;li&gt;No-brainer, когда Glade'овский XML аккуратно запихивается в 1 строку в
header file. Строка получается большая.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Всем понятно, что я использую, разумеется, 2-й способ.&lt;/p&gt;
&lt;p&gt;Сперва мы пишем нехитрый ruby скрипт &lt;a class="reference external" href="http://gromnitsky.users.sourceforge.net/glade/glade2c.rb"&gt;glade2c.rb&lt;/a&gt;, который
читает XML файл и на stdout пишет вот такое:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
const char *glade_gui_ui_embedded = &amp;quot;&amp;quot;
&amp;quot;&amp;lt;?xml version=\&amp;quot;1.0\&amp;quot;?&amp;gt;\n&amp;quot;
&amp;quot;&amp;lt;interface&amp;gt;\n&amp;quot;
&amp;quot;  &amp;lt;requires lib=\&amp;quot;gtk+\&amp;quot; version=\&amp;quot;2.16\&amp;quot;/&amp;gt;\n&amp;quot;
[...]
&amp;quot;&amp;lt;/interface&amp;gt;\n&amp;quot;
&amp;quot;&amp;quot;;
&lt;/pre&gt;
&lt;p&gt;Что есть обещанная длинная строка.&lt;/p&gt;
&lt;p&gt;Далее, мы пишем в какой-то из .h файлов нашего проекта:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
extern const char *glade_gui_ui_embedded;
&lt;/pre&gt;
&lt;p&gt;и добавляем в Makefile что-то вроде (пример для GNU Make):&lt;/p&gt;
&lt;pre class="literal-block"&gt;
GLADE := foobar.glade
GLADE_EMBD := glade_gui_ui_embedded.c

OBJ += $(patsubst %.c,%.o,$(GLADE_EMBD))

$(GLADE_EMBD): $(GLADE)
        ./glade2c.rb $&amp;lt; &amp;gt; $&amp;#64;
&lt;/pre&gt;
&lt;p&gt;То есть, набирая &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;make&lt;/span&gt; &lt;span class="pre"&gt;glade_gui_ui_embedded.c&lt;/span&gt;&lt;/tt&gt; мы получаем
сгенерированный .c файл, где определена переменная
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;glade_gui_ui_embedded&lt;/span&gt;&lt;/tt&gt; и:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;в коде вызываем &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;gtk_builder_add_from_string()&lt;/span&gt;&lt;/tt&gt; вместо привычной
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;gtk_builder_add_from_file()&lt;/span&gt;&lt;/tt&gt;;&lt;/li&gt;
&lt;li&gt;продолжаем независимо от сборки утюжить свой &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;foobar.glade&lt;/span&gt;&lt;/tt&gt;, который
автоматически каждый раз при его изменении готовится для embedding.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Хотя лично мне gcc говорит страшное:&lt;/p&gt;
&lt;blockquote&gt;
glade_gui_ui_embedded.c:439: warning: string length '20359' is greater
than the length '4095' ISO C99 compilers are required to support&lt;/blockquote&gt;
&lt;p&gt;но, тем не менее, все отлично работает.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7337614433645643504?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7337614433645643504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/12/how-to-embed-glade-xml-files-into.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7337614433645643504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7337614433645643504'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/12/how-to-embed-glade-xml-files-into.html' title='How to embed Glade XML files into an executable'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6927938646888318331</id><published>2009-11-25T19:27:00.003+02:00</published><updated>2009-11-25T19:34:52.544+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='thinapp'/><title type='text'>iTunes and VMware ThinApp</title><content type='html'>&lt;p&gt;Попытайтесь представить себе, что вы смотрите как отражается свет от
поверхности HDD platter:&lt;/p&gt;
&lt;img alt="66 KB" src="http://farm3.static.flickr.com/2773/4132428570_f25005191a_o.jpg" /&gt;
&lt;p&gt;Но тут с огорчением чувствуете, как ваш организм перестает вас слушаться
и происходит вот такое:&lt;/p&gt;
&lt;p&gt;иэ... иэ... иэ... ыыыээаАПЧХИи.&lt;/p&gt;
&lt;p&gt;И вы смущенно хлопаете глазами и с жалостью поглядываете на, в общем,
симпатичную в прошлом пластину, которую теперь покрывает мокрота из
легочных альвеол.&lt;/p&gt;
&lt;p&gt;Именно так, мне кажется, поступает с диском боготворимая iTunes--по
крайней мере, та ее версия что работает (huh?) под Windows.&lt;/p&gt;
&lt;p&gt;Старательность и тщательность, с какой iTunes загаживает систему в
случайных местах, напоминает усердие жл^H^H провинциала, гребущего себе
домой кретиноскоп размером с гаражные ворота, хрусталь и картину &amp;quot;Вечер
у березы&amp;quot; в венецианской смальтовой раме с мозаикой.&lt;/p&gt;
&lt;p&gt;Можно, разумеется, ставить iTunes в VM, но есть еще один способ
дополнительно не засорять вашу неуютную Windows.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Application Virtualization&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;У VMware, например, есть &lt;a class="reference external" href="http://bit.ly/7qggm7"&gt;ThinApp&lt;/a&gt;, на выходе из
которого можно получить завернутый в 2 файла iTunes package, который:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;переписывается в любое место &lt;em&gt;обычного пользователя&lt;/em&gt; (не требует
официально установки и какого-либо дополнительного ПО);&lt;/li&gt;
&lt;li&gt;iTunes все скачанное держит в том же каталоге, что и сидит само;&lt;/li&gt;
&lt;li&gt;все записи в реестр, любые каталоги (кроме одного)--&lt;em&gt;запрещены&lt;/em&gt; и при
этом сам iTunes о таких запретах не имеет ни малейшего понятия;&lt;/li&gt;
&lt;li&gt;перенос каталога с iTunes на другую машину выглядит как копирование 1
каталога: все настройки и проч. сохраняются;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Понятно, что такие фокусы ThinApp может провернуть с практически любым
диплодоком.&lt;/p&gt;
&lt;p&gt;Выглядит интересующий нас каталог вот так:&lt;/p&gt;
&lt;img alt="14 KB" src="http://farm3.static.flickr.com/2563/4131905387_6bf5d4e691_o.png" /&gt;
&lt;p&gt;Где 6 сотен мегабайт в файле Bonjour.dat + 3 мегабайта iTunes.exe
составляют все что нужно конечному пользователю. Каталог Bonjour--это
виртуальная файловая система (и единственное место, куда разрешено
писать), что рождается после 1-го запуска iTunes.exe.&lt;/p&gt;
&lt;p&gt;cmd.exe, iexplore.exe и regedit.exe нужны только для debugging; если
пустить, например, cmd.exe тогда можно смотреть на свою реальную
файловую систему, на которую &amp;quot;наложена&amp;quot; виртуальная: какой вид есть то,
как себе представляет ситуацию в текущий момент аппликация
подготовленная ThinApp'ом.&lt;/p&gt;
&lt;p&gt;Например, из такого специального cmd.exe:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
c:\&amp;gt;dir &amp;quot;c:\Program Files\iTunes&amp;quot;
 Том в устройстве C не имеет метки.
 Серийный номер тома: DC4B-8921

 Содержимое папки c:\Program Files\iTunes

11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          .
11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          ..
11/12/2009  04:32 PM            59,083 Acknowledgements.rtf
11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          CD Configuration
11/12/2009  04:33 PM           722,160 CDDBControlApple.dll
11/12/2009  04:33 PM           648,480 iPodUpdaterExt.dll
11/12/2009  04:33 PM           111,912 ITDetector.ocx
11/12/2009  04:33 PM        14,769,448 iTunes.dll
11/12/2009  04:33 PM        10,358,048 iTunes.exe
11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          iTunes.Resources
11/12/2009  04:33 PM           384,800 iTunesAdmin.dll
11/12/2009  04:33 PM           211,232 iTunesHelper.dll
11/12/2009  04:33 PM           141,600 iTunesHelper.exe
11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          iTunesHelper.Resources
11/12/2009  04:33 PM           124,192 iTunesMiniPlayer.dll
11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          iTunesMiniPlayer.Resources
11/12/2009  04:33 PM           294,688 iTunesOutlookAddIn.dll
11/12/2009  04:33 PM           292,640 iTunesPhotoProcessor.exe
11/24/2009  11:17 AM    &amp;lt;DIR&amp;gt;          Mozilla Plugins
                              12 файлов     28,118,283 байт
                               7 папок  13,800,427,520 байт свободно
&lt;/pre&gt;
&lt;p&gt;То же, но из &amp;quot;настоящего&amp;quot; cmd:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
c:\&amp;gt;dir &amp;quot;c:\Program Files\iTunes&amp;quot;
 Том в устройстве C имеет метку Vista
 Серийный номер тома: 9832-7A28

 Содержимое папки c:\Program Files

Файл не найден
&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;How to create an iTunes package&lt;/strong&gt;&lt;/p&gt;
&lt;ol class="arabic" start="0"&gt;
&lt;li&gt;&lt;p class="first"&gt;Выбираете OC, под которую предполагается использовать созданный
package и делаете clean install ее в VMware Workstation или еще где.&lt;/p&gt;
&lt;p&gt;iTunes здесь имеет особенность: сделанный package в виртуальной XP
потом отказался работать на Vista. Приблизительно такой же эффект
можно получить, если накатить на XP (с установленным iTunes) Vista и
запустить потом iTunes, которая тяжело ругнется и нагло потребует
repair.&lt;/p&gt;
&lt;p&gt;(Btw, собранный package под Windows 7 счастливо заработал на Vista.)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Добавляете в VM виртуальный диск, который &lt;strong&gt;не&lt;/strong&gt; зависит от снапшотов
(persistent). То есть у вас VM должен иметь 2 диска: на 1-м сидит
Windows, а 2-й пока пустой.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Ставите в виртуальную машину ThinApp. Выключаете VM. Создаете
Snapshot.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Включаете VM и запускаете утилиту ThinApp Setup Capture.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Сканируете ей систему.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Ставите iTunes. Setup Capture продолжает висеть в памяти, записывая
(на 2-й диск VM, который persistent) весь непростительный harm,
который вы наносите этой установкой.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Опять сканируете систему с помощью Setup Capture--уже &lt;em&gt;после&lt;/em&gt;
инсталляции iTunes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Делаете Revert to Snapshot.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Build'ите package.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;Тестируете его и радуетесь. Если что не работает, идете в п.3 (чаще
п.8) и так до просветления.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Вся тонкость находится в п.8: как именно построить package, чтобы он а)
был безопасен (не писал, куда ему хочется) б) работал.&lt;/p&gt;
&lt;p&gt;Документация у ThinApp достаточно приличная, так что упомяну только
ключевые моменты.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Будьте внимательны к тому, куда пойдут файлы Virtual File System: в
каталог с package или куда-то в &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;c:\users\bob\thinapp&lt;/span&gt;&lt;/tt&gt;. Тут дело
вкуса.&lt;/li&gt;
&lt;li&gt;File System Access ставьте в &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;WriteCopy&lt;/span&gt;&lt;/tt&gt;. С режимом &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;Full&lt;/span&gt;&lt;/tt&gt;
плюгавый iTunes не разговаривает.&lt;/li&gt;
&lt;li&gt;Перед сборкой найдите все файлы ##Attributes.ini, в которых есть
строчка &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;DirectoryIsolationMode=Merged&lt;/span&gt;&lt;/tt&gt; и поменяйте ее на
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;DirectoryIsolationMode=WriteCopy&lt;/span&gt;&lt;/tt&gt; (таких файлов будет 3 штуки).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;FAQ&lt;/strong&gt;&lt;/p&gt;
&lt;table class="docutils field-list" frame="void" rules="none"&gt;
&lt;col class="field-name" /&gt;
&lt;col class="field-body" /&gt;
&lt;tbody valign="top"&gt;
&lt;tr class="field"&gt;&lt;th class="field-name"&gt;Q00:&lt;/th&gt;&lt;td class="field-body"&gt;&lt;p class="first"&gt;Package у меня выдает при запуске, что &amp;quot;The registry settings
used by iTunes for importing and burning CDs and DVDs are missing&amp;quot;. Что
делать?&lt;/p&gt;
&lt;table class="docutils field-list" frame="void" rules="none"&gt;
&lt;col class="field-name" /&gt;
&lt;col class="field-body" /&gt;
&lt;tbody valign="top"&gt;
&lt;tr class="field"&gt;&lt;th class="field-name"&gt;A:&lt;/th&gt;&lt;td class="field-body"&gt;Если вы пишите DVD посредством iTunes (зачем?)--расстраивайтесь,
иначе--игнорируйте.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr class="field"&gt;&lt;th class="field-name"&gt;Q01:&lt;/th&gt;&lt;td class="field-body"&gt;&lt;p class="first"&gt;iTunes запускается через пень-колоду: один раз нормально, а в во
второй, процесс itunes.exe набирает в рот памяти и больше ничего не
хочет делать.&lt;/p&gt;
&lt;table class="last docutils field-list" frame="void" rules="none"&gt;
&lt;col class="field-name" /&gt;
&lt;col class="field-body" /&gt;
&lt;tbody valign="top"&gt;
&lt;tr class="field"&gt;&lt;th class="field-name"&gt;A:&lt;/th&gt;&lt;td class="field-body"&gt;ThinApp имеет утилиту dll_dump.exe, которая покажет PID'ы всех
процессов от старых запусков iTunes. Грохните их.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6927938646888318331?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6927938646888318331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/11/itunes-and-vmware-thinapp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6927938646888318331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6927938646888318331'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/11/itunes-and-vmware-thinapp.html' title='iTunes and VMware ThinApp'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6094704616660457543</id><published>2009-11-21T15:43:00.005+02:00</published><updated>2009-12-25T11:19:20.675+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>FreeBSD 8.0 and VMWare Workstation</title><content type='html'>&lt;p&gt;&lt;i&gt;(For newcomers: есть &lt;a class="reference external" href="http://gromnitsky.blogspot.com/2009/05/freebsd-72-and-vmware-workstation.html"&gt;предыдущие&lt;/a&gt;
серии.)&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;Lots of refactoring and cleanup in the code, о которых пишут в
&lt;a class="reference external" href="news://gmane.comp.emulators.vmware.tools.announce"&gt;news://gmane.comp.emulators.vmware.tools.announce&lt;/a&gt;, говорит, с одной
стороны, о том что работа кипит, а с другой стороны, как испаряется,
вместе с монотонным понижением температуры на улице, мое терпение к
open-vm-tools.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Current status&lt;/strong&gt;&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;VMware Workstation 6.5.2.&lt;/div&gt;
&lt;div class="line"&gt;open-vm-tools: 2009.11.17-210370.&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="literal-block"&gt;
% uname -v
FreeBSD 8.0-RC3 #0: Tue Nov 10 07:50:36 UTC 2009 root&amp;#64;almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Не работает&lt;/em&gt;:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;hgfs (ядерный модуль, как всегда, вводит guest в панику при попытке
монтирования). Это значит, что shared folders не работают.&lt;/li&gt;
&lt;li&gt;Drag-and-Drop. Несмотря, на его полу-работающее состояние в прошлых
open-vm-tools, ничего путного от текущей версии добиться не получилось.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;В конце-концов я решил собрать свой вариант порта open-vm-tools, в
котором выкинут неработающий мусор и сборка происходит с минимальными
dependencies.&lt;/p&gt;
&lt;p&gt;В принципе, можно конечно менерно не обновляться (как в FreeBSD 7.2 у
меня до сих пор висят open-vm-tools-154848_2 от марта с.г.), но у
vmtoolsd в старых версиях, например, течет память и он постепенно
пухнет, опухает, тяжело ворочается и становиться неуклюжим.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Что полезного в порту&lt;/strong&gt;&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Мелкие утилиты (vmware-toolbox, vmware-rpctool, etc).&lt;/li&gt;
&lt;li&gt;демон vmtoolsd с plugin'ом для синхронизации времени host&amp;lt;-guest (в
комплект входит rc.subr).&lt;/li&gt;
&lt;li&gt;vmware-user для copy &amp;amp; paste между host и guest. Кроме того, ему
запрещено изменять screen resolution в guest (потому что это меня дико
раздражало).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Все остальное выкусано. Для сборки нужен только Gtk 2.16. vmware-user
должен запускаться где-то в районе &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;~/.xinitrc&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Скачать порт можно &lt;a class="reference external" href="http://gromnitsky.users.sourceforge.net/open-vm-tools/open-vm-tools-minimum-217847.tar.gz"&gt;вот тут&lt;/a&gt;.
Собирать, как обычно, а) распаковав архив куда глаза глядят и б) набрав:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# cd open-vm-tools-minimum
# make install clean
&lt;/pre&gt;
&lt;p&gt;А по окончанию инсталляции, добавить в &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;/etc/rc.conf&lt;/span&gt;&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
vmware_vmtoolsd_enable=YES
&lt;/pre&gt;
&lt;p&gt;и запустить демон vmtoolsd:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# /usr/local/etc/rc.d/vmware_vmtoolsd start
&lt;/pre&gt;
&lt;p&gt;Btw, если у вас установлены проприетарные vmware tools или версия
open-vm-tools из официальных портов FreeBSD, тогда удалите их сперва
перед установкой этого порта и вычистите память от загруженных старых
ядерных модулей и демонов.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Xorg 7.4&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Т.к. драйверы мыши и видеокарты для VMware давно идут вместе c Xorg и
есть в портах FreeBSD (x11-drivers/xf86-input-vmmouse и
x11-drivers/xf86-video-vmware), все что тут можно посоветовать это:&lt;/p&gt;
&lt;ol class="arabic"&gt;
&lt;li&gt;&lt;p class="first"&gt;не давайте свежим иксам говорить с HAL касательно мыши--добавьте в
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;/etc/X11/xorg.conf&lt;/span&gt;&lt;/tt&gt; в секцию ServerLayout:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
Option   &amp;quot;AutoAddDevices&amp;quot; &amp;quot;false&amp;quot;
&lt;/pre&gt;
&lt;p&gt;и в секцию InputDevice для мыши:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
Driver   &amp;quot;vmmouse&amp;quot;
&lt;/pre&gt;
&lt;p&gt;и в &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;/etc/rc.conf&lt;/span&gt;&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
moused_port=/dev/psm0
moused_type=auto
moused_enable=YES
moused_flags=&amp;quot;-r high&amp;quot;
&lt;/pre&gt;
&lt;p&gt;(после чего наберите:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# /etc/rc.d/moused restart
&lt;/pre&gt;
&lt;p&gt;в cons25 у вас &lt;em&gt;должен&lt;/em&gt; появится работающий курсор, иначе иксы без
HAL не поймут где ваша мышь)&lt;/p&gt;
&lt;p&gt;Если вы этого не сделаете--ожидайте хаотчески скачущего курсора и
паршивого настроения.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;убедитесь, что в секции Device в &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;/etc/X11/xorg.conf&lt;/span&gt;&lt;/tt&gt; стоит правильный
драйвер:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
Driver   &amp;quot;vmware&amp;quot;
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;если screen resolution в вашего лэптопа 1280x800, добавьте в секцию
Monitor в &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;/etc/X11/xorg.conf&lt;/span&gt;&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
HorizSync    1-10000
VertRefresh  1-10000
Modeline     &amp;quot;1280x800&amp;quot;  70.00   1280 1312 1344 1376  800 801 804 850
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p class="first"&gt;поглядеть на минимальный готовый &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;xorg.conf&lt;/span&gt;&lt;/tt&gt; для Xorg 7.4 под FreeBSD
8 можно &lt;a class="reference external" href="http://gromnitsky.users.sourceforge.net/open-vm-tools/xorg.conf"&gt;вот здесь&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;(2009-11-22 Update)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Как оказалось, бегемот vmware-user кое как разрешает работать в &lt;a class="reference external" href="http://bit.ly/7fsO38"&gt;Unity
Mode&lt;/a&gt; (a feature that allows seamless
integration of applications with the host desktop), ежели у вас имеется
Workstation 6.5+. В порт добавилась 1 опция WITH_UNITY. Значит, набирая:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# make WITH_UNITY=1 install clean
&lt;/pre&gt;
&lt;p&gt;можно (запустив vmware-user в иксах) кликнуть в меню Workstation
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;View-&amp;gt;Unity&lt;/span&gt;&lt;/tt&gt; и наблюдать чудеса.&lt;/p&gt;
&lt;p&gt;Правда, при таком режиме сборки порта, придется забыть про выковыривания
из vmware-user пакости в виде измененияя screen resolution в guest, так
что мой совет: соберайте без Unity--работает оно в связке Vista &amp;lt;-&amp;gt;
FreeLSD 8 отвратительно медленно. Но выглядит, конечно, солидно. Но
все-таки медленно. Но зато солидно.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Network and Sound&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Тут новостей нет. Без всяких твиков с .vmx-файлами, FreeBSD в
Workstation 6.5+ сразу видит сетевую карту как эмо, то есть я хочу
сказать, как em0:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% ifconfig em0
em0: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt; metric 0 mtu 1500
        options=9b&amp;lt;RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM&amp;gt;
        ether 00:0c:29:a0:8d:b7
        inet 192.168.8.133 netmask 0xffffff00 broadcast 192.168.8.255
        media: Ethernet autoselect (1000baseT &amp;lt;full-duplex&amp;gt;)
        status: active
&lt;/pre&gt;
&lt;p&gt;Ядерный модуль vmxnet нужен только тому, кто любит составлять тикеты о
багах, поэтому если это нерелевантно для вас, вы vmxnet лучше не
используйте.&lt;/p&gt;
&lt;p&gt;Звук, как и раньше, включается посредством:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# kldload snd_es137x
&lt;/pre&gt;
&lt;p&gt;Пожалуй, на сегодня таки все.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6094704616660457543?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6094704616660457543/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/11/freebsd-80-and-vmware-workstation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6094704616660457543'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6094704616660457543'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/11/freebsd-80-and-vmware-workstation.html' title='FreeBSD 8.0 and VMWare Workstation'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8273869358420056204</id><published>2009-11-07T20:25:00.001+02:00</published><updated>2009-11-07T20:27:32.452+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='books'/><title type='text'>Quotes from Apprenticeship of Patterns</title><content type='html'>&lt;p&gt;&lt;a class="reference external" href="http://bit.ly/2vRLSc"&gt;The book&lt;/a&gt; contains 35 &lt;em&gt;apprenticeship
patterns&lt;/em&gt; (see below), mostly suited for young and/or inexperienced
programmers. 8 of them appears to be more or less useful for me, or
speaking by the card, 8 of 35 patterns that are worth reading.&lt;/p&gt;
&lt;p&gt;N.B.&lt;/p&gt;
&lt;blockquote&gt;
&lt;em&gt;An apprenticeship pattern&lt;/em&gt; attempts to offer guidance to someone
working with the craft model on the ways in which they can improve the
progress of their career.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Expose Your Ignorance&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Show the people who are depending on you that the learning process is
part of delivering software. Let them see you grow.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;Software craftsmen build their reputations through strong
relationships with their clients and colleagues. Conceding to unspoken
pressures and telling people what they want to hear is not a good way
to build strong relationships. Tell people the truth. Let them know
that you're starting to understand what they want and you're in the
process of learning how to give it to them. If you reassure them,
reassure them with your ability to learn, not by pretending to know
something you don't. In this way, your reputation will be built upon
your learning ability rather than what you already know.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;The Deep End&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
Jump in at the deep end. Waiting until you're ready can become a
recipe for never doing a thing. So when you're offered a high-profile
role or a difficult problem, grasp it with both hands. Growth only
happens by taking on the scary jobs and doing things that stretch you.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;A Different Road&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
[...] Ade's mentor [...] described how he went off to a Greek island
for six months to become a windsurfing instructor after his first IT
job. He found that he liked teaching windsurfing, but it wasn't
entirely satisfying because he never got to use his brain. Afterward,
it was hard for him to get back into the industry because &amp;quot;most HR
people in big companies didn't like it.&amp;quot;&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Be the Worst&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Surround yourself with developers who are better than you. Find a
stronger team where you are the weakest member and have room to grow.&lt;/p&gt;
&lt;p&gt;[...] as the weakest member of the team, you should be working harder
than anyone else. This is because the goal is not to stay the weakest,
but to start at the bottom and work your way up.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Reflect As You Work&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
[...] it is quite easy to repeat the same year of experience 10 times
without making significant progress in your abilities. In fact, this
sometimes can turn into anti-experience: the phenomenon where every
additional year or experience merely reinforces the bad habits you
have picked up. This is why your goal should be to become skilled
rather than experienced.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Record What You Learn&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
Try to avoid falling into the trap of just writing down your lessons
and forgetting them. Your notebook, blog, or wiki should be a nursery,
not a graveyard lessons should be born from this record, rather than
going there to die.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Create Feedback Loops&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
[...] the less skilled you are, the worse you are at assessing the
skills of yourself and others.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Dig Deeper&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
One thing you will learn from trying to apply this pattern is that
gaining deep knowledge is hard. This is why most people's knowledge of
the computer science that supports software development is a mile wide
and an inch thick. It is easier and often more profitable to depend on
other people's knowledge of the fundamentals than to spend the extra
effort to acquire it yourself. You can tell yourself that you can
always learn it when you need it; however, when that day comes you'll
need to know everything by the end of the week, but it will take a
month just to learn all the prerequisites.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8273869358420056204?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8273869358420056204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/11/quotes-from-apprenticeship-of-patterns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8273869358420056204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8273869358420056204'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/11/quotes-from-apprenticeship-of-patterns.html' title='Quotes from Apprenticeship of Patterns'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8556681699391891427</id><published>2009-10-28T16:30:00.002+02:00</published><updated>2010-05-22T00:13:25.174+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><category scheme='http://www.blogger.com/atom/ns#' term='development'/><category scheme='http://www.blogger.com/atom/ns#' term='tcl'/><title type='text'>SparkBuild, GNU make and Tcl</title><content type='html'>&lt;p&gt;&lt;a class="reference external" href="http://bit.ly/3bZS7E"&gt;Eric Melski&lt;/a&gt; из Электрической Тучи, вчера
написал об утилите, которая подменяет собою gmake и генерирует (в
процессе сборки) XML файл, в котором можно потом обнаружить всякую
интересную статистику.&lt;/p&gt;
&lt;p&gt;Утилита называется &lt;a class="reference external" href="http://bit.ly/1JAgpY"&gt;SparkBuild&lt;/a&gt; и она
бесплатна. &lt;em&gt;Не&lt;/em&gt; open source, но ее можно свободно использовать для
коммерческих проектов.&lt;/p&gt;
&lt;p&gt;SparkBuild состоит из 2-х главных компонентов:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;emake, который (как обещают) и есть drop-in замена GNU Make.&lt;/li&gt;
&lt;li&gt;sbinsight, который парсит output из emake и рисует графики, таблички и
проч.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;emake написана на C++ и Boost; sbinsight--это Tcl/Tk 8.5+ (симпатичные
виджеты из 8.5 выдают себя моментально). Как используется Тикль в
sbinsight--вопрос интересный. Судя по наличию tclKitInit и Mk4tcl в
потрохах скомпилированного sbinsight, это разновидность Starpack'а.&lt;/p&gt;
&lt;p&gt;В качестве теста, я попробовал собрать Texinfo 4.13 с помощью
SparkBuild. Хотя последний распространяется только для Windows и
лайнукса, у меня все чудесно заработало на FreeBSD 7.2 и:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% pkg_info | grep ^linux
linux-f8-expat-2.0.1_1 Linux/i386 binary port of Expat XML-parsing library (Linux
linux-f8-fontconfig-2.4.2_1 An XML-based font configuration API for X Windows (Linux Fe
linux-f8-xorg-libs-7.3_3 Xorg libraries (Linux Fedora 8)
linux_base-f8-8_11  Base set of packages needed in Linux mode (for i386/amd64)
&lt;/pre&gt;
&lt;p&gt;Итак.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% pwd
/home/alex/ports/texinfo
% make configure
[...]

% cd work/texinfo-4.13
&lt;/pre&gt;
&lt;p&gt;Теперь наступает самое интересное. Вместо пускания gmake, набираем:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% emake --emake-annodetail=basic,waiting,env | tee anno.xml
&lt;/pre&gt;
&lt;p&gt;И вместо привычного make output, на stdout вылазит гора XML'а, и после
конца сборки у нас появляется файл:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% ls -l anno.xml
-rw-r--r--  1 alex  wheel  367670 Oct 28 15:22 anno.xml
&lt;/pre&gt;
&lt;p&gt;Желаю вам успеха в его чтении глазами. В поставке SparkBuild есть
Tcl-утилитка anno2log, которая выковыривает из anno.xml то, что писал бы
на stdout gmake. То есть, в теории, можно пустить emake вот так:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% emake --emake-annodetail=basic,waiting,env | tee anno.xml | anno2log
&lt;/pre&gt;
&lt;p&gt;На практике, текущая версия anno2log буферизирует stdout, поэтому
результат видно только по окончанию сборки.&lt;/p&gt;
&lt;p&gt;Чтобы полюбоваться на статистику (то, ради чего), печатаем:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
% sbinsight anno.xml &amp;amp;
&lt;/pre&gt;
&lt;a class="reference external image-reference" href="http://farm3.static.flickr.com/2743/4053014228_b8dffaaf23_o.png"&gt;&lt;img alt="24 KB" src="http://farm3.static.flickr.com/2743/4053014228_636fb08974.jpg" /&gt;&lt;/a&gt;
&lt;p&gt;Информация о конкретной target:&lt;/p&gt;
&lt;a class="reference external image-reference" href="http://farm4.static.flickr.com/3531/4053014232_4b8ae56fe1_o.png"&gt;&lt;img alt="7 KB" src="http://farm4.static.flickr.com/3531/4053014232_ba82449561.jpg" /&gt;&lt;/a&gt;
&lt;p&gt;График симуляции сборки texinfo на кластере:&lt;/p&gt;
&lt;img alt="3 KB" src="http://farm3.static.flickr.com/2784/4053014240_7b069a2b5c_o.png" /&gt;
&lt;p&gt;Кластерная сборка, естественно и к несчастью, в SparkBuild не входит,
потому что она есть главный продукт Электрической Тучи имени Джона
Остераута.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8556681699391891427?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8556681699391891427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/10/sparkbuild-gnu-make-and-tcl.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8556681699391891427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8556681699391891427'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/10/sparkbuild-gnu-make-and-tcl.html' title='SparkBuild, GNU make and Tcl'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2743/4053014228_636fb08974_t.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4394560319178600378</id><published>2009-10-14T10:43:00.002+03:00</published><updated>2009-10-14T10:47:02.888+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><title type='text'>Quotes from Coders at Work</title><content type='html'>&lt;div&gt;
&lt;p&gt;4 of 15 &lt;a class="reference external" href="http://bit.ly/gopjA"&gt;interview&lt;/a&gt; are good, 8 are brilliant, 1
is totally useless and 2 are boring.&lt;/p&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="76%" /&gt;
&lt;col width="24%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head"&gt;Person&lt;/th&gt;
&lt;th class="head"&gt;Rating&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;Jamie Zawinski&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Brad Fitzpatrick&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Douglas Crockford&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Brendan Eich&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Joshua Bloch&lt;/td&gt;
&lt;td&gt;8&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Joe Armstrong&lt;/td&gt;
&lt;td&gt;9&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Simon Peyton Jones&lt;/td&gt;
&lt;td&gt;5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Peter Norvig&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Guy Steele&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Dan Ingalls&lt;/td&gt;
&lt;td&gt;6&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;L Peter Deutsch&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ken Thompson&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Fran Allen&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Bernie Cosell&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Donald Knuth&lt;/td&gt;
&lt;td&gt;10&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;strong&gt;Jamie Zawinski&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So I write a new [Emacs byte] compiler and Stallman's response is, &amp;quot;I
see no need for this change.&amp;quot; And I'm like, &amp;quot;What are you talking
about? It generates way faster code.&amp;quot; Then his next response is,
&amp;quot;Okay, uh, send me a diff and explain each line you changed.&amp;quot;  &amp;quot;Well,
I didn't do that--I rewrote it because the old one was crap.&amp;quot;  That
was not OK.  The only reason it ever got folded in was because I
released it and thousands of people started using it and they loved it
and they nagged him for two years and finally he put it in because he
was tired of being nagged about it.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;There was actually a point, early on in Netscape, where part of our
build process involved running &amp;quot;emacs -batch&amp;quot; to manipulate some
file. No one really appreciated that.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Brad Fitzpatrick&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Before I had any official job, I got some hosting account. I got
kicked off of AOL for writing bots, flooding their chat rooms, and
just being annoying. [...] I also wrote a bot to flood their online
form to send you a CD. I used every variation of my name, because I
didn't want their duplicate suppression to only send me one CD,
because they had those 100 free hours, or 5,000 free hours. I
submitted this form a couple thousand times and for a week or so the
postman would be coming with bundles of CDs wrapped up.&lt;/p&gt;
&lt;p&gt;My mom was like, &amp;quot;Damn it, Brad, you're going to get in trouble.&amp;quot; I
was like, &amp;quot;Eh their fucking fault, right?&amp;quot; Then one day I get a phone
call and I actually picked up the phone, which I normally didn't, and
it was someone from AOL. They were just screaming at me. &amp;quot;Stop sending
us all these form submissions!&amp;quot; I'm not normally this quick and
clever, but I just yelled back, &amp;quot;Why are you sending me all this crap?
Every day the postman comes! He's dropping off all these CDs!&amp;quot; They're
like, &amp;quot;We're so sorry, sir. It won't happen again.&amp;quot; Then I used all
those and I decorated my dorm room in college with them. I actually
still have them in a box in the garage.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Douglas Crockford&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I've managed projects where we're up against a deadline and we had
people saying, &amp;quot;Yeah, I'm almost done,&amp;quot; and then you get the code, and
there's nothing there, or it's crap, or whatever, and they're nowhere
close to done.  In management, those are the experiences you hate the
most and I think code reading is the best way of not getting trapped
like that.&lt;/p&gt;
&lt;p&gt;[...] it [code reading] requires a lot of trust on the part of the
team members so there have to be clear rules as to what's in bounds
and what's not. If you had a dysfunctional team, you don't want to be
doing this, because they'll tear themselves apart. And if you have a
dysfunctional team and you're not aware of it, this will reveal it
pretty quickly. There's a lot that you can learn, a lot that's
revealed by this process. It feels unnatural at first, although once
you get into the rhythm of it, it feels extremely natural.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Brendan Eich&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
I'm secure enough to think I could go do something that was a fine sky
castle for myself, but I'm realist enough to know that it would be
only for myself and probably not fine for other people. And what's the
point? &amp;quot;If I'm only for myself&amp;quot;, you know, Hillel the elder, &amp;quot;what am
I?&amp;quot; I am not JavaScript. In the early days, it was such a rush job and
it was buggy and then there was some Usenet post Jamie Zawinski
forwarded me. He said, &amp;quot;They're calling your baby ugly.&amp;quot; I have real
kids now; I don't have to worry about that.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Joe Armstrong&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I think the lack of reusability comes in object-oriented languages,
not in functional languages. Because the problem with object-oriented
languages is they've got all this implicit environment that they carry
around with them. You wanted a banana but what you got was a gorilla
holding the banana and the entire jungle.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;Are you driven by the problems or by the solutions? I tend to favor
the people who say, &amp;quot;I've got this really interesting problem.&amp;quot; Then
you ask, &amp;quot;What was the most fun project you ever wrote; show me the
code for this stuff. How would you solve this problem?&amp;quot; I'm not so
hung up on what they know about language X or Y.  From what I've seen
of programmers, they're either good at all languages or good at
none. The guy who s a good C programmer will be good at Erlang--it's
an incredibly good predictor.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Peter Norvig&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
They [NASA] aren't software guys. They say, &amp;quot;Software is this
necessary evil. Straight line code, I can sort of understand; if it's
got a loop in it, that's kind of iffy. Then if there's a branch
statement inside the loop, ooooh, that's getting away from what I can
solve with a differential equation in control theory.&amp;quot;  So they're
distrustful.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;L Peter Deutsch&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So basically that's what I did [Ghostscript]--data structures
first. Rough division into modules. My belief is still, if you get the
data structures and their invariants right, most of the code will just
kind of write itself.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Seibel&lt;/em&gt;: I think Larry Wall described it [Python] as a bowl of
oatmeal with fingernail clippings in it.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Deutsch&lt;/em&gt;: Well, my description of Perl is something that looks like
it came out of the wrong end of a dog. I think Larry Wall has a lot of
nerve talking about language design--Perl is an abomination as a
language.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Ken Thompson&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I've never been a lover of existing code. Code by itself almost rots
and it's gotta be rewritten. Even when nothing has changed, for some
reason it rots.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Seibel&lt;/em&gt;: I know Google has a policy where every new employee has to get
checked out on languages before they're allowed to check code
in. Which means you had to get checked out on C.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thompson&lt;/em&gt;: Yeah, I haven't been.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Seibel&lt;/em&gt;: You haven't been! You're not allowed to check in code?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thompson&lt;/em&gt;: I'm not allowed to check in code, no.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Seibel&lt;/em&gt;: You just haven't gotten around to it, or you have philosophical
objections to the Google coding standard?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thompson&lt;/em&gt;: I just haven't done it. I've so far found no need to.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;I would try out the language as it was being developed and make
comments on it. It was part of the work atmosphere there [AT&amp;amp;T]. And
you'd write something and then the next day it [C++] wouldn't work
because the language changed. It was very unstable for a very long
period of time. At some point I said, no, no more.&lt;/p&gt;
&lt;p&gt;In an interview I said exactly that, that I didn't use it just because
it wouldn't stay still for two days in a row. When Stroustrup read the
interview he came screaming into my room about how I was undermining
him and what I said mattered and I said it was a bad language. I never
said it was a bad language. On and on and on. Since then I kind of
avoid that kind of stuff.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Bernie Cosell&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
Programmers are the worst optimizers in the world. They always
optimize the part of the code that's most interesting to optimize, and
almost never get the part of the code that actually needs
optimization. So you get these little nuts of very difficult code that
have no point.&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;Donald Knuth&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Like in the parts that I'm writing now, I'm starting out with stuff
that's in math journals that is written in jargon that I wouldn't
expect very many programmers to ever learn, and I'm trying to
dejargonize it to the point where I can at least understand it. I try
to give the key ideas and I try to simplify them the best I can, but
then what happens is every five pages of my book is somebody's career.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;The first rule of writing is to understand your audience--the better
you know your reader the better you can write, of course. The second
rule, for technical writing, is say everything twice in complementary
ways so that the person who's reading it has a chance to put the ideas
into his or her brain in ways that reinforce each other.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;The problem is that coding isn't fun if all you can do is call things
out of a library, if you can't write the library yourself. If the job
of coding is just to be finding the right combination of parameters,
that does fairly obvious things, then who'd want to go into that as a
career?&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;We already talked about literate programming--that's a radical
departure, that I'm viewing myself as an expositor rather than trying
to just put together the right instructions. Dijkstra came out with
that same evolution. In the end his programs were even more literate
than mine in the sense that they didn't even go into the machine. They
were &lt;em&gt;only&lt;/em&gt; literate.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;I always try things that are at my limit. If I had to go back and
write those kinds of programs again, the easier ones, I wouldn't make
so many mistakes. But now that I know some more, I'm trying to write
harder stuff. So I make mistakes because I'm always operating at my
limit. If I only stay in comfortable territory all the time, that's
not so much fun.&lt;/p&gt;
&lt;p&gt;[...]&lt;/p&gt;
&lt;p&gt;So inevitably we're going to have bugs unless we decide we're never
going to write anything that stretches our capabilities.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4394560319178600378?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4394560319178600378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/10/quotes-from-coders-at-work.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4394560319178600378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4394560319178600378'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/10/quotes-from-coders-at-work.html' title='Quotes from Coders at Work'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1266670568497222871</id><published>2009-10-04T19:44:00.000+03:00</published><updated>2010-05-22T00:13:25.174+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='tcl'/><title type='text'>time value too large/small to represent</title><content type='html'>&lt;p&gt;После перезагрузки виртуальной машины, в жерле которой мирно крутятся
некоторые Tcl CGI скрипты, эти самые скрипты &lt;em&gt;внезапно&lt;/em&gt; перестали
работать, выплевывая вот такое сообщение:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
time value too large/small to represent
    while executing
&amp;quot;::tcl::clock::ConvertLocalToUTC $date[set date {}]  $TZData($timeZone)  $changeover&amp;quot;
    (procedure &amp;quot;::tcl::clock::scanproc'%A, %d %B %Y, %T'c&amp;quot; line 33)
&lt;/pre&gt;
&lt;p&gt;Это была реакция на самую невинную комманду:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
clock scan {Monday, 28 September 2009, 22:11:00} -format {%A, %d %B %Y, %T}
&lt;/pre&gt;
&lt;p&gt;Конечно, она замечательно исполняется, если ее попробывать, например в
tkcon. В же чем проблема?&lt;/p&gt;
&lt;p&gt;Как оказалось, environment variable &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;TZ&lt;/span&gt;&lt;/tt&gt; при старте Apache (еще до
login prompt в FreeBSD) не успевает быть установленной--то есть Apache ее
inherit, если она есть. А для этого нужно:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# setenv TZ Europe/Kiev
# /usr/local/etc/rc.d/apache22 restart
&lt;/pre&gt;
&lt;p&gt;И тогда все начинает опять работать правильно. Капитан Очевидность
потирает руки.&lt;/p&gt;
&lt;p&gt;Или, можно, на всякий случай, всегда устанавливать &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;TZ&lt;/span&gt;&lt;/tt&gt; руками в
Tcl-скрипте:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
set env(TZ) Europe/Kiev
&lt;/pre&gt;
&lt;p&gt;Или, сделать вот такой симлинк:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
# ln -s /usr/share/zoneinfo/Europe/Kiev /etc/localtime
&lt;/pre&gt;
&lt;p&gt;Последний способ, по идее, есть самый универсальный.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1266670568497222871?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1266670568497222871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/10/time-value-too-largesmall-to-represent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1266670568497222871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1266670568497222871'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/10/time-value-too-largesmall-to-represent.html' title='time value too large/small to represent'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7446529928846224216</id><published>2009-09-22T10:21:00.001+03:00</published><updated>2009-09-22T10:25:32.730+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='startups'/><title type='text'>Charlatanism and something 2.0</title><content type='html'>&lt;p&gt;Как это возможно, что в 2009-м году на TechCrunch50 DemoPit были вот
такие кретины:&lt;/p&gt;
&lt;blockquote&gt;
&lt;em&gt;Moonit&lt;/em&gt; is a social compatibility tool that is rooted in astrological
and psychological underpinnings. We use thousands of years of data
from the stars to help determine whether two people are compatible
from a romantic, platonic and professional perspective.&lt;/blockquote&gt;
&lt;p&gt;Понятно, что дальше &lt;a class="reference external" href="http://www.techcrunch50.com/2009/the-demopit/"&gt;DemoPit'а&lt;/a&gt; их никто не пустил, но
факт из появления меня смешит и раздражает одновременно. Осталось с
нетерпением ждать стартапов по написанию прямых посланий к богам,
органайзеров молитв, q&amp;amp;a по проблемам праведной жизни и проч. шелупони.&lt;/p&gt;
&lt;p&gt;Комментарий на &lt;a class="reference external" href="http://www.techcrunch.com/2009/09/21/do-you-believe-in-magic-moonit-looks-to-the-stars-for-relationship-advice/"&gt;TechCrunch&lt;/a&gt;
гениальный:&lt;/p&gt;
&lt;blockquote&gt;
You should try and see if Arrington is more compatible with his dog
than you are.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7446529928846224216?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7446529928846224216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/09/charlatanism-and-something-20.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7446529928846224216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7446529928846224216'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/09/charlatanism-and-something-20.html' title='Charlatanism and something 2.0'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4714104703485077810</id><published>2009-07-13T18:40:00.003+03:00</published><updated>2009-07-13T18:43:23.275+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Таковы затруднительные вопросы</title><content type='html'>&lt;p&gt; Комментаторы в &lt;a
href='http://torvalds-family.blogspot.com/2009/07/not-so-evil-empire.html'&gt;блоге
Торвальдса&lt;/a&gt; -- это люди, которые тяжело страдают от отсутствия
собственной персоны на &lt;a href='http://superuser.com'&gt;superuser.com&lt;/a&gt;
и поэтому ведут себя так, как будто Линус -- не Линус вовсе, а какая-то
девочка из жиже. То есть, им очень хочется что-то посоветовать, но
некому.  &lt;/p&gt;

&lt;p&gt;Какого диаметра нужно иметь сквозное отверстие в голове, чтобы
рассказывать Торвальдсу о том, что можно: &lt;/p&gt;

&lt;p&gt;
&lt;ul&gt;
&lt;li&gt; в Linksys поставить OpenWRT &lt;i&gt;to teach your router some fancy
  tricks&lt;/i&gt;;

&lt;li&gt; проверить скорость соединения на speedtest.net;

&lt;li&gt; поставить Debian на старый компьютер бабушки и использовать его как
  router.
&lt;/ul&gt;
&lt;/p&gt;

&lt;p&gt; Думаю, надо еще побежать напечатать как настраивать firewall, и
объяснить на всякий случай, что лайнукс -- это не операционная система,
а ядро, а не то пропадет несчастный блоггер Линус почем зря и погрязнет
в своем неведении, как Эмпедокл во вражде как причине бытия.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4714104703485077810?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4714104703485077810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/07/blog-post_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4714104703485077810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4714104703485077810'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/07/blog-post_13.html' title='Таковы затруднительные вопросы'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-5541079017866866486</id><published>2009-07-12T18:24:00.003+03:00</published><updated>2009-07-17T01:10:25.189+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><title type='text'>Июльские новости</title><content type='html'>&lt;p&gt;Вышла новая версия &lt;a
href='http://uraniacast.sourceforge.net/'&gt;uraniacast 0.14&lt;/a&gt;. Теперь с
ней можно автоматически обрабатывать загруженные файлы с подкастов
(самое очевидное тут применение: изменение id3v1/id3v2 tags для mp3 и
преобразование из ogg в mp3). В остальных виденных мною podcatcher'ов
пост обработка либо отсутствует вообще, либо доступна только та, какую
предусмотрел автор podcatcher'а (что является, разумеется,
отвратительным виндоморонством).  &lt;/p&gt;

&lt;p&gt;
В глюкале uraniacast (арт.нумер 0.14) все сделано иначе. После всех
загруженных файлов имеется список тех, кои подлежат внешнему
treatment. Обработка опциональна и настраивается для каждой feed
индивидуально. В простейшем случаи, внешний обработчик -- это sh-скрипт,
возможные параметры которого вы выбираете сами (как? читайте
документацию). То есть, сбыточность того, что конкретно можно автоматически
сделать с полученным файлом ограничиваются только кривыми руками
пользователя.
&lt;/p&gt;

&lt;p&gt;
Так.
&lt;/p&gt;

&lt;p&gt;
Чешутся написать руки об еще какой нибудь ерунде. Вот к примеру, Firefox
3.5. Не понимаю злобных критиков. Хороший релиз. Помню я как-то отчаянно
накатал возмущенный пост, как якобы нельзя добиться в Location (URL) Bar
fixed-width font в Firefox &gt;= 3. На самом деле можно.
&lt;/p&gt;

&lt;p&gt; Во-первых, нужно сначала установить default font для всех gtk
программ: &lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% cat /usr/local/share/themes/Raleigh/gtk-2.0/gtkrc
style "user-font" {
        font_name = "Helvetica 9"
}

widget_class "*" style "user-font"

gtk-font-name="Helvetica 9"&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Во-вторых, добавить вот это в userChrome.css:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;#urlbar {
        font-family: lucidatypewriter !important;
        font-size: 9pt !important;
}&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;&lt;div align='center'&gt;
&lt;img
src='http://farm3.static.flickr.com/2650/3713389696_c47c5f0235_o.png'
alt='60 KB'&gt;
&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;
У меня тут грохотать начало за окном: будет короткий ливень.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-5541079017866866486?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/5541079017866866486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/07/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5541079017866866486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5541079017866866486'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/07/blog-post.html' title='Июльские новости'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-3820314377539465758</id><published>2009-06-25T01:28:00.003+03:00</published><updated>2009-06-25T01:39:57.834+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>Жара доводит до ручки</title><content type='html'>&lt;p&gt; Удивлялся и пялился, как в афишу коза, почему вместо ожидаемой
lowercase строки, переменная &lt;code&gt;t&lt;/code&gt; становится заполнена
непечатным символом 0x01 (SOH):&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;int cmd_type(const char *raw)
{
    if (raw == NULL) return -1;

    char t[BUFSIZ];
    strncpy(t, raw, sizeof(t)-1);
    t[sizeof(t)-1] = '\0';

    char *p = t;
    while (*p) {
        *p = islower(*p);
        ++p;
    }

    if (strncmp(t, "help", 4) == 0) return P_CMD_HELP;
    ...
}
&lt;/pre&gt;
&lt;p&gt;

&lt;p&gt; Распознать наконец, что вместо &lt;b&gt;to&lt;/b&gt;lower написал &lt;b&gt;is&lt;/b&gt;lower
понадобилось минут 30. Проклятое киевское лето.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-3820314377539465758?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/3820314377539465758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/06/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3820314377539465758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3820314377539465758'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/06/blog-post.html' title='Жара доводит до ручки'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-5532870465445312393</id><published>2009-06-06T01:23:00.001+03:00</published><updated>2009-07-17T01:04:00.334+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>Broken DNS forwarding in VMware Workstation 6.5.2 with NAT</title><content type='html'>&lt;p&gt;
Это случилось на следующее утро после апгрейда с 6.0.2 на 6.5.2:
прохладным, синим вечером казалось что все прошло гладко и работало
чудесно, а жарким утром, когда трафик за окном начинал свой привычный
тягучий стон, я открыл крышку лэптопа, и, щурясь от надоедливого солнца,
обнаружил внутри виртуальной машины неспособным себя забрать почту: DNS
не работал.
&lt;/p&gt;

&lt;p&gt; Сначала я подумал что мой Bind в Vista совершил харакири, но это
оказалось неправдой -- в Windows резолвер общался с локальным
DNS-сервером успешно как и раньше. Затем я решил что вчера совершил
что-то настолько глупое с virtual network switches, что утром completely
incapable это вспомнить. Короче говоря я, кхм, позорно перезагрузился и
о чудо -- UTP пакеты начали бегать в машинах VMware по 53-му порту как
вчера.  &lt;/p&gt;

&lt;p&gt; Успокоившись, я хлопнул крышкой и довольный пошел по своим
делам. Если кто-то хочет сделать любого человека абсолютно счастливым --
незаметно сломайте что-нибудь, что раньше у него всегда работало,
выждете немного, пока он тяжело страдает, а потом почините ему
сломанное. Или сделайте вид, что починили.  &lt;/p&gt;

&lt;p&gt;
Вечером того же дня, который грозил начаться столь неудачно, yours truly
smug вернулся домой, открыл лэптоп и... Не знаю как вы догадались, но
обнаружил внутри виртуальной машины неспособным себя забрать почту: DNS
не работал.
&lt;/p&gt;

&lt;p&gt;
Черт, -- сказал я. То есть, по правде говоря, сказал что-то гораздо
хуже.
&lt;/p&gt;

&lt;p&gt;
Маленькое исследование с tcpdump'ом со стороны FreeBSD и с Wireshark'ом
со стороны Vista показало что запрос со стороны резолвера доходит до
сервера вполне успешно, формируемый ответ сервера идет на вход VMnet8
switch, но отфутболивается от него с ошибкой ICMP host
unreachable, а резолвер в guest отваливается по таймауту и отчаянно
плачет no servers could be reached.
&lt;/p&gt;

&lt;p&gt; Самое интересно в этой истории то, что остальные ip-пакеты по любому
другому порту ходят как не в чем не бывало и если вы принудительно
отключите резолвинг адресов в вашем http proxy, то таки сможете
заставить броузер сходить на википидия, например. Если вы помните хотя
бы один из ее ip-адресов, hehe. Или даже так: набираем в Vista "nslookup
en.wikipedia.org" и используем вручную ответ в спрятанной от
пагубного влияния всех DNS на свете (благодаря VMnet8) виртуальной
машине. Можно даже звонить из своего кабинета секретарше и спрашивать
"Сюзанна, какой там адрес у serverfault.com? Что-что? 69.59.196.213?
2... После последней точки? 212? Да? Спасибо. Кстати, если придет
Самоподгаслов за деньгами -- скажи что я буду в его распоряжении
за..., нет лучше на следующей неделе.".  &lt;/p&gt;

&lt;p&gt;
Продолжая маленькое исследование и тщетно излопатя весь гугл мы имеем
следующее: DNS отрубается после n минут лежания лэптопа в suspend. То
есть, если у вас VMware Workstation вертится на обычном desktop pc,
который выключается раз в 6 месяцев: вы можете этой проблемы никогда не
заметить и сидеть как император Ян-ди в своем Янчжоу, кушать персики,
жевать рябчиков и полностью игнорировать все происходящее.
&lt;/p&gt;

&lt;p&gt; В обратном случаи, единственно решение тут видится в перезапуске
(нет, не всей Windows) сервиса VMware NAT Service &lt;i&gt;каждый раз как
Windows протирает глаза после suspend&lt;/i&gt;. Возникает естественный
вопрос: как автоматизировать?  Под FreeBSD или Linux такой предмет даже
не выносился на повестку дня, настолько решение всем очевидно своею
простотой. В Windows мы имеет очередной геморрой.  &lt;/p&gt;

&lt;p&gt;
Можно написать скрипт на чем заблагорассудится, который будет а) в
бесконечном цикле ждать когда Windows говорит, что проснулась и б)
вызывать 2 команды:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
sc stop "VMware NAT Service"
sc start "VMware NAT Service"&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Так? Так, но пускать его придется под Administrator -- если вы просто
запихнете вызов скрипта в автозагрузку
&lt;code&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run&lt;/code&gt;
-- это поможет плохо: либо придется сначала загружаться в аккаутн
Administrator'ра, а потом в свой, либо найти утилиту (такие есть),
которая позволить оформить вызов скрипта под root'ом без ввода каждый
раз пароля.
&lt;/p&gt;

&lt;p&gt; Обойти это можно написанием daemon'а под Windows (&lt;i&gt;сервиса&lt;/i&gt; в
их булыжной терминологии), который можно стартовать и останавливать в
services.msc. Я сделал иначе: Microsoft имеет wrapper-утилитку
srvany.exe, которая может разговаривать с &lt;a
href='http://en.wikipedia.org/wiki/Service_Control_Manager'&gt;Service
Control Manager&lt;/a&gt; самостоятельно, позволяя таким образом запускать
любую программу как Windows service и не мучиться с тем API.  &lt;/p&gt;

&lt;p&gt; Готовый WSH-скрипт vmware-nat-fix.js лежит &lt;a
href='http://gromnitsky.users.sourceforge.net/vmware/vmware-nat-fix.js'&gt;тут&lt;/a&gt;. Для
его работы нужна srvany.exe, которую можно совершенно свободно взять из
&lt;a
href='http://www.microsoft.com/Downloads/details.aspx?FamilyID=9d467a69-57ff-4ae7-96ee-b18c4790cffd'&gt;Windows
Server 2003 Resource Kit Tools&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;
Используется фикс так: скрипт ложится в любое приличное место и сперва
тестируется (под администратором) командой:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
&gt;vmware-nat-fix.js /d
&lt;/p&gt;&lt;/pre&gt;

&lt;p&gt; Если вам показало окошко с надписью &lt;b&gt;Successfully reloaded "VMware
NAT Service" daemon&lt;/b&gt;, тогда регистрируйте скрипт как сервис вот такой
командой (тоже под администратором): &lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
&gt;vmware-nat-fix.js /install
&lt;/p&gt;&lt;/pre&gt;

&lt;p&gt;
Если все идет хорошо, получите окошко с надписью &lt;b&gt;Successfully added
"VMware NAT Fix" service&lt;/b&gt;, иначе -- с ошибкой, где будет написано
причину (например, что у вас на то не было прав).
&lt;/p&gt;

&lt;p&gt;
Теперь можно пойти в services.msc чтобы запустить daemon или набрать
&lt;code&gt;sc start "VMware NAT Fix"&lt;/code&gt;, если никуда идти желания
нету. Когда daemon начнет тихо жужжать, тестируйте его посредством входа
в suspend/hibernate и выхода оттуда. У меня VMnet8 после просыпания
Vista и щелчка от vmware-nat-fix.js начинает по-человечески работать
примерно через секунд 40 (остается невыясненным, почему не сразу).
&lt;/p&gt;

&lt;p&gt;
Если вы решите перетащить vmware-nat-fix.js в другое приличное место,
наберите под администратором:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
&gt;vmware-nat-fix.js /&lt;b&gt;un&lt;/b&gt;install
&gt;vmware-nat-fix.js /install&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Чтобы обновить записи в реестре.
&lt;/p&gt;

&lt;h4&gt;Local DNS (2009/07/17 update)&lt;/h4&gt;

&lt;p&gt; Далее, если вы используете локальный, например, Bind для обзывания
виртуальных машин, то будьте внимательны, когда и в какой момент Vista к
нему обращается. После множества утомительных манипуляций, единственно
работающей конфигурацией (всегда и независимо от состояния и количества
(включая 0) подключенных сетей к лэптопу), получилась такая, при которой
выполнялись 2 условия: &lt;/p&gt;

&lt;p&gt;
&lt;ul&gt; &lt;li&gt; прописывание своего, локального DNS-сервера в свойства
&lt;i&gt;каждого&lt;/i&gt; (а нет только VMware NAT) рабочего network
adapter'а. Иначе Vista будет помнить какой был последний DNS-сервер
рабочим и с козлиным упрямством слать запросы к нему, даже когда вы
давно вышли за пределы той сети с тем сервером.

&lt;p&gt;
&lt;div align='center'&gt;
&lt;a href='http://farm3.static.flickr.com/2643/3727175647_509013fac3_o.png'&gt;
&lt;img src='http://farm3.static.flickr.com/2643/3727175647_2fed43c313.jpg' alt='112 KB'&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;li&gt; занесение в &lt;code&gt;%SystemRoot%\System32\drivers\etc\resolv.conf&lt;/code&gt; привычного
  &lt;code&gt;nameserver 127.0.0.1&lt;/code&gt;.
&lt;/ul&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-5532870465445312393?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/5532870465445312393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/06/broken-dns-forwarding-in-vmware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5532870465445312393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5532870465445312393'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/06/broken-dns-forwarding-in-vmware.html' title='Broken DNS forwarding in VMware Workstation 6.5.2 with NAT'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm3.static.flickr.com/2643/3727175647_2fed43c313_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7378745400101154705</id><published>2009-05-06T18:37:00.004+03:00</published><updated>2009-05-10T12:01:36.815+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>FreeBSD 7.2 and VMWare Workstation</title><content type='html'>&lt;p&gt; &lt;i&gt;(For newcomers: есть &lt;a
href='http://gromnitsky.blogspot.com/2009/01/freebsd-71-and-vmware-workstation.html'&gt;предыдущие&lt;/a&gt;
серии.)&lt;/i&gt;&lt;/p&gt;

&lt;p&gt; Иногда мне кажется, что FreeBSD порт open-vm-tools больше всего
похож на стационарный двигатель слесаря-интеллигента Полесова -- все
выглядит как настоящее, но не работает.  &lt;/p&gt;

&lt;p&gt; Файловая система hgfs, для которой хотя написаны и ядерный модуль и
монтировщик, все еще являет собой &lt;a
href='https://sourceforge.net/mailarchive/forum.php?thread_name=200905041658.31523.dtor%40vmware.com&amp;forum_name=open-vm-tools-discuss'&gt;work
in progress&lt;/a&gt;. Шаг вперед по сравнению с прошлой версией по величине
своей таков, что если раньше при попытке монтирования shared folder вы
тот час же могли любоваться паникой ядра, то теперь mount_vmhgfs вместе
с vmhgfs.ko тщательно стараются соблюдать приличия, в которые вы верите
до тех самых пор, пока не пытаетесь что-то прочесть из mount point. Не
самый худший вариант, беря во внимание вспоминания о том, что именно
раньше в припадке истерии вытворял vmhgfs.ko.  &lt;/p&gt;

&lt;h4&gt;Потери&lt;/h4&gt;

&lt;p&gt; vmblock.ko, который счастливо перезагружал FreeBSD в прошлом,
продолжает радостно делать это в настоящем. Хорошая новость тут состоит
в том, что об этом модуле можно забыть, т.к. теперь реализация файловой
системы VMBlock переписана с помощью FUSE library. Это означает, что мы
сможем, наконец, получить сомнительно долгожданный host&lt;-&gt;guest Drag &amp;
Drop. Если проявим терпение.  &lt;/p&gt;

&lt;p&gt;
vmware-guestd, который верой и правдой честно служил нам все эти годы,
уходит на пенсию. Вместо него мы получаем демон vmtoolsd, который с
помощью plugins может в том числе и, синхронизировать время.
&lt;/p&gt;

&lt;h4&gt;В путь&lt;/h4&gt;

&lt;div align='right'&gt;&lt;p&gt;
Розсуваєш чіпке гілля чагарників -- і перед
тобою несподівано виблискує вода.&lt;br&gt;
&lt;i&gt;-- Михайло Коцюбинський.&lt;/i&gt;&lt;br&gt;
&lt;/p&gt;&lt;/div&gt;

&lt;p&gt; &lt;i&gt;(Всяческие предварительные вещи, такие как выбор типа виртуальной
сетевой карты или общие места о настройке Xorg -- см. в &lt;a
href='http://witowd.livejournal.com/9585.html'&gt;1-м эпизоде&lt;/a&gt;.) &lt;/i&gt;
&lt;/p&gt;

&lt;/p&gt; Последней вещью на свете, которой нужно доверять в нашем случаи --
это подсказке порта, что куда прописать, чтобы якобы получить. На самом
деле, после установки open-vm-tools, сделайте следующее: &lt;/p&gt;

&lt;p&gt;
&lt;ol&gt;

&lt;li&gt; &lt;p&gt;Убедитесь, что sysctl переменная &lt;code&gt;vfs.usermount&lt;/code&gt;
имеет значение &lt;code&gt;1&lt;/code&gt; и пользователь под которым вы работаете
состоит в группе &lt;code&gt;operator&lt;/code&gt;.&lt;/p&gt;

&lt;li&gt; Добавьте в /etc/rc.conf:

&lt;p&gt;&lt;pre&gt;fusefs_enable=YES
vmware_guestd_enable=NO
vmware_guest_vmmemctl_enable=YES
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;и напечатайте:&lt;/p&gt;

&lt;pre&gt;# /usr/local/etc/rc.d/vmware-kmod start
# /usr/local/etc/rc.d/fusefs start
&lt;/pre&gt;


&lt;li&gt; Теперь, для запуска vmtoolsd, нахмурьте лоб посерьезнее и наберите:

&lt;p&gt;&lt;pre&gt;# vmtoolsd -n vmsvc -p /usr/local/lib/open-vm-tools/plugins/vmsvc \
    -b /var/run/vmtoolsd.pid
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt; Так вы запустите его с сервисом vmsvc, в котором есть такой полезный
plugin, как timeSync. Разумеется, ручное добавление в .vmx файл строчки
&lt;code&gt;tools.syncTime = "TRUE"&lt;/code&gt; для корректной работы никто не
отменял, хотя аналогичного можно добиться запустив:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% vmware-toolbox-cmd timesync enable&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt; Если вас беспокоит насколько новый способ синхронизации времени
более прожорлив (или наоборот), то удалите ненужные (впрочем, пока этого
не делайте) plugins из /usr/local/lib/open-vm-tools/plugins/vmsvc,
оставьте только libtimeSync.so вместе c libguestInfo.so и посмотрите что
вышло:&lt;p&gt;

&lt;p&gt;&lt;pre&gt;33805 root          1  44    0 20660K  3820K select   0:00  0.00% vmtoolsd&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;против старого доброго vmware-guestd:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;33854 root          1  49    0 18124K  2480K select   0:00  0.00% vmware-guestd&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt; Руками, конечно, запускать каждый раз vmtoolsd довольно скучно,
поэтому возьмите себе &lt;a
href='http://gromnitsky.users.sourceforge.net/open-vm-tools/vmtoolsd'&gt;rc.subr
скрипт&lt;/a&gt;, положите его в /usr/local/etc/rc.d и добавьте строчку
&lt;code&gt;vmtoolsd_enable=YES&lt;/code&gt; в /etc/rc.conf.  &lt;/p&gt;


&lt;li&gt; Если вы установили порт open-vm-tools-nox11 вместо open-vm-tools,
можете дальше не читать, иначе продолжайте движение. Помните, что
vmblock.ko наконец-то considered harmful?  Вместо его кривых рук, нам
нужно самим подмонтировать VMBlock file system в некотором укромном
месте:

&lt;p&gt;&lt;pre&gt;% mkdir /tmp/vmblock-fuse
% chmod 777 /tmp/vmblock-fuse
% vmware-vmblock-fuse /tmp/vmblock-fuse
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;Эти команды нужно выполнять от regular user, &lt;b&gt;не&lt;/b&gt; root, иначе
пропадает смысл. Недостаток такого монтирования конкретным пользователем
проявится как только другой пользователь попытается посмотреть
содержимое /tmp/vmblock-fuse и очень огорчится, потому что у него не
окажется на это никаких прав. Это значит, что либо каждому пользователю
придется вызывать vmware-vmblock-fuse с каким-нибудь другим каталогом в
качестве параметра, либо сделать монтирование 1 раз root'ом с опцией
&lt;code&gt;allow_other&lt;/code&gt;. Кто помнит, в отличие от Linux, во FreeLSD
указывать &lt;code&gt;allow_other&lt;/code&gt; для всех FUSE file systems может
только root. С /etc/fstab тут у вас ничего не получится, поэтому
возьмите &lt;a
href='http://gromnitsky.users.sourceforge.net/open-vm-tools/vmblock'&gt;rc.subr
скрипт&lt;/a&gt;, пропишите в /etc/rc.conf &lt;code&gt;vmblock_enable=YES&lt;/code&gt; и,
немного погодя, убедитесь что regular user может читать
/tmp/vmblock-fuse.&lt;/p&gt;


&lt;li&gt; &lt;p&gt;Пускайте иксы. (Для Xorg 7.4+ &lt;i&gt;обязательно&lt;/i&gt; просмотрите
раздел об &lt;a
href='http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x-config.html'&gt;X11
в Handbook&lt;/a&gt;.)&lt;/p&gt;


&lt;li&gt; &lt;p&gt;В теории, демон vmtoolsd с сервисом vmusr, должен на вечные
времена заменить собою vmware-user и обеспечивать copy/paste между
host и guest, управлять Drag &amp; Drop, дружить с VIX API и
проч. Одновременно пускать vmware-user и vmtoolsd-с-сервисом-vmusr
строжайше запрещено, так что между ими двумя придется выбирать себе
только одного компаньона.  Если вас не интересует Drag &amp; Drop --
берите vmtoolsd, но этот путь вы прошагаете без меня, поэтому заранее
желаю удачи.&lt;/p&gt;

&lt;p&gt; Раньше, в темные времена vmblock.ko, то что мы проделали в п.4 мог
исполнять только root, поэтому существовала suid'ная утилита
vmware-user-suid-wrapper, которая загружала ядерный модуль vmblock,
монтировала vmblock file system, открывала некоторый (о нем ниже)
файловый дескриптор для создание/удаления блоков (файлов), делала drop
privileges и стартовала vmware-user от обычного пользователя.  &lt;/p&gt;

&lt;p&gt; Весь ужасный magic в доставании файлового дескриптора VMBlock file
system, заключается в знании на каком файле сделать open(2) с &lt;code&gt;O_WRONLY&lt;/code&gt;
mode. Если мы назначили точку монтирования в п.4 как /tmp/vmblock-fuse,
то искомый файл (при успешном монтировании) будет
/tmp/vmblock-fuse/&lt;b&gt;dev&lt;/b&gt;. Число полученное при успешном вызове
open(2) мы должны передать программе vmware-user в параметре
--blockFd. Собственно говоря, именно так мы точно сэмулируем работу
vmware-user-suid-wrapper: &lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% vmware-user --blockFd `vmware-getblockid /tmp/vmblock-fuse/dev`&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;vmware-getblockid -- это простейшая программка, которую вы забираете
вот &lt;a
href='http://gromnitsky.users.sourceforge.net/open-vm-tools/vmware-getblockid.c'&gt;отсюда&lt;/a&gt;,
компилируете у себя посредством "&lt;kbd&gt;cc -o vmware-getblockid.c
vmware-getblockid&lt;/kbd&gt;" и ложите результат куда-нибудь в PATH.&lt;/p&gt;

&lt;p&gt;
Btw, vmtoolsd тоже имеет опцию --blockFd, но как бы вам не хотелось
изобразить улыбку чеширского кота, посмотрите сначала в файл
services/vmtoolsd/cmdLine.c (из tarball'а с исходным кодом
open-vm-tools):
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
GOptionEntry clOptions[] = {
...
      { "blockFd", '\0', 0, G_OPTION_ARG_INT, &amp;state-&gt;ctx.blockFD,
         N_("File descriptor for the VMware blocking fs."), N_("fd") },
...
}

#if !defined(G_PLATFORM_WIN32)
   state-&gt;ctx.blockFD = -1;
#endif
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Короче говоря, с vmtoolsd тут каши не сваришь.&lt;/p&gt;


&lt;li&gt;&lt;p&gt;Самое время попробовать Drag &amp; Drop and copy/paste. Со вторым у
меня проблем не оказалось, а DnD почему-то заработал только из guest в
host, обратное перетаскивание сопровождалось вот таким возмущением:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;DnD_RemoveBlock: Cannot delete block on /tmp/VMwareDnD/4cc8fb08/ \
    (Operation not supported)
DnDRpcInDataFinishCB: could not remove block on /tmp/VMwareDnD/4cc8fb08/
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt; То есть, файл из host оставался лежать в /tmp/VMwareDnD/4cc8fb08, а
host в лице Vista на несколько минут запрещал сам себе DnD с VMWare,
делая соответствующие внушения тихим голосом.  &lt;/p&gt;

&lt;p&gt;
Может это было потому, что на тестовой виртуальной машине с FreeBSD 7.2-RC2 с
Xorg 7.4 стартовал только twm, а Gnome или KDE
отсутствовали. Перетягивание из FreeBSD в Vista файлов я тестировал
каким-то x11-fm/emelfm2 -- больше ни для чего мне этот файловый менеджер
не нужен.
&lt;/p&gt;


&lt;li&gt; vmware-user делает одну нехорошую вещь и портит всю курицу в
горшке: пытается отвечать VMWare на изменение размеров окна виртуальной
машины. Такое поведение напоминает эпитет Geminus у римского
Януса. Побороть это нравственное двуличие инструмента как помощника,
можно только &lt;a
href='http://gromnitsky.users.sourceforge.net/open-vm-tools/vmware-user.patch'&gt;выкусыванием
из vmware-user&lt;/a&gt; вызовов &lt;code&gt;Resolution_foobar()&lt;/code&gt; в исходном
коде.

&lt;/ol&gt;
&lt;/p&gt;

&lt;h4&gt;Urbi et orbi&lt;/h4&gt;

&lt;div align='right'&gt;
&lt;p&gt;
Каким бы безупречно правдивым не казался человек,&lt;br&gt;
ему можно верить лишь в том, что касается дел человеческих.&lt;br&gt;
&lt;i&gt;-- Мишель Монтень.&lt;/i&gt;&lt;p&gt;
&lt;/div&gt;

&lt;p&gt; Если вам совсем нечем заняться, сделайте grep в tarball'е c
open-vm-tools на функцию &lt;code&gt;RpcOut_sendOne&lt;/code&gt; и посмотрите на
утилиту vmware-rpctool. Например: &lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% vmware-rpctool vmx.capability.dnd_version
2
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt; Терпения внимательно рассматривать plugins для vmtoolsd у меня на
сегодня закончилось, хотя &lt;a
href='http://blogs.vmware.com/vix/2008/07/what-is-vix-and.html'&gt;VIX&lt;/a&gt;
-- это, вероятно, самое интересное, ради чего стоит вообще так страдать
с open-vm-tools. Правда, для самых простых операций, таких как
start/suspend никакие VMWare tools внутри виртуальной машины не
требуются, а запуск в guest программ посредством VIX API из host есть не
более чем детская игрушка, при наличии работающего expect. На этой
апофегме, мы, пожалуй, и закончим.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7378745400101154705?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7378745400101154705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/05/freebsd-72-and-vmware-workstation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7378745400101154705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7378745400101154705'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/05/freebsd-72-and-vmware-workstation.html' title='FreeBSD 7.2 and VMWare Workstation'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8183017739880581075</id><published>2009-04-24T01:08:00.002+03:00</published><updated>2009-04-24T01:12:10.725+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>Don't worry, the submission was processed</title><content type='html'>&lt;p&gt;
Новости у нас такие: 
&lt;/p&gt;

&lt;p&gt;
Во-первых, yours truly острым глазом через 3 месяца обнаружил, что
порт open-vm-tools в FreeBSD несколько обновился, а бесценные советы о
его приготовлении и VMWare теперь похожи на инструкцию по пользованию
телеграфом. Но так как неумолимо надвигаются, почти как весенние грозы,
so called майские праздники -- то это значит, что есть шанс посмотреть
на open-vm-tools заново и добавить в этот блог свою новую, классически
&lt;i&gt;тупеньку&lt;/i&gt; запись.
&lt;/p&gt;

&lt;p&gt;
Во-вторых, вышла версия 0.12 глюкала под именем &lt;a
href='http://uraniacast.sourceforge.net/'&gt;uraniacast&lt;/a&gt;, которое
теперь кроме подкастов RSS 2.x, понимает также и Atom feeds.
&lt;/p&gt;

&lt;p&gt; В-третьих. Так, что там в-третьих. Freshmeat, да. Freshmeat
продолжает удивлять. Стоило туда не заходить всего каких нибудь 7
месяцев, так эти bastards изничтожили дизайн начала 2000-х и всобачили
вот эту вот гору всяческой джаваскриптовской пакости.  &lt;/p&gt;

&lt;p&gt;
В старые добрые времена, когда на Freshmeat добавлялся проект, вы могли
тут же указать и релиз, а теперь после добавления проекта и утверждения
его, вы смотрите на главную страничку Freshmeat и спрашиваете "так где
же?" -- и, что характерно, совсем не видите ответа. Ах да, релиз -- вы
театрально хлопаете себя по лбу и засучиваете рукава в поисках Changes
Summary, нажимаете Submit. Черт, опять ждать.
&lt;/p&gt;

&lt;p&gt; Постоянный approval конечно раздражает: сколько лет уже прошло, а
ничего не меняется. Неужели они там действительно боятся, что я, вместо
рутинного обновления данных о программке, буду (злорадно ухмыляясь)
посылать туда громкие прокламации о самых низких ценах на некоторые
таблетки или объявления о абсолютно беспроигрышных лотереях, или, между
делом, нести призывы голосовать за мою любимую партию?  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8183017739880581075?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8183017739880581075/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/04/dont-worry-submission-was-processed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8183017739880581075'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8183017739880581075'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/04/dont-worry-submission-was-processed.html' title='Don&apos;t worry, the submission was processed'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8242511126987259623</id><published>2009-04-07T03:05:00.000+03:00</published><updated>2009-04-07T03:07:05.094+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Исторический cvsup</title><content type='html'>&lt;p&gt;
Вот сидишь, щелкаешь клювом, и не замечаешь какие вехи проходят
мимо. Если вам в ближайшие месяца 2 нужно будет захайрить сисадмина
FreeBSD, так вот вам простой тест как отделить спившегося от скуки
толстого обормота с торчащими волосами из ушей от минимально адекватного
персонажа: спросите кандидата как настроить (для любых целей) pppd.
&lt;/p&gt;

&lt;p&gt;
&lt;div align='right'&gt;
Как Транзимена изменилась ныне!&lt;br /&gt;
Лежит, как щит серебрянный, светла.&lt;br /&gt;
Кругом покой. Лишь мирнный плуг в долине&lt;br /&gt;
Земле наносит раны без числа.&lt;br /&gt;
Тем, где лежали густо их тела,&lt;br /&gt;
Разросся лес. И лишь одна примета&lt;br /&gt;
Того, что кровь когда-то здесь текла,&lt;br /&gt;
Осталась для забывчивого света:&lt;br /&gt;
Ручей, журчащий здесь, зовется Сангвинетто.&lt;br /&gt;
&lt;i&gt;-- Джордж Гордон Байрон, Паломничество Чайльд Гарольда, IV, 65.&lt;/i&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; Только не нужно театрально хвататься за сердце: ppp(8) остается, а
вместо ушедшего в каталог Attic pppd, сходите на
&lt;a href='http://mpd.sourceforge.net'&gt;mpd.sourceforge.net&lt;/a&gt; и почитайте
как весело вы будете жить дальше.  &lt;/p&gt;

&lt;p&gt;
Собирая мир 5 апреля для 8.0-CURRENT у меня все еще было на месте,
а сегодня:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;pts/0:/usr/src# csup -L 1 /root/standard-supfile
Connected to 212.42.64.9
Updating collection src-all/cvs
[...]
 Delete src/share/man/man4/ppp.4
 Delete src/share/man/man4/sl.4
[...]
 Delete src/sys/net/bsd_comp.c
 Delete src/sys/net/if_ppp.c
 Delete src/sys/net/if_ppp.h
 Delete src/sys/net/if_pppvar.h
 Delete src/sys/net/if_sl.c
 Delete src/sys/net/if_slvar.h
 Delete src/sys/net/ppp_comp.h
 Delete src/sys/net/ppp_deflate.c
 Delete src/sys/net/ppp_tty.c
 Delete src/sys/net/slip.h
[...]
 Delete src/tools/build/options/WITHOUT_SLIP
[...]
 Delete src/usr.sbin/pppd/Makefile
 Delete src/usr.sbin/pppd/RELNOTES
 Delete src/usr.sbin/pppd/auth.c
 Delete src/usr.sbin/pppd/[...]
 Delete src/usr.sbin/sliplogin/Makefile
 Delete src/usr.sbin/sliplogin/pathnames.h
 Delete src/usr.sbin/sliplogin/sliplogin.8
 Delete src/usr.sbin/sliplogin/sliplogin.c
Finished successfully
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt; Если представить себе &lt;a
href='http://en.wikipedia.org/wiki/BSD_daemon'&gt;mascot of FreeBSD&lt;/a&gt;,
говорящий словами Купринского героя, то эти слова звучали бы так: &lt;/p&gt;

&lt;p&gt;
&lt;blockquote&gt;
Да, господа судьи, я убил pppd и буду впредь повторять свое преступление
для всех не-SMP драйверов.&lt;br /&gt;
Но напрасно медицинская экспертиза оставила мне лазейку -- я ею не
воспользуюсь.
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt; Не менее интересно, сколько лет понадобится собирателем сетевого
мусора, чтобы удалить газзилионы страничек "настраиваем
point-to-point protocol daemon под freelsd", написанные русскими
хакирами-патриотами, учитывая их возмущенный рев "как посмели" и громкие
призывы строем возвращаться на 4.11, переходить на Linux и проч.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8242511126987259623?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8242511126987259623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/04/cvsup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8242511126987259623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8242511126987259623'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/04/cvsup.html' title='Исторический cvsup'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-656369212952527645</id><published>2009-03-27T05:15:00.003+02:00</published><updated>2009-04-07T03:08:10.157+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lang'/><category scheme='http://www.blogger.com/atom/ns#' term='tcl'/><title type='text'>Programming Languages on Wikirank</title><content type='html'>&lt;p&gt;Несмотря на существенный перерыв в блоггинге, я все еще живой, а
вовсе не умер, как можно было бы подумать.&lt;/p&gt;

О занятном.

&lt;p&gt;Как граждане совсем разных государств интересуются языками
программирования (в смысле какими) -- так это теперь можно гадать по
совершенно новой гуще: проекту &lt;a
href='http://wikirank.com/about'&gt;Wikirank&lt;/a&gt; от экс-дизайнера Google
Analytics Джеффри Вина.&lt;/p&gt;

&lt;p&gt;Я не удержался и составил табличку (в которой нет творения
Страуструпа из-за каких-то нелепых цифр у wikirank'а в районе 150 --
очевидной полной чепухи).  &lt;/p&gt;

&lt;p&gt;
&lt;div align='center'&gt;
&lt;table border='1'&gt;
&lt;thead&gt;
  &lt;tr&gt;
   &lt;th&gt;Name&lt;/th&gt;
   &lt;th&gt;Hits&lt;/th&gt;
   &lt;th&gt;%&lt;/th&gt;
  &lt;/tr&gt;
&lt;/thead&gt;
 &lt;tbody&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;C_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;638019&lt;/td&gt;
   &lt;td align='right'&gt;100.00&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Java_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;138203&lt;/td&gt;
   &lt;td align='right'&gt;21.66&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;PHP&lt;/td&gt;
   &lt;td align='right'&gt;121217&lt;/td&gt;
   &lt;td align='right'&gt;19.00&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;JavaScript&lt;/td&gt;
   &lt;td align='right'&gt;110088&lt;/td&gt;
   &lt;td align='right'&gt;17.25&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Python_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;75416&lt;/td&gt;
   &lt;td align='right'&gt;11.82&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Perl&lt;/td&gt;
   &lt;td align='right'&gt;60068&lt;/td&gt;
   &lt;td align='right'&gt;9.41&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Ruby_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;41883&lt;/td&gt;
   &lt;td align='right'&gt;6.56&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Lua_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;21984&lt;/td&gt;
   &lt;td align='right'&gt;3.45&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Haskell_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;21493&lt;/td&gt;
   &lt;td align='right'&gt;3.37&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Smalltalk&lt;/td&gt;
   &lt;td align='right'&gt;19251&lt;/td&gt;
   &lt;td align='right'&gt;3.02&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Erlang_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;19235&lt;/td&gt;
   &lt;td align='right'&gt;3.01&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Scheme_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;19118&lt;/td&gt;
   &lt;td align='right'&gt;3.00&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Tcl&lt;/td&gt;
   &lt;td align='right'&gt;17620&lt;/td&gt;
   &lt;td align='right'&gt;2.76&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;Lisp_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;10726&lt;/td&gt;
   &lt;td align='right'&gt;1.68&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;F_Sharp_(programming_language)&lt;/td&gt;
   &lt;td align='right'&gt;5980&lt;/td&gt;
   &lt;td align='right'&gt;0.94&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
   &lt;td align='left'&gt;OCaml&lt;/td&gt;
   &lt;td align='right'&gt;5115&lt;/td&gt;
   &lt;td align='right'&gt;0.80&lt;/td&gt;
  &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; Лично меня все-таки поражает отрыв C. В каком-нибудь 1999-м я
иначе просто не смог бы себе представить, но сейчас это смотрится
неприлично подозрительно.  &lt;/p&gt;

&lt;p&gt; Тут, правда, из статей Wikipedia ясно, что те кто залез в читать об F#
почти всегда кликнут на OCaml, а те кто посмотрят на скобочки Lisp'а --
те щелкнут на Scheme.  &lt;/p&gt;

&lt;p&gt; Между тем, судьба Tcl навевает скуку. Но несмотря на, мы все-таки
будем продолжать бороться.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-656369212952527645?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/656369212952527645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/03/programming-languages-on-wikirank.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/656369212952527645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/656369212952527645'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/03/programming-languages-on-wikirank.html' title='Programming Languages on Wikirank'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7238850106489518727</id><published>2009-01-31T04:35:00.001+02:00</published><updated>2009-01-31T04:37:32.555+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>Доктор Джекилл и мистер Хайд</title><content type='html'>&lt;p&gt;
&lt;div align='right'&gt;
Я разгадал тебя: ты самозванец.&lt;br&gt;
Тайком пробрался ты на этот остров,&lt;br&gt;
Чтоб у меня отнять мои владенья.&lt;br&gt;
&lt;i&gt;-- Уильям Шекспир, Буря.&lt;/i&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; На днях ваш покорный слуга нашел в себе силы поправить для FreeBSD
порт одной крохотной утилиты. Заставить себя пришлось, поскольку реацией
на попытку использование той версии утилиты, что спрятана в густом
сумраке дерева портов, как ягода черники в лесу, было неприличное ее
гэпание, если ту пытались пустить на, к примеру, amd64.  &lt;/p&gt;

&lt;p&gt; Ошибка та была давным давно (чуть ли не год назад) исправлена и
новая версия почти что bug free утилиты живет с осени прошлого года на
Sourceforge. В портах, разумеется, оставалась ссылка на a) старую версию
b) безвинно убиенный (по моей просьбе) аккаунт на unixdev.net.  &lt;/p&gt;

&lt;p&gt; То есть, скачать старую версию как бы вообще нельзя. Тяжка доля
maintainer'а своих же глюкал, но доля ленивого maintainer'а,
уклоняющегося от общественно-полезного труда, тяжка вдвойне. &lt;/p&gt;

&lt;p&gt;
Кряхтя сполняю send-pr; чуть погодя читаю из GNATS:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;Class Changed
From-To:    maintainer-update-&gt;change-request
By:         edwin
When:       Wed Jan 28 22:30:16 UTC 2009
Why:        Fix category (submitter &lt;b&gt;is not&lt;/b&gt; maintainer)
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt; Что тут сказать? В патче было изменено, кроме всего прочего, 2
вещи: e-mail и спеллинг фамилии (на более классический). Реакция
коммитера получилась такая, словно submitter (сиречь моя скромная
персона) -- это коварный злодей, злым умыслом исподтишка попытавшийся,
будто начинающий карманник в метро, стащить иго maintainer'ства.&lt;/p&gt;

&lt;p&gt; К несчастью, второй комммитер оказался сообразительнее и на
ожидавшееся шоу даже не успели продать билеты: &lt;/p&gt;

&lt;p&gt;&lt;pre&gt;State Changed
From-To:    feedback-&gt;open
By:         beech
When:       Fri Jan 30 05:46:36 UTC 2009
Why:        Submitter &lt;b&gt;is&lt;/b&gt; maintainer

State Changed
From-To:    open-&gt;closed
By:         beech
When:       Fri Jan 30 06:05:49 UTC 2009
Why:        Committed, Thanks! 
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Страшенна нудьга оце с вами, вельмишановнi панi та панове.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7238850106489518727?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7238850106489518727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7238850106489518727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7238850106489518727'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/blog-post.html' title='Доктор Джекилл и мистер Хайд'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1458848309021402843</id><published>2009-01-21T19:04:00.000+02:00</published><updated>2009-01-21T19:05:20.254+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>How to view logs</title><content type='html'>&lt;p&gt; Один знакомый меня спросил, показывая пальцем в xterm, где был
procmail log: "&lt;i&gt;что это за утилита для просмотра логов?&lt;/i&gt;". Почему
утилита?  xterm выглядел вот так: &lt;/p&gt;

&lt;p&gt;
&lt;div align='center'&gt;
&lt;a href='http://farm4.static.flickr.com/3454/3215751458_0dbd9d0642_o.png'
   title='17 KB'&gt;
&lt;img src='http://farm4.static.flickr.com/3454/3215751458_ed00527e1b.jpg'
  alt='17 KB'&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; Многие испытывают мучения либо набирая каждый раз ``&lt;code&gt;tail -f
something&lt;/code&gt;'' либо открывая кучу терминалов для глядения на log
files. Другие пользуют &lt;a
href='http://www.gnu.org/software/screen/'&gt;screen&lt;/a&gt; и делают с ним
разные полезные штуки. Вы тоже можете сварганить себе log viewer за 5
минут.  &lt;/p&gt;

&lt;p&gt;
Что нам понадобится.
&lt;/p&gt;

&lt;p&gt;&lt;ol&gt;
&lt;li&gt;Работающий screen.

&lt;li&gt;Отдельный конфигурационный файл для запуска screen в качестве log
viewer. Отдельный -- это затем, чтобы не трогать вашу обычную настройку
screen'а.

&lt;li&gt;xterm и утилита tail.
&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% cat ~/.screenrc.logviewer
startup_message off
hardstatus alwayslastline "%-w%{= bw}%50&amp;gt;%n %t%{-}%+w%&amp;lt;"

screen 0 tail -f -F /var/log/messages
title Messages

screen 1 tail -f -F /home/alex/.procmail/log
title procmail

screen 2 tail -f -F /var/log/maillog
title sendmail

#screen 3 tail -f -F /var/log/samba/log.smbd
#title smbd

screen 3 tail -f -F /var/log/news/news.notice
title news.notice

#screen 4 tail -f -F /var/log/auth.log
#title auth

screen 5 tail -f -F /tmp/twit-list.log
title twit-list

select 1
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Самое painful тут было родить описание the hardstatus line на птичьем
языке, остальное self-explanatory. Теперь пускайте ваш log viewer:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% xterm -title "Log files" -e screen -c ~/.screenrc.logviewer &amp;amp;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Переход между окнами: &lt;code&gt;Ctrl-a n&lt;/code&gt;, где n -- номер окна,
выход: &lt;code&gt;Ctrl-a \&lt;/code&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1458848309021402843?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1458848309021402843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/how-to-view-logs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1458848309021402843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1458848309021402843'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/how-to-view-logs.html' title='How to view logs'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3454/3215751458_ed00527e1b_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-3586067959191776190</id><published>2009-01-21T18:41:00.001+02:00</published><updated>2009-01-31T00:04:50.913+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bugs'/><title type='text'>8 myths about pr2nntp</title><content type='html'>&lt;p&gt; Тут в узких кругах пользователей &lt;a
href='http://pr2nntp.sf.net'&gt;pr2nntp&lt;/a&gt; замеченно появления в головах
тумана в виде "скопища рiзних думок". Чтобы сдуть его и снять пелену с
глаз, пришлось развенчать несколько мифов.  &lt;/p&gt;

&lt;h4&gt;Миф #1: pr2nntp очень сложно настраивать&lt;/h4&gt;

&lt;p&gt;
Не сложнее чем приготовить себе легкий завтрак. То есть, так чтобы
проснулся и сразу все было готово -- это нужно чтобы у вас был
персональный Дживс. Для тех кто не является Берти Вустером, придется
самому отредактировать текстовый (о ужас!) файл конфигурации.
&lt;/p&gt;

&lt;h4&gt;Миф #2: pr2nntp требует INN, а я помню как в университете писал курсовую
работу о настройке INN и почти что свихнулся.&lt;/h4&gt;

&lt;p&gt;
Во-первых, не обязательно INN -- сгодится совершенно любой NNTP-сервер,
который вы можете дергать за веревочки для создания своих newsgroups.
&lt;/p&gt;

&lt;p&gt;
Во-вторых, последние версии INN для работы с pr2nntp требует 0
(&lt;b&gt;нуль&lt;/b&gt;, здесь нет ошибки) каких-либо правок в конфигурации. То
есть вы ставите порт news/inn и забываете о его существовании. И не
пытайтесь подозревать самих себя, что в таком случаи вы оставляете INN
незащищенным для атак извне -- по умолчанию вам будет дано право
подключаться к нему только с локальной машины (так что см. файл
/usr/local/etc/news/readers.conf, если требуется все совсем иначе).
&lt;/p&gt;

&lt;h4&gt;Миф #3: pr2nntp конвертирует все feeds в plain text, а в моих feeds есть
картинки.&lt;/h4&gt;

&lt;p&gt;
Видите ли вы изображения или нет, зависит исключительно от вашего news
reader. pr2nntp умеет составлять письма с raw версией feed (со всем
HTML'ом (выделениями, ссылками на что угодно и проч.)). См. &lt;a href='http://pr2nntp.sourceforge.net/img/vista_mail_with_pr2nntp.png'&gt;screenshot
Microsoft Mail&lt;/a&gt;.
&lt;/p&gt;

&lt;h4&gt;Миф #4: pr2nntp написан на каком-то древнем, как египетские пирамиды,
скриптовом языке. Мне в школе сказали, что Tcl это не cool, он давно
умер, а последним кого видели пишущим на Tcl -- это был какой-то
сумасшедший студент, потерявшийся в колонии королевских пингвинов в
Антарктиде в начале 90-х, откуда потом, взобравшись на снежный холм, он
передавал по радио тусклые, как утро на краю земли, стихи о тщете всего
сущего.&lt;/h4&gt;

&lt;p&gt; Так, все вопросы по языку в &lt;a
href='http://groups.google.com/group/comp.lang.tcl/topics'&gt;comp.lang.tcl&lt;/a&gt;. По
поводу древности идите на &lt;a href='http://www.tcl.tk'&gt;www.tcl.tk&lt;/a&gt;.
&lt;/p&gt;

&lt;h4&gt;Миф #5: tDOM и pr2nntp требуют разных версий Tcl (8.4 и 8.5)
соответственно.&lt;/h4&gt;

&lt;p&gt;
Wrong.
&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;% pkg_info | egrep 'tcl|tDOM'
tDOM-0.8.2          High performance XML data processing with Tcl
tcl-8.5.6           Tool Command Language
tcl-threads-8.5.6   Tool Command Language

% pkg_info -r tDOM\*
Information for tDOM-0.8.2:

Depends on:
Dependency: tcl-8.5.6
Dependency: tcl-threads-8.5.6
&lt;/pre&gt;
&lt;/p&gt;

&lt;h4&gt;Миф #6: elinks вставляет дурацкое поле по левому краю письма, которое
не убирается и всех раздражает. Меня особенно!!!! :(((((((&lt;/h4&gt;

&lt;p&gt;
Запустите elinks, нажмите 'o', зайдите в
Document-&amp;gt;Browsing-&amp;gt;Horizontal text margin и поставьте в поле value
число 0. Не забудьте сохранить правки.
&lt;/p&gt;

&lt;h4&gt;Миф #7: Мой wget качает и качает все feeds каждый раз заново, а вот
FirstRateFooBarRSSreader (buy 2 get 1 for free) -- нет.&lt;/h4&gt;

&lt;p&gt; Прочтите в документации раздел 2.2 File downloader. Если лень самому
возится с puf, скачайте &lt;a
href='http://pr2nntp.sourceforge.net/contrib/puf.tag.bz2'&gt;готовый
порт&lt;/a&gt;. (&lt;b&gt;Update&lt;/b&gt; 2009-01-30: или пользуйте стандартный fetch(1) из
FreeLSD 7.1, где он, наконец, начал по божески работать в конструкции
&lt;code&gt;fetch -mad -o %f %u&lt;/code&gt;). &lt;/p&gt;

&lt;h4&gt;Миф #8: Вот у меня есть несколько feeds, которые редко обновляются и
гадкий pr2nntp каждый раз их скармливает целиком INN, а мои пометки на
письмах "как прочитанные" испаряются. Так нельзя, я щетаю.&lt;/h4&gt;

&lt;p&gt;Дело отнюдь не в pr2nntp. Просто у вас за период между обновлением
таких feeds проходит столько времени, что INN успевает удалять старые
письма в newsgroup, а вы (посредством pr2nntp) отдаете их INN вместе с
новыми.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-3586067959191776190?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/3586067959191776190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/8-myths-about-pr2nntp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3586067959191776190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/3586067959191776190'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/8-myths-about-pr2nntp.html' title='8 myths about pr2nntp'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-5578849272888048668</id><published>2009-01-20T01:12:00.003+02:00</published><updated>2009-01-20T04:16:28.405+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>screen and libutempter</title><content type='html'>&lt;p&gt;Совсем внезапно обнаружилось неприятное поведение screen 4.0.3:
если xterm у нас собран с поддержкой libutempter, то собрать порт screen
на этой же машине не получится (оно валится на этапе configure с совершенно идиотским ``&lt;code&gt;error: Can't run the compiler - internal error. Sorry.&lt;/code&gt;''; скучные подробности опускаю -- они ясно видны в config.log). Решением есть 2 варианта: &lt;/p&gt;

&lt;p&gt;
&lt;ol&gt;
&lt;li&gt;Временно сделать &lt;code&gt;pkg_delete libutempter\*&lt;/code&gt;, собрать порт
screen, поставить libutempter обратно.

&lt;li&gt;Отрубить libutempter от xterm (заодно вместе с luit, если хотите
иметь человеческую поддержку локали koi8) и снести libutempter.

&lt;/ol&gt;
&lt;/p&gt;

&lt;p&gt;
Второй способ мне нравится больше. 
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-5578849272888048668?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/5578849272888048668/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/screen-and-libutempter.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5578849272888048668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5578849272888048668'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/screen-and-libutempter.html' title='screen and libutempter'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-6373183888071731771</id><published>2009-01-12T11:46:00.002+02:00</published><updated>2009-05-07T02:40:42.408+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><category scheme='http://www.blogger.com/atom/ns#' term='vmware'/><title type='text'>FreeBSD 7.1 and VMware Workstation</title><content type='html'>&lt;p&gt;
(&lt;b&gt;2009/05/07 Update:&lt;/b&gt; 3-й эпизод см. &lt;a href='http://gromnitsky.blogspot.com/2009/05/freebsd-72-and-vmware-workstation.html'&gt;тут&lt;/a&gt;.)
&lt;/p&gt;

&lt;p&gt;
Полного погружения с open-vm-tools не получилось. Хотя, с другой
стороны, максимальный минимализм все-таки преодолен. То есть, если
раньше из комплекса tools идущих с VMware Workstation использовалась
ровно 1: vmware-guestd (попробуйте догадаться для каких сложных вещей!),
то с любознательным щупаньем одновременно свежей FreeLSD 7.1 и не очень
свежих open-vm-tools (в портах есть только летняя версия) добавилась
insane возможность: содержимое X Primary стало отображаться в Windows
clipboard (и наоборот).
&lt;/p&gt;

&lt;p&gt;
(голосом офисного морона): Новые технологии в действии!
&lt;/p&gt;

&lt;p&gt; Стартовые условия &lt;a
href='http://witowd.livejournal.com/9585.html'&gt;остались
прежними&lt;/a&gt;. Разница в версии FreeBSD и использовании open-vm-tools
вместо идущих проприетарных tools с VMware Workstation.  &lt;/p&gt;

&lt;p&gt; Порт open-vm-tools ставит, среди прочей чепухи, 1 демон, 4 ядерных
модуля и 1 Очень Полезную Программу (о ней в самом конце заметки). 1 из
модулей бессмыслен по условиям задачи -- vmxnet.ko; vmmemctl.ko
выполняет роль мебели или даже настенной лепки; vmblock.ko и vmhgfs.ko
-- это те 2 штуки, которые якобы дают использовать Drag and Drop и
shared folders соответственно.  &lt;/p&gt;

&lt;p&gt;
&lt;div align='right'&gt;
Кто дал тебе имя&lt;br&gt;
Малышка из квартала Симмати?&lt;br&gt;
Зачем так искусно&lt;br&gt;
Губами ласкаешь коралл?&lt;br&gt;
О бездна блаженства!&lt;br&gt;
&lt;i&gt;-- Рубоко Шо, Время Цикад&lt;/i&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; Автор порта почему-то прописал в /usr/local/etc/rc.d/vmware-guestd
вот такое:&lt;/p&gt;
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
[ -z "$vmware_guestd_enable" ] &amp;&amp; vmware_guestd_enable="YES"
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;
Это значит, что вам не нужно ничего добавлять в /etc/rc.conf чтобы
vmware-guestd стал во тьме ram бегать за цикадами. Зато нужно (это было
правдой и раньше, но ваш покорный слуга об этом самым подлым образом
хранил молчание) добавить в .vmx файл виртуальной машины строчку:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
tools.syncTime = "TRUE"
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;
Иначе время никто не будет синхронизировать (точные сведения из
tarball'а см. в guestd/toolsDaemon.c и lib/include/vm_app.h). Это
также означает что для минималистической задачи (иметь условно точные
1 раз в минуту часы и ничего более от open-vm-tools), можно собирать
порт open-vm-tools-nox11, чтобы не мышеелозить по вкладкам
vmware-toolbox.
&lt;/p&gt;

&lt;p&gt;
Btw, vmware-guestd разжирел на свободных харчах и начал предъявлять
нахальные требования к ресурсам:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% top | grep guestd
  649 root          1  96    0 18116K   640K select   0:20  0.00%  vmware-guestd
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;
в тоже время когда закрытый предшественник:
&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;% top | grep guestd
  665 root          1  96    0  1620K   308K select   3:49  0.00%  vmware-guestd
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;
&lt;div align='right'&gt;
[...] африканские слоны и вообще не могут сравнится&lt;br&gt;
с индийскими даже и при равной численности -- последние&lt;br&gt;
далеко превосходят их и размерами, и боевым духом.&lt;br&gt;
&lt;i&gt;-- Тит Ливий, История Рима от основания города, XXXVII, 39, 13&lt;/i&gt;
&lt;/div&gt;
&lt;/p&gt;


&lt;p&gt; Экзотика, которой являются кернельные модули vmblock.ko и vmhgfs.ko
напоминают мне боевых слонов. При первом взгляде они поражают
воображение свои видом, а их наездники смотрят на окружающих с тем
особенным интересом, который присущ человеку рассматривающему на
корточках муравейник в лесу.  &lt;/p&gt;

&lt;p&gt; Но в битвах, как показала практика войн римского народа, слоны
вносят только помеху в большей степени именно тому войску, которое их
выставило на устрашение противника -- если слонов напугать, они начинают
метаться, давить собственных солдат и лететь, куда глаза глядят, сверкая
бивнями и хлопая ушами.
&lt;/p&gt;

&lt;p&gt;
Как и для всякой экзотики, интерес к vmblock.ko и vmhgfs.ko угасает,
когда пытаешься заставить их делать что-то более полезное, чем
таємниче виблискування из output команды kldstat.
&lt;/p&gt;

&lt;p&gt; Drag and Drop между host &amp; guest реализован так: vmblock.ko -- это
драйвер "блокирующей" файловой системы. Предполагается, что искомый
файл, перед тем как переедет на новое место жительства, сначала попадет
в temporally directory (обычно /tmp/VMwareDnD), откуда принимающая
программа не получит его (он будет для нее "блокирован") до тех пор,
пока тот не перепишется в нее полностью. Принимающая сторона ничего не
знает об temporally directory -- она читает смонтированный каталог с
симлинками (во FreeBSD это как бы /var/run/vmblock), думая, что они
(симлинки) и есть нужный ей файлы, о которых она пролила столько слез.
&lt;/p&gt;

&lt;p&gt; Хороший пример, как пользовать vmblock filesystem, можно прочесть в
&lt;a
href='http://sourceforge.net/mailarchive/message.php?msg_name=1227041227.18518.57.camel%40localhost'&gt;патче
Chris'a Malley&lt;/a&gt; к ядру Linux 2.6.27.  &lt;/p&gt;

&lt;p&gt; У vmblock есть свои проблемы идеологического свойства (например,
такой факт, что реализация этой файловой системы сделана как модуль
ядра, а не современным методом Filesystem in Userspace (FUSE)), но в
любом случаи, вся эта красота разбивается при попытке монтирования ее в
FreeLSD 7.1. &lt;/p&gt;

&lt;p&gt; Для еще пущего нагнетания сообщим, что смонтировать ее командой
mount вообще не получится, ибо просто нечем монтировать, как вежливо &lt;a
href='http://sourceforge.net/mailarchive/forum.php?thread_name=20090109180256.GB6177%40chantecler.medieval&amp;forum_name=open-vm-tools-discuss'&gt;
сообщил по этому поводу Ryan Beasley&lt;/a&gt;: &lt;i&gt;Unfortunately a standalone
mounter for vmblock on FreeBSD was never written. Mounting was embedded
in the vmware-user setuid wrapper.&lt;/i&gt; А этот самый vmware-user setuid
wrapper вообще исключен из состава порта.
&lt;/p&gt;

&lt;p&gt; Я, как и советовали, полез в
vmware-user-suid-wrapper/wrapper-freebsd.c, поправил путь к vmblock.ko в
LoadVMBlock(), пересобрал, запустил vmware-user-suid-wrapper в
предвкушении и радости появления смонтированного каталога
/var/run/vmblock, с чувством схожим на проявления счастья у моей кошки,
когда я ей варю рыбу. К несчастью, ожидания накрылись медным тазом,
который больше известен под названием паника ядра: &lt;/p&gt;

&lt;p&gt;
&lt;div align='center'&gt;
&lt;a
href='http://farm4.static.flickr.com/3470/3190081395_155ffcb233_o.png'
title='12 KB'&gt;
&lt;img src='http://farm4.static.flickr.com/3470/3190081395_b63d0ec50c.jpg' alt='12 KB'&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt; Красиво, правда? Ровно такая же реакция наблюдается при запуске
mount_vmhgfs для монтирования shared foldes. Какую из этого можно
извлечь мораль? Только ту, что для порта open-vm-tools у вас в
/etc/rc.conf должна быть 1 (одна) строчка: &lt;/p&gt;

&lt;p&gt;&lt;pre&gt;
vmware_guest_vmmemctl_enable=YES
&lt;/pre&gt;&lt;/p&gt;

Остальное будет ждать лучших времен. Может причина поведения vmblock.ko
и vmhgfs.ko есть та, что у меня не самая последняя версия WMware
Workstation, а может потому, что не были проведены священные ауспиции и
в Workstation многое запуталось и пришло в беспорядок, или потому, что
погода нынче такая, когда после утренней пробежки тащишься в парадном
синий как лазурит, а под душем чувствуешь себя будто только что
поплававший в обществе косатки ниже 60 параллели и вытащенный из воды
проплывавшим мимо кораблем со шведскими туристами. &lt;/p&gt;

&lt;p&gt; The last tip for today: запустите vmware-user из под иксов, to
enable copy and paste to and from your virtual machine, не забыв
предварительно поставить галочку в Settings-&amp;gt;Options-&amp;gt;Guest Isolation
вашей виртуальной машины. vmware-user хоть и грязно выругается на
невозможность to initialize blocking driver, но для copy and paste
дармоедствующий модуль vmblock.ko не требуется.  &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-6373183888071731771?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/6373183888071731771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/freebsd-71-and-vmware-workstation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6373183888071731771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/6373183888071731771'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/freebsd-71-and-vmware-workstation.html' title='FreeBSD 7.1 and VMware Workstation'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3470/3190081395_b63d0ec50c_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4369981222282317984</id><published>2009-01-01T22:42:00.003+02:00</published><updated>2009-01-02T01:12:51.263+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network'/><title type='text'>I Never Loved You Anyway</title><content type='html'>&lt;p&gt;
MPlayer r28208 из subversion с RTP ведет себя еще хуже чем обхаянный
нами в прошлой заметке Windows Media Player. Кроме невозможности его
(MPlayer) собрать, не кормя configure опцией --disable-x264-lavc, он имеет
наглость производить в отношении моего sample.mp4 диффамацию самого
низкого пошиба:
&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;
STREAM_LIVE555, URL: rtsp://chantecler.medieval/sample.mp4
Stream not seekable!
&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;
Казалось, давно уж прошли те времена, когда мы не могли ответить на
такое надругательство, щебеча как канарейка, способом из
&lt;a href='http://www.youtube.com/watch?v=b5_s76hV8FY'&gt;
славного прошлого&lt;/a&gt;:
&lt;/p&gt;

&lt;p&gt;
&lt;blockquote&gt;
You bored me with your stories&lt;br&gt;
I can't believe that I endured you for as long as I did.&lt;br&gt;
I'm happy it's over,&lt;br&gt;
I'm only sorry that I didn't make the move before you.
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt;
Отчего мы не могли так ответить, граждане? Оттого, что нас лишали
выбора.
&lt;/p&gt;

&lt;p&gt;
Кто же будет терпеть эти издевательства сегодня?
&lt;/p&gt;

&lt;p&gt;
&lt;pre&gt;
Starting playback...
A:   5.7 (05.6) of 173.0 (02:52.9)  5.0% 

MPlayer interrupted by signal 11 in module: unknown
- MPlayer crashed by bad usage of CPU/FPU/RAM.
  Recompile MPlayer with --enable-debug and make a 'gdb' backtrace and
  disassembly. Details in DOCS/HTML/en/bugreports_what.html#bugreports_crash.
- MPlayer crashed. This shouldn't happen.
  It can be a bug in the MPlayer code _or_ in your drivers _or_ in your
  gcc version. If you think it's MPlayer's fault, please read
  DOCS/HTML/en/bugreports.html and follow the instructions there. We can't and
  won't help unless you provide this information when reporting a possible bug.
Exit 1
&lt;/pre&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4369981222282317984?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4369981222282317984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/i-never-loved-you-anyway.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4369981222282317984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4369981222282317984'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2009/01/i-never-loved-you-anyway.html' title='I Never Loved You Anyway'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-4087054901869244818</id><published>2008-12-31T16:18:00.003+02:00</published><updated>2009-01-03T05:11:23.942+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='network'/><title type='text'>Как весело провести праздники</title><content type='html'>&lt;p&gt;Ситуация самая простая: если есть коллекция музыки и видео в одном
месте, то нет ничего глупее, чем таскать части коллекции за собой, как
прицепившиеся колючки лопуха. Это кажется вполне очевидным, что удобнее
to stream media files over a network, чем с грустью вспоминать, как
последний альбом Eluveitie остался лежать дома, а на ступеньках
парадного лед, который никто не желает убирать, а еще что Днепр зимой
похож на Волгу, потому что проплыть по нему можно только на
ледоколе. Вспоминать, что с неба сыпет белая дрянь, а по утрам,
заканчивая завтрак, с особенной ненавистью поглядывать на последнюю
страницу Коммерсанта, где напечатанная температура в Сиднее будит
одновременно удрученность и поток проклятий на свой адрес.
&lt;/p&gt;

&lt;p&gt;
Так вот. Чтобы не быть полевым хорьком, бегающим в зубах с flash дисками
и dvd (навсегда и безнадежно устаревшей чепухой), нужно поднять RTP
сервер для трансляции музыки и видео в то место, где ты находишься. Это,
кажется, ясно решительно всем.
&lt;/p&gt;

&lt;p&gt;
Проблемы начинаются, когда узнаешь, что divx/xvid файлы нужно
перекодировать в нечто, поддающееся, говоря русским языком,
seekable'льности по RTSP. Например, mpeg-4. Это касается фильмов; с
музыкой проще, т.к. пустить по RTP mp3 файл можно достаточно легко и без
всякой перекодировки, например, посредством live555MediaServer, который
идет в качестве example в комплекте c liveMedia. В качестве домашнего
задания читателю можно предложить упражнение по написанию простого
web-каталога с генерацией списка коллекции в виде rtsp:// ссылок.
&lt;/p&gt;

&lt;p&gt;
Какой RTP и RTSP сервер выбрать? Я провел очень плохой вечер копошась с
ffmpeg и vlc, чтобы потом совершенно случайно узнать, что у меня vlc был
собран без faac и faad2 и мой аккуратно сварганенный тестовый sample.mp4
(ffmpeg'ом и mp4creator'ом из mp3-файла) vlс игнорировал не потому что у
него вредный характер, а потому что у кого-то кривые руки.
&lt;/p&gt;

&lt;p&gt;
Впрочем, Darwin Streaming Server (DSS) есть давно в портах FreeLSD, и
списком зависимостей, в отличие от ffmpeg и vlc, испугать не
способен. Кроме того, многие клевещут, что с ним "все работает".
&lt;/p&gt;

&lt;p&gt;
Ладно. Собираем порт, читаем pkg-message и хватаеся за сердце: Mozilla,
Netscape4/7 and Opera etc... are not useful. DSS Administration Tool
requires MSIE(4.5 and later) J-Script feature. Пробуем DSS
Administration Tool из firefox и видим, что не все так страшно.
&lt;/p&gt;

&lt;p&gt;
Когда я вижу конфигурационные файлы в xml (а
/usr/local/etc/streaming/streamingserver.xml им в Darwin Streaming
Server и является), то всегда вспоминаю теплые слова Торвальдса по
поводу конфигурационных файлов Gnome:
&lt;/p&gt;

&lt;p&gt;
&lt;blockquote&gt;
In past discussions, I've seen people think that since I'm a
"developer", I should use a text-editor to edit binary configuration
files by hand (and anybody who calls XML "text" has drunk a bit too much
of the cool-aid).
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt;
Не смотря на эту пакость с конфигурированием, DSS запускается без
малейших проблем, а gmp4player и vcl счастливо запели мой sample.mp4.
&lt;/p&gt;

&lt;p&gt;
После тяжелой 2-й Пунической войны, народ Рима, не успев вернуть солдат
из легионов Спициона в Африке, по совету сената, тут же начал войну
Македонскую. Точно так же, закончив с RTP сервером, я начал воевать с
Windows Media Player.
&lt;/p&gt;

&lt;p&gt;
Кому дорого свое время, наилучшим решением будет положить на WMP и
пользовать для смотрения трансляций версию плеера vlc под Windows. Кому
нужен лишний геморрой, будет запускать wireshark, смотреть как WMP
посылает по RTSP метод DESCRIBE, читает красивый ответ от DSS с кодом
200, потом, полагая что вы совершенный идиот, попытается спросить ваш
http-сервер о наличие sample.mp4 и после этого покажет окошко "с
ошибкой", как всегда, дающее абсолютный нуль информации.
&lt;/p&gt;

&lt;p&gt;
Гугление показывает, что WMP умеет streaming только для своих asf и wma,
так что не поддавайтесь на рекламу "мы можем rtsp, мы можем
mpeg-4". Mpeg-4 оно может только для локальных файлов. В году 2002-м
родился enviviotv plugin для WMP, который якобы позволял играть mpeg-4
RTP поток из Darwin Streaming Server, о чем даже писали в Linux
Journal. Сейчас от enviviotv на сайте envivio.com отстался только
пресс-релиз, а plugin ушел куда-то глубоко под воду, исследовать темные
глубины океана. Сегодня, какие-то веселые парни из Elecard Ltd
предлагают Elecard AVC Streaming PlugIn for WMP всего за $40, так что
если вдруг, то вы знаете что делать; я же скачал неясно какой свежести
версию
&lt;a href='http://lists.apple.com/archives/Streaming-server-dev/2007/Feb/msg00042.html'&gt;
enviviotv.exe&lt;/a&gt; и теперь стал особенно восхищаться происходящим.
&lt;/p&gt;

&lt;p&gt;
Во-первых, оно все равно не может распознать mp4 сэмпл'ы идущие в
комплекте с Darwin Streaming Server, хотя играет мой
sample.mp4 (&lt;b&gt;поправка&lt;/b&gt; от 2009-01-03: распознает, если вместо rtsp://foo.bar говорить e-rtsp://foo.bar). Во-вторых, если не трогать настройки enviviotv, при попытке
начать издавать звуки, скромный WMP вместе с Vista от радости мигает
экраном и показывает вот такое окно:
&lt;/p&gt;

&lt;p&gt;
&lt;div align='center'&gt;
&lt;img src="http://farm4.static.flickr.com/3287/3152958519_3603794edd_o.png"
  alt="20 KB"&gt;
&lt;/div&gt;
&lt;/p&gt;

&lt;p&gt;
Мне оно очень нравится.
&lt;/p&gt;

&lt;p&gt;
Лечится убиранием галочки с "Use DirectDraw overlays if available" в
%SystemRoot%\System32\EnvivioTVSettings.cpl. Btw, EnvivioTVSettings.cpl
пускать нужно с правами администратора. Пожалуйста, не спрашивайте меня,
почему сделано так удобно, что настройки enviviotv бывают только system
wide.
&lt;/p&gt;

&lt;p&gt;
В-третьих, harm, который наносит enviviotv вашему WMP, выразится кроме
всего прочего и в том, что при проигрывании локальных файлов mp4 вы
получите задержку (буферизации?) как будто они вам передаются по RTP с
таким сомнительным рвением, как в России поют гимн. Эй! Dude, который
администрирует Linux в потасканном свитере. Да-да, вы. Я вас имею
ввиду. Прекратите нам тут на весь зал выводить голосом про белую овечку
и продукты Microsoft. Комментарии по этому поводу слушать сил никаких
нету. Хотя, конечно, я согласен граждане, иногда, чувствуешь себя ежиком
из анекдота.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-4087054901869244818?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/4087054901869244818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/12/blog-post.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4087054901869244818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/4087054901869244818'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/12/blog-post.html' title='Как весело провести праздники'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1168649918322623002</id><published>2008-11-04T08:41:00.000+02:00</published><updated>2008-11-04T08:44:24.339+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='development'/><title type='text'>Скверно сформулированный Спольски</title><content type='html'>&lt;p&gt;
Joel в своем
о &lt;a href='http://www.joelonsoftware.com/inc.html?14'&gt;последнем
опусе&lt;/a&gt; о StackOverflow так надулся от гордости, как петух после
утреннего кукареканья, что умудрился из 3-х причин, по которым
проект &lt;a href='http://stackoverflow.com'&gt;StackOverflow&lt;/a&gt; удался,
проигнорировать самую главную из них.
&lt;/p&gt;

&lt;p&gt;
3 фактора успеха, мне кажется, связаны были следующим образом:
&lt;/p&gt;

&lt;p&gt;
&lt;blockquote&gt;
&lt;pre&gt;
(1) &lt;i&gt;простота&lt;/i&gt;
 |
 |____(2) &lt;i&gt;профессионализм&lt;/i&gt;

(3) &lt;i&gt;игрушка&lt;/i&gt;
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt;

Пункт (1) в рассуждениях всеми нами любимого болтуна отсутствует. А он
(пункт), к несчастью, главный. Даже если бы Jeff Artwood имел комманду
из зеленых выпускников колледжа, шанс на провал был ничтожен, беря во
внимание наличие пункта (3).

&lt;/p&gt;

&lt;p&gt;

Именно удивительная техническая простота позволила игнорировать
документацию и багтрекинг (на начальной стадии, сейчас то он у них
появился). Если бы проект был навязан каким-то высокопоставленным
идиотом из верхнего менеджмента (только потому, что тот хотел утереть нос
старому ослу вице-президенту из отдела маркетинга), никакие мыльные
намеки на going to take 6 to 8 weeks не выдержали бы на воздухе и 3-х
секунд: был бы и жесткий график и контроль и бегающий с красными глазами
и высунутым языком, как русская борзая за вальдшнепами, project manager.

&lt;/p&gt;

&lt;p&gt;

Все это очень древние и миллион раз перекованные истины. Мы еще
обязательно увидим клоны StackOverflow с рекламой в половину экрана
горячих девушек, скучающих длинными зимними вечерами, где пытливые
люди будут задавать вопросы как безопасно для здоровья украсть Windows
Vista. Написаны клоны будут, разумеется, на омерзительном PHP, чтобы
потом со сказочной скоростью расплодится во всю длину матушки России. О
первых таких проектах напишут тысячи бесценных заметок в жиже и многие
блоггеры страшно взволнуются.

&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1168649918322623002?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1168649918322623002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/11/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1168649918322623002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1168649918322623002'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/11/blog-post.html' title='Скверно сформулированный Спольски'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-2583904699580176489</id><published>2008-10-30T03:08:00.002+02:00</published><updated>2008-10-30T03:12:43.316+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Ужасные новости</title><content type='html'>&lt;p&gt;
Какой шторм сейчас в fedora-devel-list. Страсти кипят, шипят, как масло
на сковородке. Настоящая буря в стакане.
&lt;/p&gt;

&lt;p&gt;
Висение иксов на tty1 вместо tty7 это, безусловно, крушение всех
надежд. Падение Геллы в бурлящий пролив Босфора. Некоторым, правда,
кажется, что обсуждение этого больше похоже на мужественную борьбу за
тень осла, но таких несознательных людей мы слушать не будем.
&lt;/p&gt;

&lt;p&gt;
Dax Kelson выступает перед пританами. Чело его взволновано, руки дрожат:
&lt;/p&gt;

&lt;p&gt;
&lt;blockquote&gt;
This specific Linux behavior is well documented in hundreds of
thousand of publications ranging from college text books, HOWTOs, Linux
books sold in retail stores, blogs, forums, guides, and training
manuals. Making a change invalidates all that published knowledge.
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt;
Как только он это произносит, начинаются ристания, кувыркаясь мечутся и здесь и там
возницы. Наездники задыхаются от негодования, слышен тяжелый храп
лошадей. Зрители падают ниц без сил.
&lt;/p&gt;

&lt;p&gt;
Пользователь fedora:
&lt;/p&gt;

&lt;p&gt;
&lt;blockquote&gt;
&lt;i&gt;(закрывая лицо руками)&lt;/i&gt;&lt;br/&gt;
Погиб я! О бесчестные, что поменяли tty7 на tty1!&lt;br/&gt;
Ради богов,&lt;br/&gt;
Примите плащ мой, я бегу.&lt;br/&gt;
&lt;i&gt;(убегает, рыдая)&lt;/i&gt;
&lt;/blockquote&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-2583904699580176489?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/2583904699580176489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/blog-post_30.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2583904699580176489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/2583904699580176489'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/blog-post_30.html' title='Ужасные новости'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8049937956368489339</id><published>2008-10-15T15:47:00.001+03:00</published><updated>2008-10-15T15:50:09.719+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='books'/><category scheme='http://www.blogger.com/atom/ns#' term='unix'/><title type='text'>Threads primer из Стивенса</title><content type='html'>&lt;p&gt;
Выложил &lt;a href="http://sites.google.com/site/gromnitsky/documentation/Appendix-B-Threads-Primer"&gt;
крохотное введение&lt;/a&gt; в "Основы многопоточного
программирования" из книжки Стивенса про IPC. Это, разумеется, всем
давно известные вещи, но все равно оно (введение) мне почему-то очень
нравиться, скорее всего из-за компактного размера и ясного изложения.
&lt;/p&gt;

&lt;p&gt;
Всем борцам за copyright: автор книги умер 10 лет назад, поэтому совесть
моя чиста. Всех наследников, издателей, переводчиков и проч. я отправляю
туда же, куда Артемий Лебедев регулярно отправляет сотрудников компании
СУП, т.к. финансовое состояние всех прихлебателей в издательском
бизнесе меня волнуют так же, как цены на апельсины в Кении в 1972 году.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8049937956368489339?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8049937956368489339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/threads-primer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8049937956368489339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8049937956368489339'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/threads-primer.html' title='Threads primer из Стивенса'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-1878751329723612846</id><published>2008-10-11T10:04:00.004+03:00</published><updated>2008-10-11T10:16:35.589+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tcl'/><title type='text'>Capturing output of Expect [send] command</title><content type='html'>&lt;p&gt;В кои то веки посреди груд папуасского мусора в зиване возник &lt;a href="http://groups.google.com/group/alt.russian.z1/browse_thread/thread/aeeba78d9594c41c"&gt;производственный вопрос&lt;/a&gt;. Соколов, конечно, умудрился максимально напустить тумана в том, что конкретно ему хотелось от Expect, хотя с поднятой им проблемой сталкиваются практически все новички в Expect, так что мы позволим себе здесь вышеприведенное обсуждение продолжить.&lt;/p&gt;&lt;p&gt;Правильно сформулированный вопрос стоит так: я посылаю с [send] текст и желаю получить ответ не просто поймав его посредством [expect], но желаю иметь этот output в переменной для моей-не-скажу-для-чего прихоти.
&lt;/p&gt;&lt;p&gt;Короткий ответ на такой вопрос будет такой: см. на переменную expect_out, которую заполняет [expect]. Это обычный Tcl array. Лучше всего понять, как он заполняется, это написать&lt;code&gt;
&lt;/code&gt;&lt;/p&gt;&lt;pre&gt;flush stdout
parray expect_out
&lt;/pre&gt;&lt;p&gt;Где нибудь в конце вашего диалога со spawn'еной программой. Для окончательно ясности, напишем 2 скрипта: 1-й на sh, который будет программкой с которой будет работать 2-й скрипт, написанный на Expect.&lt;code&gt;
&lt;/code&gt;&lt;/p&gt;&lt;pre&gt;% cat foobar.sh
#!/bin/sh

printf "Please enter your name: "
read name

[ -z "$name" ] &amp;amp;&amp;amp; {
  echo "For what such secretiveness?"
  exit 1
}

echo -- Thank you, $name
&lt;/pre&gt;&lt;p&gt;Все что сделает наш второй Expect-скрипт, -- это избавит вас от утомительной работы по введению имени, которое потребует foobar.sh.&lt;code&gt;
&lt;/code&gt;&lt;/p&gt;&lt;pre&gt;% cat foobar-expect.tcl
#!/bin/sh
# -*-tcl-*- \
# the next line restarts using expect \
exec expect "$0" "$@"

set cmd ./foobar.sh
set timeout 5
if {[catch {
  spawn -noecho $cmd
} r]} {
  puts stderr "$argv0 error: $r"
  exit 1
}

log_file -noappend temp-file
expect "Please enter your name: "
set name "Jeeves"
#set name ""
exp_send "$name\n"
expect {
  -re "Thank.* ${name}\r\n$" { puts "-- Yes, sir." }
  timeout {
      send_user "timeout because there was no prompt\n"
      exit 1
  }
}

flush stdout
parray expect_out

set status [wait $spawn_id]
if {[lindex $status 2] == 0} {
  exit [lindex $status 3]
}
&lt;/pre&gt;&lt;p&gt;Теперь запустим foobar-expect.tcl, чтобы окончательно разобраться с expect_out:&lt;code&gt;
&lt;/code&gt;&lt;/p&gt;&lt;pre&gt;% ./foobar-expect.tcl
Please enter your name: Jeeves
-- Thank you, Jeeves
-- Yes, sir.
expect_out(0,string) = Thank you, Jeeves

expect_out(buffer)   = Jeeves
-- Thank you, Jeeves

expect_out(spawn_id) = exp4
&lt;/pre&gt;&lt;p&gt;$expect_out(0,string) содержит именно то, что мы поймали командой [expect] после [exp_send]. Чтобы посмотреть на полный диалог, загляните в появившийся файл temp-file, создаваемый командой [log_file].
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-1878751329723612846?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/1878751329723612846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/capturing-output-of-expect-send-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1878751329723612846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/1878751329723612846'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/capturing-output-of-expect-send-command.html' title='Capturing output of Expect [send] command'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8533212354932220626</id><published>2008-10-09T09:12:00.001+03:00</published><updated>2008-10-09T09:13:18.355+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><title type='text'>Все просто</title><content type='html'>&lt;p&gt;  Даже от нодесов 1 раз в год бывает польза: случайно &lt;a href='http://groups.google.com/group/ukr.nodes/msg/05c4b2ba017e83b1'&gt; заметил&lt;/a&gt; ссылку на ports/www/youtube_dl. Да-да-да! Оказывается, мы с вами, дорогие граждане, занимаемся с Firefox совершеннейшей ерундой. Долой gnash!  &lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8533212354932220626?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8533212354932220626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/blog-post.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8533212354932220626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8533212354932220626'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/blog-post.html' title='Все просто'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-7792236717909589288</id><published>2008-10-07T09:26:00.003+03:00</published><updated>2008-10-12T08:00:09.693+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><title type='text'>Ужасы Firefox 3</title><content type='html'>&lt;p&gt; Убил пол воскресенья на запоздалый переход с Bon Echo. В результате никто никуда не перешел, а моя кошка имела возможность весь день наблюдать, как я извергал проклятия на все что попадалось под руку, то есть на следующее: &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;&lt;ol&gt; &lt;li&gt;FreeBSD 7.0 с найсвежайшими портами, но несвежими установленными пакетами.  &lt;/li&gt;&lt;li&gt;Firefox 3.0.3 source code.  &lt;/li&gt;&lt;li&gt;Cairo 1.4.10.  &lt;/li&gt;&lt;li&gt;SQLite 3.6.3. &lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt; Нужно заметить, что Firefox я собираю всегда руками, а не ставлю из портов, традиция чего тянется еще с версии 1.0, когда для компилирования под FreeBSD требовалось терпение и выносливость, как у солдат армии Ксенофонтовского Кира. К чему, спрашивается, такой героизм и самопожертвования? Если быть честным, но всему виной давно потерявшее меру собственное занудство и маниакальное желании собрать Firefox как можно более легким. Но, не в этот раз. &lt;/p&gt;  &lt;p&gt; gnash может заворачиваться в plugin для mozilla, но с условием, что он собран с gtk2. Firefox 2 у меня живет с gtk1, во-первых, потому что gtk1 быстрее 2-й версии, а во-вторых, потому что в нем отсутствует сглаживание шрифтов, которое я ненавижу каждой молекулой своих глаз. Понятно, что правильно воспитывая fontconfig сглаживание можно убирать, что я и делаю, чтобы радоваться emacs'у, собранному с gtk2, но это не мешает gtk1 оставаться good enough для Firefox. Раньше не мешало. &lt;/p&gt;  &lt;p&gt; Стало быть, что мы делаем? Скачиваем Firefox 3.0.3 и чуточку редактируем спрятанный .mozconfig от Bon Echo? Ага, держите карман шире. &lt;/p&gt;  &lt;p&gt; Выясняется, что тот nspr, что у меня уже установлен -- слегка outdated, nss -- тоже, Cairo им нужно версии 1.6, а sqlite, который оне полагают у меня есть, должен быть новее, чем самая самая последняя версия в портах FreeBSD. Ну, ради б-га, пускай берут все вышеперечисленное из своего tarball, раз оно там заботливо положено, да? Wishful thinking. &lt;/p&gt;  &lt;p&gt; configure и последующий make идут так тихо и гладко, как капельки дождя по стеклу за окном. Вы делаете себе крепчайший кофе и вдыхаете свежий осенний воздух из открытой двери балкона, рассуждая, что октябрь и серенькое небо, несмотря на известные недостатки, обладают тем преимуществом, что дают возможность нажать на тормоз сумасшедшей машине жизни XXI века, чтобы безопасно выйти с нее и размять уставшие члены. Как там у Поупа: &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;&lt;div align="center"&gt; Здесь листья лип оделись желтизной.&lt;br /&gt;
Давно ль они нам тень дарили в зной?&lt;br /&gt;
В тиши лесов хранит безмолвье птичий&lt;br /&gt;
Народ, презрев свой певческий обычай.&lt;br /&gt;
Утратив аромат, хоть слезы лей,&lt;br /&gt;
Поникли нежные цветы лилей. &lt;/div&gt;&lt;p&gt;&lt;/p&gt;  &lt;p&gt;  Вы мечтательно потягиваетесь, кошка мирно посапывает на кресле рядом, капли дождя продолжают монотонно маршировать. Вы поворачиваетесь к xterm'у и обнаруживаете, что кое-кто на тормоз уже нажал, потому что make отвалилось с воплем ld о невозможности найти библиотеку sqlite, где-то после 5 минут компилирования. &lt;/p&gt;  &lt;p&gt;  Вы смотрите в чем дело и ничего не понимаете: sqlite оно уже собрало (тот что идет в комплекте с Firefox), путь для ld к библиотеке указан. Так какого же тогда дьявола? Вы лезете в порт FreeBSD чтобы посмотреть на возможные имеющиеся решения и видите патч который добавляет к опциям компиляции sqlite путь в CFLAGS, а для ld -- содержимое %%PTHREAD_LIBS%%. Не слишком обнадеживающе. Что там, кстати, у нас должно содержаться в %%PTHREAD_LIBS%%? Это лучше симулировать: &lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;pre&gt;% cat Makefile.sample
PTHREAD_LIBS=-pthread
GECKO_PTHREAD_LIBS!=gcc -dumpspecs | grep -m 1 pthread | sed -e 's|^.*%{\!pg: %{pthread:|| ; s|}.*$$||'

foo:
       @echo '%%PTHREAD_LIBS%%' | \
                 sed -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS:C/-pthread/${GECKO_PTHREAD_LIBS}/}|'

% make -f Makefile.sample
-lpthread&lt;/pre&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt;  Обратите внимание на элегантный способ получения из исходного коварного -pthread старого знакомого -lpthread. Клянусь Герой, чтение FreeBSD'шных портов доставить вам немало минут радости. &lt;/p&gt;  &lt;p&gt;  Короче говоря -- ничего такого полезного тот патч не приносит. Но мы его накладываем, говорим "авось", переконфигурируем Firefox, ждем минут 5 и опять наблюдает ругню ld. &lt;/p&gt;  &lt;p&gt;  Гм. Тут вам приходит на ум низкая мысль руками добавить в строчку компиляции -L/usr/local/lib, чтобы оно слилось в объятьях с системным sqlite. Хи-хи-хи, говорите вы голосом Юли Тимошенко, наблюдая за продолжением компиляции Firefox и потираете руки. Как бы не так. &lt;/p&gt;  &lt;p&gt;  Начинается какое-то совершенно неудобоваримые мямлянье от nss, прекратить которое у вас падает желание одновременно с понижением температуры кофе в чашке. На память приходят забытые образы сражений с Firefox 1.5.x, повторить которые вам хочется так же, как Киасакру подвергаться опасностям в преследовании ассирийцев, поэтому вы решаете поступить, как мидийский царь и возложить на кого-нибудь другого вытаскивание каштанов из огня, сиречь идете к порту FreeBSD, надеясь, что не капитальные изменение его вами удовлетворит ваше стремление и решат проблему с линкованием sqlite и дрянным поведением nss. &lt;/p&gt;  &lt;p&gt;  Тут оказывается, что несмотря на ваши ухищрения с минимизацией обновлений системы, гадкий порт настаивает, чтобы вы провели обновления cairo, потому что добродушные люди, писавшие bsd.gecko.mk добавили туда по умолчанию зависимость от системного cairo, когда вы хотите использовать тот, что идет в комплекте с Firefox. О боги, доживу ли я до этих дней, когда не нужно будет мне искать, как золото в руде, как жалкий, старый дуралей, блеск радости модификации, бурча всем атанде? &lt;/p&gt;  &lt;p&gt;  Косметически отделав порт, вы скептически говорите make и идете повторно делать кофе. Ища чем заняться и предвкушая gnash, вы думаете, что теперь сможете, наконец, снести никому не нужный gtk1. Приготовившись к самому худшему, вас озаряет почти что улыбкой окно xterm'а, где видно благополучное завершение компиляции. Как любит говорить один мой знакомый (по ничтожнейшим причинам вроде этой): жизнь налаживается. &lt;/p&gt;  &lt;p&gt;  Жаль, я так и не понял, как у Firefox с gtk2 одновременно указать шрифт Arial для всех диалогов и меню и LucidaTypewriter для URL bar. Стандартное в userChrome.css:&lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;pre&gt;* {
       font-family: Arial !important;
       font-size: 9pt !important;
}
#urlbar {
       font-family: LucidaTypewriter !important;
       font-size: 9pt !important;
}&lt;/pre&gt; &lt;p&gt;&lt;/p&gt;  &lt;p&gt; не помогает. Все равно в URL bar остается Arial. &lt;/p&gt;  &lt;p&gt;  Кто не знает, то теперь Firefox 3 игнорирует /usr/local/lib/browser_plugins, чтобы не упасть от plugins от прежних версий. Могли бы и снизойти, чтобы предупредить. &lt;/p&gt;  &lt;p&gt;  А еще Firefox 3 перестал поддерживать pkg-config. Очень удобно стало, например, собирать mplayerplug-in. Помните, что желала Берти Вустеру в детстве одна из его тетушек? Одеть на шею веревку с камнем и броситься в озеро. Именно это хочется посоветовать сделать тому, кто убедил девелоперов Firefox в бессмысленности pkg-config. В общем, как там у Поупа: &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;&lt;div align="center"&gt; Струится ливень, и, полны печали,&lt;br /&gt;
поникли, птицы замолчали.&lt;br /&gt;
тем улыбка Делии одна&lt;br /&gt;
небу возвратить вольна,&lt;br /&gt;
природе прежнее обличье,&lt;br /&gt;
роз и пенье птичье. &lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-7792236717909589288?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/7792236717909589288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/firefox-3.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7792236717909589288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/7792236717909589288'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/10/firefox-3.html' title='Ужасы Firefox 3'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-8166819757941205799</id><published>2008-09-28T12:02:00.001+03:00</published><updated>2008-09-28T14:08:58.931+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='test'/><title type='text'>Еще один тест</title><content type='html'>&lt;div align='center'&gt; &lt;p&gt; Теперь в виде html. &lt;/p&gt;  &lt;p&gt; Разных преразных абзацев. &lt;/p&gt;  &lt;p&gt; И &lt;i&gt;всяких&lt;/i&gt; &lt;b&gt;выделений&lt;/b&gt;. &lt;/p&gt;  &lt;p&gt; И прочих радостей бытия. &lt;/p&gt;  &lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-8166819757941205799?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/8166819757941205799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/blog-post_28.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8166819757941205799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/8166819757941205799'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/blog-post_28.html' title='Еще один тест'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8518021139708603317.post-5200472816809415052</id><published>2008-09-28T05:27:00.000+03:00</published><updated>2008-09-28T05:37:11.378+03:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='test'/><title type='text'>Прощай LiveJournal, желаю тебе провалиться в тартарары к чертовой матери</title><content type='html'>Начинаем новую жизнь.

Впрочем, для ее рождения сначала нужно найти клиент blogger'a для emacs, иначе новорожденный погибнет от тоски.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8518021139708603317-5200472816809415052?l=gromnitsky.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gromnitsky.blogspot.com/feeds/5200472816809415052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/livejournal.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5200472816809415052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8518021139708603317/posts/default/5200472816809415052'/><link rel='alternate' type='text/html' href='http://gromnitsky.blogspot.com/2008/09/livejournal.html' title='Прощай LiveJournal, желаю тебе провалиться в тартарары к чертовой матери'/><author><name>ag</name><uri>http://www.blogger.com/profile/17579163349789748194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_W-OHaMHyRAE/TFM2otudYqI/AAAAAAAAAG0/8Jc4VOTt1DY/S220/ag.jpg'/></author><thr:total>5</thr:total></entry></feed>
