<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>smetana.name</title><link href="https://www.smetana.name/" rel="alternate"></link><link href="https://www.smetana.name/feeds/all.atom.xml" rel="self"></link><id>https://www.smetana.name/</id><updated>2016-10-19T17:31:44+02:00</updated><entry><title>letsencrypt.sh on CentOS 6</title><link href="https://www.smetana.name/blog/2016/02/25/letsencryptsh-on-centos-6/" rel="alternate"></link><published>2016-02-25T00:00:00+01:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2016-02-25:/blog/2016/02/25/letsencryptsh-on-centos-6/</id><summary type="html">&lt;p class="first last"&gt;There is a new certificate authority: Let's Encrypt. They provide free
signed certificates for everyone and moreover the whole process of
registration, certificate signing and renewing can be fully automated.
The offcial client is rather complex and I dare to say bloated. There
are alternatives though.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;&lt;a class="reference external" href="http://letsencrypt.org"&gt;Let's Encrypt&lt;/a&gt; was difficult not to notice of. It's a
new certificate authority providing free certificate signing for everyone. And
on top of it the whle process of registration, certificate signing, renewal and
revoking can be scripted and automated by the CA provided &lt;a class="reference external" href="https://github.com/letsencrypt/letsencrypt"&gt;client tools&lt;/a&gt;. The tools can even automatically
reconfigure the most popular web servers (Apache and Nginx). It has a drawback
though: The client itself is quite a big pile of Python scrips with heavy
dependencies. Moreover the Python 2.6 support is marked experimental. Not quite
perfect match to CentOS 6.&lt;/p&gt;
&lt;blockquote&gt;
This server actually runs on CentOS 6. It's not only because it was the
latest CentOS available when I first installed it. I still keep the system
since RHEL-7 and therefore CentOS 7 dropped the 32bit x86 support. Given the
machine is a cheap rented VM with little disk space and memory, the 64bit
architecture would be a really wasteful choice.&lt;/blockquote&gt;
&lt;p&gt;The good news is that Let's Encrypt builds on open &lt;a class="reference external" href="https://github.com/ietf-wg-acme/acme/blob/master/draft-ietf-acme-acme.md"&gt;ACME protocol&lt;/a&gt; and
the smart people on the Internet came with alternative clients requiring much
fewer dependencies and resources.&lt;/p&gt;
&lt;p&gt;The one that looked to be the one suitable for my underpowered ancient server
seemed to be &lt;a class="reference external" href="https://github.com/lukas2511/letsencrypt.sh"&gt;letsencrypt.sh&lt;/a&gt;.
It's a Bash script requiring only &lt;tt class="docutils literal"&gt;curl&lt;/tt&gt; and &lt;tt class="docutils literal"&gt;openssl&lt;/tt&gt;. And the good news
is: it really works and getting it to work is actually pretty simple.&lt;/p&gt;
&lt;p&gt;For those who would want to give it a try on CentOS/Fedora: I've build rpm
&lt;a class="reference external" href="https://copr.fedorainfracloud.org/coprs/tsmetana/letsencrypt.sh/"&gt;packages for myself in COPR&lt;/a&gt; (COPR is
quite broken these days: the builds might show as fail though the packages are
there). Thepackage contains just a few files:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
/etc/letsencrypt.sh
/etc/letsencrypt.sh/config.sh
/usr/bin/letsencrypt.sh
/usr/share/doc/letsencrypt.sh
/usr/share/doc/letsencrypt.sh/LICENSE
/usr/share/doc/letsencrypt.sh/README.md
/usr/share/doc/letsencrypt.sh/domains.txt.example
/usr/share/doc/letsencrypt.sh/hook.sh.example
&lt;/pre&gt;
&lt;p&gt;Obviously, the main &lt;tt class="docutils literal"&gt;/usr/bin/letsencrypt.sh&lt;/tt&gt; script and its configuration
&lt;tt class="docutils literal"&gt;/etc/letsencrypt.sh/config.sh&lt;/tt&gt;. There are several configuration steps
required. First, edit the &lt;tt class="docutils literal"&gt;/etc/letsencrypt.sh/config.sh&lt;/tt&gt;. First, the default
CA URL is set to &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;https://acme-v01.api.letsencrypt.org/directory&lt;/span&gt;&lt;/tt&gt;. For the
testing purposes it's wise to point it to a staging API instance at
&lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;https://acme-staging.api.letsencrypt.org/directory&lt;/span&gt;&lt;/tt&gt;. This will issue invalid
certificates but doesn't have that strict quota. Choose a &lt;tt class="docutils literal"&gt;BASEDIR&lt;/tt&gt; value:
this is the directory where the domains configuration file would have to be
created, where you would store your private key and also the script would store
the ceritificates obtained from the CA. So &lt;tt class="docutils literal"&gt;/etc/letsencrypt.sh/&lt;/tt&gt; is a
reasonable choice.&lt;/p&gt;
&lt;p&gt;The other important thing is the &lt;tt class="docutils literal"&gt;WELLKNOWN&lt;/tt&gt; directory. That's where the ACME
server would look for the HTTP challenge files (see the &lt;a class="reference external" href="https://letsencrypt.org/how-it-works/"&gt;How it Works document&lt;/a&gt;). The script should have write
permissions to the directory.&lt;/p&gt;
&lt;p&gt;Then set a path to the private key (&lt;tt class="docutils literal"&gt;PRIVATE_KEY&lt;/tt&gt;) used to identify your
Letsencrypt account: you may need to remove it when switching from the staging
API to the production one.&lt;/p&gt;
&lt;p&gt;The last mandatory field in the &lt;tt class="docutils literal"&gt;config.sh&lt;/tt&gt; is the self-explanatory &lt;tt class="docutils literal"&gt;CONTACT_EMAIL&lt;/tt&gt;...&lt;/p&gt;
&lt;p&gt;Now for the domains you want to have the certificates issued for: create a
&lt;tt class="docutils literal"&gt;BASEDIR/domains.txt&lt;/tt&gt; file with a simple format:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
domain.tld server.domain.tld another.domain.tld
nextone.tld andanotherserver.nextone.tld
&lt;/pre&gt;
&lt;p&gt;The important thing: each domain has to be accessible over HTTP and serve the
challenge file: make sure to set up the web server accordingly: unlike the
oficial client, &lt;tt class="docutils literal"&gt;letsencrypt.sh&lt;/tt&gt; will not do that for you. The staging API is
really great to test your setup.&lt;/p&gt;
&lt;p&gt;Once you think you're done:&lt;/p&gt;
&lt;pre class="literal-block"&gt;
letsencrypt.sh -c
&lt;/pre&gt;
&lt;p&gt;...and watch the logs. If things work, just create a monthly cron job and enjoy.
If not... well, you wouldn't be doing this not knowing the drill already...&lt;/p&gt;
&lt;p&gt;All in all: &lt;tt class="docutils literal"&gt;letsencrypt.sh&lt;/tt&gt; rocks. Thanks to the author.&lt;/p&gt;
</content><category term="Tech"></category><category term="web"></category></entry><entry><title>Lenovo Carbon X1 and Fedora</title><link href="https://www.smetana.name/blog/2015/12/14/lenovo-carbon-x1-and-fedora/" rel="alternate"></link><published>2015-12-14T00:00:00+01:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2015-12-14:/blog/2015/12/14/lenovo-carbon-x1-and-fedora/</id><summary type="html">&lt;p class="first last"&gt;My old laptop was a super-heavy (and performance-heavy) Lenovo T520.
Never got really used to its size. So when I had to replace my work laptop I
took Lenovo X1 Carbon (3rd gen.) and installed Fedora on it. I expected
improvement in every aspect. As usually I was wrong.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;My employer wants us to re-new out-of-warranty hardware. This includes laptops.
Till the last week I was using Lenovo T520: heavyweight, battery sucking beast
that could have been used as a melee weapon... When it went out of warranty and
I was supposed to have it replaced..., I waited. It was the time when some of the
more misantropic designers at Lenovo succeeded with the idea of removing physical
buttons from the trackpoint (the only pointing device I'm able to use on a
laptop -- touchpads are simply out of my motoric abilities). And I didn't like
the big laptop anyway. I liked my old X61. I wanted that. Just faster, newer.&lt;/p&gt;
&lt;p&gt;Then there was the Carbon X1: razor-thin, light, powerful. And even more unusable
because apparently removal of the physical mouse buttons didn't make the users
suffer enough. The most expensive Lenovo ultrabooks line had also one of the keyboard
rows replaced by some software-controlled touch strip that most of the marketing
victims never figured out how to use. Brilliant move by Lenovo. I either don't like
people much.&lt;/p&gt;
&lt;p&gt;When guys at Lenovo had enough of their fun, they decided to go back to doing
business and producing laptops people wouldn't want to kill them with (the only
reasonable thing those machines could have ever been used for).&lt;/p&gt;
&lt;p&gt;So... Thinkpads x50 looked much better. Obviously some of the business-sustaining, cost-cutting
decisions had to be made: soldered RAM (memory slots are obsolete), clickable
touchpad (I know, Apple knows how to make them, sadly this is about Lenovo),
new RealTek NICs (RealTek is not that bad as PowerVR or Mali, but still...) and of course:
firmware! Still this stuff seemed to be usable at least.&lt;/p&gt;
&lt;p&gt;But I was tired of heavy T500s and their big dust-catching docking stations with
so many connectors. All in all, I need two monitors, two USB ports, microphone
and headphone and that's it. It's 2015, these things Just Work these days. And I
wanted the pretty and shiny stuff: Carbon X1 in its third generation. Third! They
had to perfect-out that thing. It's going to be awesome, trust me. Let's unpack it.&lt;/p&gt;
&lt;p&gt;When it came to the laptop itself, it looked OK(ish...). Apart from the fact
the screws are some 0.5 mm longer than the holes, so the case is loose and
rattles. Later I found out everybody I knew using this machine has tried to
tighten the screws and all of them failed. The screws are simply too long. Haha! My
admiration of Lenovo designers should be probably extended also to their QA. Of course,
the RAM is soldered on the mainboard (8 GB in my case) and of course there is the
Apple-like keyboard (the old Thinkpad keyboard I have on this old, wonderful, sturdy,
perfectly designed X61 I'm typing this post on, was the best thing ever; even the Apple
folks could envy you!, fools at Lenovo; I know... it would spoil the fun). And of course, there was
some &amp;quot;invention&amp;quot; put in the keyboard layout, so people have something to get used
to (and again: X61 is thiiiis tiny... and still... so much better keyboard). My almost 20
years old habit of Alt-F1 to Alt-F4 combination to switch between the four desktops is ...
not possible. Had been turned
to Alt-Fn-F1 to Alt-Fn-F4!? Thankfully, the trackpoint is there and moves the
cursor down really well... I want it to move up too sometimes though... Let's use
the force... OK, that works. Hm. Whatever. I drive Citroen, I'm used to rattling
and violence. But otherwise, everything is comfy and never breaks. (And my Citroen
was CHEAP!)&lt;/p&gt;
&lt;p&gt;Installing Fedora 22 is a boring business. I had been warned not to install F23
to avoid problems with Wi-Fi stability... Anaconda can't install over wireless
anyway. Never did, even on X61 or T520. Just won't connect. Hidden SSID or enterprise
WPA... All wrong. Must have been designed that way (fun!). There's some dongle where
one can plug the RJ45 connector. Fits here, yes. No surprises. Fedora installed.&lt;/p&gt;
&lt;p&gt;It boots, I can log in. With minor violence applied on the trackpoint thingie I
can choose &amp;quot;Shut down&amp;quot; from the XFCE menu. Almost like the old ugly T520. Just
more silent and slightly faster (though I expected more from the SSD). Most of
the time the laptop would be docked connected to much more convenient LCD panels
(two of them: I got used to write longer texts on a rotated screen).&lt;/p&gt;
&lt;p&gt;Let's plug in the dock connector (Yes. The evolution: the ThinkPad OneLink Pro dock
is not a dock, but yet another box with a thick cable.). It boots and I can see
the bootloader prompt on the laptop LCD but nothing at all on the external
monitors. Turned out it takes several seconds for the external screens to turn
on. There is even an option in EFI/BIOS to configure delay on boot to give the
docking station chance to turn the monitors on. All the systemd violence that
saved few precious seconds on boot in vain. Lenovo doesn't like even the systemd
developers. At least, no misantropist conspiracy here.&lt;/p&gt;
&lt;p&gt;The image is mirrored using the lowest common resolution of the detected
monitors on both of them. Odd. Let's log in and tell xrand to fix this: turn
the laptop LCD off, and put the two external monitors next to each other. Now
there is no image on the larger panel and the smaller one flickers beyond
readability. No fiddling with xrandr fixes this. The only possible combination
is one external monitor plugged to the dock and the laptop screen. I'm getting
really upset.&lt;/p&gt;
&lt;p&gt;It turns out the &amp;quot;dock&amp;quot; is not what one would expect: It's basically an USB 3.0
hub with some devices hard-wired to some of the ports. So with the dock one gets
and USB graphic card, USB NIC and USB sound card. Unplugging it makes the
devices disappear: very funny with the soundcard for example.&lt;/p&gt;
&lt;p&gt;And the USB NIC: marvellous piece of hardware: took me quite some time that
when the thing decides to stop detecting carrier on the ethernet, the only thing
that helps is reloading the r8152 module. No, even reboot won't help. Reading
the other poor &amp;quot;ThinkPad OneLink Pro&amp;quot; users comments on Lenovo site I suspect
this is simply crappy hardware/firmware. NFS has become an unexpected adventure
with the new Lenovo hardware. Bet your data on it.&lt;/p&gt;
&lt;p&gt;In the end the only undeniable improvement is much longer battery life (some 10
hours). It's not that big concern to me though... There power plugs in the
meeting rooms and I travel really rarely. The rest is just pure downgrade in
every aspect with the &amp;quot;dock&amp;quot; being definitely the biggest disappointment.&lt;/p&gt;
&lt;p&gt;The length of this post is proportional to my frustration. Given the official
price tag on the Carbon X1 and the unbelievably crappy &amp;quot;dock&amp;quot;...
Just keep your old ThinkPad x20/x30 and just ignore this marketing scam.
My next laptop is going to be Mac. And Microsot has also produced very good
hardware, they make even laptops nowadays..&lt;/p&gt;
</content><category term="Tech"></category><category term="Fedora"></category><category term="hardware"></category></entry><entry><title>Agilia Conference Day 2</title><link href="https://www.smetana.name/blog/2015/03/27/agilia-conference-day-2/" rel="alternate"></link><published>2015-03-27T00:00:00+01:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2015-03-27:/blog/2015/03/27/agilia-conference-day-2/</id><summary type="html">&lt;p class="first last"&gt;Here are some more of the unrefined notes from the Agilia conference
along with even more unrefined thoughts about what I have learned
there.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I was quite happy about the &lt;a class="reference external" href="https://www.smetana.name/blog/2015/03/26/agilia-conference-day-1/"&gt;first day of the Agilia conference&lt;/a&gt; as you might
already know. And was looking forward for the second one.&lt;/p&gt;
&lt;p&gt;I'm not sure what is your experience with keynotes. Quite frequently those are
the least interesting talks at any conference. And I'm afraid to report Agilia
was not an exception to the rule. The keynote's title was &amp;quot;Attracting talent&amp;quot;
however most of the talk was about building office spaces. I was not really
convinced this was related to the title in any way... And I found the talk
unusually boring. Perhaps I was not the right audience.&lt;/p&gt;
&lt;p&gt;However the second one proved to be quite different: Zsolt Kulcsar shared his
views about building trust within companies. Mr. Kulcsar, albeit graduated
psychologist,  works for another small web development company.
And this one might be pretty unusual.
It was the first time I've heard someone saying the company's top priority
is their employees. The talk was focusing on the evolution of the organizations
from the tribal gangs ruled by a single despot through modern profit-oriented
corporations and post-modern people and innovation driven companies to the
organizations resembling a living creature where each member functions as a
vital organ. He talked about how their firm tries to capture moods of the
employees, lets them get to understand their customers as perfectly as possible
and maintains very high level of transparency both internally and also towards
the clients. Interesting and even inspiring talk.&lt;/p&gt;
&lt;p&gt;Jordi Falguera and Victor Firén talked about the Behaviour Driven Development
methodology and demonstrated practically part of the development cycle as they
use it in GTech. This was the most technical and practical talk of all the
conference. The speakers talked not only about the BDD supporting framework and
the tool GTech developed for themselves but also about the practises that worked
for them the best: like do things right from the beginning to prevent the
technical debt to pile up and become unmanageable later.&lt;/p&gt;
&lt;p&gt;Roland Tiefenbrunner spoke about his experiences as a founder of two startups
and scrum master in other one. Here's some of the ideas I found interesting or
important:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Use hypothesis instead of requirements; invest in experiments&lt;/li&gt;
&lt;li&gt;The customer should pay even for the minimum viable product&lt;/li&gt;
&lt;li&gt;Get first feedback ASAP&lt;/li&gt;
&lt;li&gt;Focus on solving the problem, not the solution itself&lt;/li&gt;
&lt;li&gt;Use cohort analysis and actionable metrics&lt;/li&gt;
&lt;li&gt;Decide what to build before building it&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We're almost at the end: Arne Åhlander's Becoming a successful product owner was
a set of good advices to the product owners -- what tools and techniques can
help them in their quests. Arne suggested to use a playbook to keep information
about the product, stakeholders, roadmap, backlog, but also the product vision
and definitions of &amp;quot;ready&amp;quot; and &amp;quot;done&amp;quot;. The important part for presenting ideas
is their visualization (canvas). The products should make customers happy,
therefore it is important to to find out what are the customer's jobs, pains...
It is also important to realize what is my &amp;quot;unfair advantage&amp;quot;, what do I have the
others can't. And making use of it.&lt;/p&gt;
&lt;p&gt;The conference's grand finale was Angel Medinilla's Change management
presentation. Even though it was not too new for anyone who went through some
related soft-skills training (like me): it reiterated the idea that to make a
change one has to first convince the others that status quo is unbearable, make
them realize the pains the change will relief and move slowly step by step to
the goal. Angel is a showman and turned the talk into a wonderfully entertaining
event. And it was also a very suitable topic for the last talk.&lt;/p&gt;
&lt;div class="section" id="the-takeaways"&gt;
&lt;h2&gt;The Takeaways&lt;/h2&gt;
&lt;p&gt;One big thing: agile is not a software development method. At least not only. It
is an organization method: of anything. Most notably it has become an standard
for not only the small and quickly moving start-ups but also for large companies
who realize they need to adapt to survive.&lt;/p&gt;
&lt;p&gt;I have heard several recurring themes in the talks:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Companies are here for the people not the other way round&lt;/li&gt;
&lt;li&gt;Focus on customer, employees; during the whole conference I don't remember
hearing the words &amp;quot;shareholder&amp;quot; or &amp;quot;investor&amp;quot;&lt;/li&gt;
&lt;li&gt;Repetition and routine are necessary for doing things right; it must be a
habit, it must make people uncomfortable breaking it&lt;/li&gt;
&lt;li&gt;Get to know the people you work with: learn about their goals, motivations,
fears; and help them to achieve what they want&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And again: much of those may look like clichés any corporate employee hears and
sees in their internal company communications way too often. The context of
agile organizations however emphasises why is it necessary to keep them on mind.
&amp;quot;The people are our greatest asset.&amp;quot; Which of the corporations doesn't trump
something like this? I would guess only minority of those company employees really
feel that way and perceive such statements as propaganda that somewhat belongs to
the territory. The agile organization cannot afford such sentiment to grow among
the people. The agile methods bring the results at a cost: they put more stress
on people -- they have to operate with more frequent deadlines, the requirements
and environment change more often, even the teams themselves can re-arrange more
often... To sustain the conditions people have to believe the employer, the work,
the colleagues... Creating the environment where agile methods have chance to
succeed then takes much more than just train few scrum masters.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="open-source"&gt;
&lt;h2&gt;Open Source?&lt;/h2&gt;
&lt;p&gt;Of course I had also some opportunity to chat with random people during the
breaks and in the evening party. And of course I have asked about things I work
on at job, in my spare time... I live in a bubble where FOSS is standard and the
weird thing is actually &lt;em&gt;not to use it&lt;/em&gt;. Note one: open source is in some
environments only becoming accepted. And quite notably: it is happening &amp;quot;from
the bottom&amp;quot;: the admins, developers, use Linux and FOSS for their own needs and
get it in production by selling it upwards. This means losing mindshare might be
quite dangerous these days. The desktop matters even though it is never going to
be for the masses.&lt;/p&gt;
&lt;/div&gt;
</content><category term="Tech"></category><category term="development"></category><category term="management"></category></entry><entry><title>Agilia Conference Day 1</title><link href="https://www.smetana.name/blog/2015/03/26/agilia-conference-day-1/" rel="alternate"></link><published>2015-03-26T00:00:00+01:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2015-03-26:/blog/2015/03/26/agilia-conference-day-1/</id><summary type="html">&lt;p class="first last"&gt;I spent Tuesday and Wednesday at the Agilia conference and it's fair to
acknowledge that despite the agile development and agile organization
ideas resonate with my mindset quite a lot, I have been alway somewhat
repelled by the startup culture that surrounds them and the way it's
been presented by  some of the internet media. I've had a great chance
to correct my view and not only that&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I am involved in agile developed projects at my job. Only very indirectly though:
I manage a team working on several projects and two of them use Scrum. And
it is a rather new thing around so there was something to learn in the past few
months for me. I must say that the Scrum---or perhaps the way I saw it
implemented---quite captured me. That much that I'm actually trying it out with the
project I'm directly involved in... So, I decided to visit the Agilia
conference.&lt;/p&gt;
&lt;p&gt;I was hoping to learn about various implementation details of agile methods for
different types of projects and teams. And Agilia did not disappoint me in this
regard. However I had not realized how much could be transfered from the work
organization to the company orgainzation. I have seen some of
this in, e.g. &lt;a class="reference external" href="http://www.forbes.com/sites/stevedenning/"&gt;Steve Denning's Forbes column&lt;/a&gt; and even though his observations fit
quite well what I see around myself, I was rather sceptical about the solutions Mr.
Denning presented: and quite often it was some form of agile organizations. At Agilia I had
a chance to meet people who already implemented some of the ideas and who were
able to describe the change they brought and obstacles along the way. This was
the biggest (pleasant) surprise: I learned not only how do the modern companies
approach the product development but more imporantly what actually makes them
&amp;quot;modern&amp;quot;.&lt;/p&gt;
&lt;p&gt;The conference was opened by a keynote by Mario Almondo, the COO of Scuderia
Ferrari (the F1 racing team). Mr. Almondo spoke about culture and its necessity
for a success. The talk was of course attractive largely by the fact the
speaker was part of a true legend: only few people can refer to Jackie Icks or
Michael Schumacher as colleagues. And yet another difference: How many sport
or automobile analogies have you heard in software development? Now, this speaker
was really talking about cars and races. And software and IT companies popped
up as the &amp;quot;other part&amp;quot; of the analogy:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Winning a race is not enough to win the championship: one time success doesn't
matter that much as the ability to repeat it.&lt;/li&gt;
&lt;li&gt;Doing things right must be a habit, a routine. Realizing what things should be
like is not enough. Doing them right once is useless.&lt;/li&gt;
&lt;li&gt;To build a team one must know the people: their past, their ambitions, their
goals.&lt;/li&gt;
&lt;li&gt;We don't want just to win over the competition. We want to innovate for the
customer.&lt;/li&gt;
&lt;li&gt;If the top management does not care, the team cannot win.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I realize how these may sound as clichés but really it was the speaker's
personality and the different context that augmented their actual importance. And
clichés become clichés quite often for a good reason...&lt;/p&gt;
&lt;p&gt;The other talk I have attender the first day was presented by Anna Danes Boix
who was working for a completely distributed web development company and spoke
about the challenges it brought and ways to overcome them. Distributed in this
case means 228 people living in 25 countries, who never meet in person: the company
effectively has no travel budget (some 400 Euros spent on travelling in the
past 6 years) and still the company is  profitable and maintains really low
turnover rate. Anna spoke about the necessity to focus on the people: First the
clients, second the employees. And of course not everybody is capable of working
in such a team: the technical skills are necessary but not enough, it really
needs people who are able to communicate, appreciate quality and strive for it.
And of course the company needs to treat the people so they feel important and
engaged: the company exists not only to make the clients to reach their goals
but also for the employees to reach theirs. It is necessary for everybody to
understand their role, people communicate frequently and openly, status reports
need to receive feedback and another interesting thing: leaders are never hired
from outside. And again: doing things right must become a habit and habits are
developed by repetition.&lt;/p&gt;
&lt;p&gt;Bjarte Bogsnes' Beyond Budgeting was perhaps the &amp;quot;highest-level&amp;quot; talk. There is
quite a lot of theory behind how to allocate company budgets and how not to do
that. The traditional way is to sit down once per year and put some money in
this bucket, some money in that bucket... The speaker works for Statoil: one of
the biggest oil mining companies in the world. (And he works there since 1983.)
Still he is driving changes in the company: like budgeting. Statoil approaches the
problem in an unusal way (for a corporation): dynamically as the requirement from
the projects come and change. Yes,
&amp;quot;predictability&amp;quot; is apparently not a priority for the company. However creating
environment that allow the employees to succeed is: so they are given right to
decide what to spend the company money on... For example the travel budget is
totally open---anyone can take as much they want from it---but also totally
transparent: everybody sees the others' spending. No, the employees didn't ruin the
company, the overall travel spendings went actually down...&lt;/p&gt;
&lt;p&gt;The next one was Philip Eisbacher's talk of how to use agile technique to
develop the company itself and how to actually organize the teams to be able to
do so. The core of
the idea was to allocate some sprints just for the company's needs: improving
processes, tooling, implement new ideas..., and be actually transparent about
it to the customers.&lt;/p&gt;
&lt;blockquote&gt;
And maybe I'm overly sensitive to this but it was not the first time I
witnessed people saying something like: &amp;quot;It was open source so it was not
that good...&amp;quot;. It feels odd especially when the other tools the same person
refers to (inherently as &amp;quot;good&amp;quot;) are open source too; in those cases the openess
apparently doesn't matter.&lt;/blockquote&gt;
&lt;p&gt;Jaroslav Prochazka then talked about the transformation of the industry, about
the shift from creating products to providing services. As all the other talks
this one emphasised the necessity of delighting the customer and building
long-term relationships. This requires all the developers and all the team
members to be aware of the overall product and how does their contribution fit
into the final outcome and why it's necessary. Jaroslav suggested a way to
organize the teams more efficiently and what roles were necessary for this
success. I have to admit that much of the talk I felt like there was too much
fill-in and the core idea itself didn't seem that novel to me.&lt;/p&gt;
&lt;p&gt;And the day was closed again by the stories from Ferrari F1 team: their
former product manager, Enrico Lombardo, talked about breaking the resistance
when introducing new ideas to the actually quite conservative team.
It is not possible to actually capture the atmosphere of the talk. Mr. Lombardo is
really great story teller and I really think inviting the Scuderia Ferrari people
to talk to the mostly IT guys was a great move from the Agilia organisers.&lt;/p&gt;
&lt;p&gt;Overall my impression of the conference was very positive. Given I came there
with a lot of scepticism and the conference was actually almost non-technical, I
was after all quite impressed. And there were several perpetuating themes in
most of the talks. I'll get to them &lt;a class="reference external" href="https://www.smetana.name/blog/2015/03/27/agilia-conference-day-2/"&gt;next time&lt;/a&gt;.&lt;/p&gt;
</content><category term="Tech"></category><category term="development"></category><category term="management"></category></entry><entry><title>Comments!</title><link href="https://www.smetana.name/blog/2014/12/11/comments/" rel="alternate"></link><published>2014-12-11T00:00:00+01:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2014-12-11:/blog/2014/12/11/comments/</id><summary type="html">&lt;p class="first last"&gt;Special Christmas offer for all the spambots out there: comments!&lt;/p&gt;
</summary><content type="html">&lt;p&gt;As and excercise I've decided to implement some way to add comments to this
site's content. I know how many visitors do I have here so I don't expect much
interaction with the readers... However the experience with Flask and JQuery was
definitely worth it. And I was surprised how little code was needed for creating
something actually usable.&lt;/p&gt;
&lt;p&gt;Next on the list is a gallery. I'm not sure when will I get to it but I do have
quite solid idea of what I want to implemet. And even know how.&lt;/p&gt;
</content><category term="Tech"></category><category term="python"></category><category term="web"></category></entry><entry><title>Sharing DVD drive over iSCSI</title><link href="https://www.smetana.name/blog/2014/10/20/sharing-dvd-drive-over-iscsi/" rel="alternate"></link><published>2014-10-20T00:00:00+02:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2014-10-20:/blog/2014/10/20/sharing-dvd-drive-over-iscsi/</id><summary type="html">&lt;p class="first last"&gt;There is a new in-kernel SCSI target implementation: LIO. Unlike its
predecesor it has pluggable architecture and offers some interesting
features. One of them is direct SCSI pass-through that allows for
sharing for example the optical drives. Here's how to set such a thing
up.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;The old SCSI target utils shipped with older Fedoras and RHEL-6 never really
worked for one of my use-cases: sharing optical drives. I don't use them too
extensively however sometimes I need to burn a CD/DVD or watch a DVD video. This
was not really possible before LIO and it's pSCSI plugin (the old iSCSI target
daemon required to know backend block device's size and didn't suport removable
media). I didn't feel like equipping each of my computers with an optical drive.
It was not even possible for all of them.&lt;/p&gt;
&lt;p&gt;These days it's easy to set up. There is a good documentation on the &lt;a class="reference external" href="http://linux-iscsi.org/wiki/LIO"&gt;LIO wiki&lt;/a&gt;. There are slight modifications required with
Fedora 20.&lt;/p&gt;
&lt;p&gt;Please note: The pSCSI backstore is generally unsafe and not recommended to use.
There are features that won't work in all scenarions and things will break (the
backend device does not implement all the SCSI commands that the initiator may
issue).&lt;/p&gt;
&lt;div class="section" id="target-configuration"&gt;
&lt;h2&gt;Target configuration&lt;/h2&gt;
&lt;p&gt;On the box where the optical drive to be exported is physically present (the target)
install the &lt;tt class="docutils literal"&gt;targetcli&lt;/tt&gt; utility:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ yum install targetcli
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Assuming the DVD drive is at &lt;tt class="docutils literal"&gt;/dev/sr0&lt;/tt&gt;, here's the complete guide for
&amp;quot;exporting&amp;quot; it as an iSCSI device to the network.&lt;/p&gt;
&lt;p&gt;There is not much difference from the &lt;a class="reference external" href="http://linux-iscsi.org/wiki/ISCSI"&gt;iSCSI guide on the LIO wiki&lt;/a&gt;. As root, start &lt;tt class="docutils literal"&gt;targetcli&lt;/tt&gt; and then:&lt;/p&gt;
&lt;p&gt;Create the pSCSI backend:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;/&amp;gt; &lt;span class="nb"&gt;cd&lt;/span&gt; backstores
/backstores&amp;gt; pscsi/ create &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;dvd_backend &lt;span class="nv"&gt;dev&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/dev/sr0
Note: block backstore recommended &lt;span class="k"&gt;for&lt;/span&gt; SCSI block devices
Created pscsi storage object dvd_backend using /dev/sr0
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now instantiate the iSCSI target:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;/backstores&amp;gt; &lt;span class="nb"&gt;cd&lt;/span&gt; pscsi/dvd_backend
/backstores/pscsi/dvd_backend&amp;gt; /iscsi create
Created target iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e.
Created TPG &lt;span class="m"&gt;1&lt;/span&gt;.
Created default portal listening on all IPs &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;.0.0.0&lt;span class="o"&gt;)&lt;/span&gt;, port &lt;span class="m"&gt;3260&lt;/span&gt;.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Note that the default portal has been created along with the iSCSI target.  By
default it listens on all the interfaces and port 3260. This is actually what I
want (and check the iptables settings...).&lt;/p&gt;
&lt;p&gt;Now I need to export the LUN:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;/backstores/pscsi/dvd_backend&amp;gt; &lt;span class="nb"&gt;cd&lt;/span&gt;
/iscsi/iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e/tpg1/
/iscsi/iqn.20...c643cc7e/tpg1&amp;gt; luns/ create /backstores/pscsi/dvd_backend
Created LUN &lt;span class="m"&gt;0&lt;/span&gt;.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Configure authentication/authorization for the portal.  I'm on a local network,
trusting everyody, so I open the unrestricted access for everybody:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;/iscsi/iqn.20...c643cc7e/tpg1&amp;gt; &lt;span class="nb"&gt;set&lt;/span&gt; attribute &lt;span class="nv"&gt;authentication&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nv"&gt;demo_mode_write_protect&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="nv"&gt;generate_node_acls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="nv"&gt;cache_dynamic_acls&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
Parameter demo_mode_write_protect is now &lt;span class="s1"&gt;&amp;#39;0&amp;#39;&lt;/span&gt;.
Parameter authentication is now &lt;span class="s1"&gt;&amp;#39;0&amp;#39;&lt;/span&gt;.
Parameter generate_node_acls is now &lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;.
Parameter cache_dynamic_acls is now &lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The resulting configfs tree should look like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;/iscsi/iqn.20...c643cc7e/tpg1&amp;gt; &lt;span class="nb"&gt;cd&lt;/span&gt; /
/&amp;gt; ls
o- / ............................................................................. &lt;span class="o"&gt;[&lt;/span&gt;...&lt;span class="o"&gt;]&lt;/span&gt;
  o- backstores .................................................................. &lt;span class="o"&gt;[&lt;/span&gt;...&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt; o- block ...................................................... &lt;span class="o"&gt;[&lt;/span&gt;Storage Objects: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt; o- fileio ..................................................... &lt;span class="o"&gt;[&lt;/span&gt;Storage Objects: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt; o- pscsi ...................................................... &lt;span class="o"&gt;[&lt;/span&gt;Storage Objects: &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; o- dvd_backend .............................................. &lt;span class="o"&gt;[&lt;/span&gt;/dev/sr0 activated&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt; o- ramdisk .................................................... &lt;span class="o"&gt;[&lt;/span&gt;Storage Objects: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  o- iscsi ................................................................ &lt;span class="o"&gt;[&lt;/span&gt;Targets: &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt; o- iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e .............. &lt;span class="o"&gt;[&lt;/span&gt;TPGs: &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt;   o- tpg1 .......................................................&lt;span class="o"&gt;[&lt;/span&gt;gen-acls, no-auth&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt;     o- acls .............................................................. &lt;span class="o"&gt;[&lt;/span&gt;ACLs: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt;     o- luns .............................................................. &lt;span class="o"&gt;[&lt;/span&gt;LUNs: &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt;     &lt;span class="p"&gt;|&lt;/span&gt; o- lun0 ....................................... &lt;span class="o"&gt;[&lt;/span&gt;pscsi/dvd_backend &lt;span class="o"&gt;(&lt;/span&gt;/dev/sr0&lt;span class="o"&gt;)]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt;     o- portals ........................................................ &lt;span class="o"&gt;[&lt;/span&gt;Portals: &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  &lt;span class="p"&gt;|&lt;/span&gt;       o- &lt;span class="m"&gt;0&lt;/span&gt;.0.0.0:3260 ......................................................... &lt;span class="o"&gt;[&lt;/span&gt;OK&lt;span class="o"&gt;]&lt;/span&gt;
  o- loopback ............................................................. &lt;span class="o"&gt;[&lt;/span&gt;Targets: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  o- sbp .................................................................. &lt;span class="o"&gt;[&lt;/span&gt;Targets: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
  o- vhost ................................................................ &lt;span class="o"&gt;[&lt;/span&gt;Targets: &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now, save the configuration so it doesn't get lost.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;/&amp;gt; saveconfig
Last &lt;span class="m"&gt;10&lt;/span&gt; configs saved &lt;span class="k"&gt;in&lt;/span&gt; /etc/target/backup.
Configuration saved to /etc/target/saveconfig.json
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The machine now &amp;quot;exports&amp;quot; its &lt;tt class="docutils literal"&gt;/dev/sr0&lt;/tt&gt; DVD drive over iSCSI with complete SCSI
command pass-through.&lt;/p&gt;
&lt;p&gt;There is one catch however: On Fedora 20 there is no unit file that would ensure
the configuration is reloaded automatically on boot. This means the iSCSI target
will be inaccessible after reboot until you run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ targetcli restoreconfig
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;So... TODO: create a systemd unit file that would run that on boot.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="initiator-configuration"&gt;
&lt;h2&gt;Initiator configuration&lt;/h2&gt;
&lt;p&gt;Now I have the DVD device accessible over iSCSI. Let's configure the initiator
(the machine which wants to connect the remote drive). Again, install the necessary
packages first:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ yum install iscsi-initiator-utils
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Assuming the iSCSI target machine's IP address is 192.168.122.1, here's how to
discover and login to the target:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# iscsiadm --mode discoverydb --type sendtargets \&lt;/span&gt;
    --portal &lt;span class="m"&gt;192&lt;/span&gt;.168.122.1 --discover
iscsiadm: Could not scan /sys/class/iscsi_transport.
&lt;span class="m"&gt;192&lt;/span&gt;.168.122.1:3260,1 iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e
&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# iscsiadm --mode node --login&lt;/span&gt;
Logging &lt;span class="k"&gt;in&lt;/span&gt; to &lt;span class="o"&gt;[&lt;/span&gt;iface: default, target: iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e,
portal: &lt;span class="m"&gt;192&lt;/span&gt;.168.122.1,3260&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;multiple&lt;span class="o"&gt;)&lt;/span&gt;
Login to &lt;span class="o"&gt;[&lt;/span&gt;iface: default, target: iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e,
portal: &lt;span class="m"&gt;192&lt;/span&gt;.168.122.1,3260&lt;span class="o"&gt;]&lt;/span&gt; successful.
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This created &lt;tt class="docutils literal"&gt;/dev/sr0&lt;/tt&gt; device node as well as &lt;tt class="docutils literal"&gt;/dev/cdrom&lt;/tt&gt; symlink to it.
Now I can play video DVDs and audio CDs remotely, even burn optical media and do
whatever a &amp;quot;normal&amp;quot; optical drive would let me to.&lt;/p&gt;
&lt;p&gt;Please note: the initiator configuration is actually persistent. That means the
system will try to connect the iSCSI device on the next boot.&lt;/p&gt;
&lt;p&gt;In the case one decides to remove the remote device, just logout of the session
and remove the node. Again this is a persistent change:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# iscsiadm -m session -u&lt;/span&gt;
Logging out of session &lt;span class="o"&gt;[&lt;/span&gt;sid: &lt;span class="m"&gt;1&lt;/span&gt;, target: iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e,
portal: &lt;span class="m"&gt;192&lt;/span&gt;.168.122.1,3260&lt;span class="o"&gt;]&lt;/span&gt;
Logout of &lt;span class="o"&gt;[&lt;/span&gt;sid: &lt;span class="m"&gt;1&lt;/span&gt;, target: iqn.2003-01.org.linux-iscsi.zaphod.x8664:sn.a5f5c643cc7e,
portal: &lt;span class="m"&gt;192&lt;/span&gt;.168.122.1,3260&lt;span class="o"&gt;]&lt;/span&gt; successful.
&lt;span class="o"&gt;[&lt;/span&gt;root@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# iscsiadm -m node --delete&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
</content><category term="Tech"></category><category term="fedora"></category><category term="networking"></category></entry><entry><title>Extracting subtitles from Matroska video files</title><link href="https://www.smetana.name/blog/2014/10/02/extracting-subtitles-from-matroska-video-files/" rel="alternate"></link><published>2014-10-02T00:00:00+02:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2014-10-02:/blog/2014/10/02/extracting-subtitles-from-matroska-video-files/</id><summary type="html">&lt;p class="first last"&gt;From time to time I try to translate subtitles. When they're embedded
in the video file itself it's not that straightforward to convert them
to an editable text format. It's not actually that difficult.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;Subtitles embedded in a video file are essentially a sequence of images
overlaid over the video frames during the playback. To convert them to a text
file one has to first extract the subtitle images themselves and then use some
OCR mechanism for the image to text transformation.&lt;/p&gt;
&lt;p&gt;On &lt;a class="reference external" href="http://fedoraproject.org"&gt;Fedora&lt;/a&gt;  the procedure requires to install some
packages. First, enable the &lt;a class="reference external" href="http://www.rpmfusion.org"&gt;rpmfusion repositories&lt;/a&gt;
if you haven't done so yet. (Side note: livna repository is not dead yet
and you may need it for some DVDs. Enable &lt;a class="reference external" href="http://rpm.livna.org/"&gt;livna&lt;/a&gt; too.)
Then install the following packages using &lt;tt class="docutils literal"&gt;yum&lt;/tt&gt; or &lt;tt class="docutils literal"&gt;dnf&lt;/tt&gt;:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;mplayer&lt;/li&gt;
&lt;li&gt;mkvtoolnix&lt;/li&gt;
&lt;li&gt;subtitleripper&lt;/li&gt;
&lt;li&gt;tesseract&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The following should work on &lt;a class="reference external" href="http://www.matroska.org"&gt;Matroska&lt;/a&gt;  containers.
I have a video in the &lt;tt class="docutils literal"&gt;MyFilm.mkv&lt;/tt&gt; file: there are several tracks in it: video,
several audio tracks and subtitles. I found &lt;a class="reference external" href="http://www.mplayerhq.hu"&gt;MPlayer&lt;/a&gt;
to be the simplest tool to identify which track to work with:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;tom@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ mplayer MyFilm.mkv
MPlayer SVN-r37150-4.8.3 &lt;span class="o"&gt;(&lt;/span&gt;C&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="m"&gt;2000&lt;/span&gt;-2014 MPlayer Team
Playing MyFilm.mkv.
Cache fill:  &lt;span class="m"&gt;0&lt;/span&gt;.00% &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; bytes&lt;span class="o"&gt;)&lt;/span&gt;

libavformat version &lt;span class="m"&gt;55&lt;/span&gt;.19.104 &lt;span class="o"&gt;(&lt;/span&gt;external&lt;span class="o"&gt;)&lt;/span&gt;
libavformat file format detected.
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;0&lt;/span&gt;: video &lt;span class="o"&gt;(&lt;/span&gt;mpeg4&lt;span class="o"&gt;)&lt;/span&gt;, -vid &lt;span class="m"&gt;0&lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;1&lt;/span&gt;: audio &lt;span class="o"&gt;(&lt;/span&gt;vorbis&lt;span class="o"&gt;)&lt;/span&gt;, -aid &lt;span class="m"&gt;0&lt;/span&gt;, -alang jpn
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;2&lt;/span&gt;: audio &lt;span class="o"&gt;(&lt;/span&gt;vorbis&lt;span class="o"&gt;)&lt;/span&gt;, -aid &lt;span class="m"&gt;1&lt;/span&gt;, -alang fre
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;3&lt;/span&gt;: audio &lt;span class="o"&gt;(&lt;/span&gt;vorbis&lt;span class="o"&gt;)&lt;/span&gt;, -aid &lt;span class="m"&gt;2&lt;/span&gt;, -alang eng
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;4&lt;/span&gt;: audio &lt;span class="o"&gt;(&lt;/span&gt;vorbis&lt;span class="o"&gt;)&lt;/span&gt;, -aid &lt;span class="m"&gt;3&lt;/span&gt;, -alang ger
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;5&lt;/span&gt;: audio &lt;span class="o"&gt;(&lt;/span&gt;vorbis&lt;span class="o"&gt;)&lt;/span&gt;, -aid &lt;span class="m"&gt;4&lt;/span&gt;, -alang jpn, Audio-Kommentar
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;6&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;0&lt;/span&gt;, -slang fre
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;7&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;1&lt;/span&gt;, -slang eng
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;8&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;2&lt;/span&gt;, -slang dut
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;9&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;3&lt;/span&gt;, -slang ger
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;10&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;4&lt;/span&gt;, -slang pol
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;11&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;5&lt;/span&gt;, -slang fre, Audio-Kommentar
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;12&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;6&lt;/span&gt;, -slang eng, Audio-Kommentar
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;13&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;7&lt;/span&gt;, -slang dut, Audio-Kommentar
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;14&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;8&lt;/span&gt;, -slang ger, Audio-Kommentar
&lt;span class="o"&gt;[&lt;/span&gt;lavf&lt;span class="o"&gt;]&lt;/span&gt; stream &lt;span class="m"&gt;15&lt;/span&gt;: subtitle &lt;span class="o"&gt;(&lt;/span&gt;dvdsub&lt;span class="o"&gt;)&lt;/span&gt;, -sid &lt;span class="m"&gt;9&lt;/span&gt;, -slang pol, Audio-Kommentar
...
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Alternatively you can use &lt;tt class="docutils literal"&gt;mkvmerge &lt;span class="pre"&gt;-i&lt;/span&gt; MyFilm.mkv&lt;/tt&gt; to obtain the list of tracks.
The advantage of MPlayer is that it also tells you what language is a particular
subtitle track for. With &lt;tt class="docutils literal"&gt;mkvmerge&lt;/tt&gt; you have to guess.&lt;/p&gt;
&lt;p&gt;Assume I'm interested in the English subtitles from the example above. MPlayer
tells me it's the track (stream) ID 7. Let's extract them using mkvextract:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;tom@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ mkvextract tracks MyFilm.mkv &lt;span class="m"&gt;7&lt;/span&gt;:subtitles.sub
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This produces two new files: subtitles.sub (VOBSUB format) and subtitle.idx
(separate text index file). Now I can feed the vobsub2pgm utility with the two
files. The program takes only the base name without the .sub and .idx suffixes.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;tom@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ vobsub2pgm subtitles title
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;This produces a lot of PGM bitmaps named like &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;title????.pgm&lt;/span&gt;&lt;/tt&gt; and a &lt;tt class="docutils literal"&gt;title.srtx&lt;/tt&gt;
file that comes handy when putting the final result together.&lt;/p&gt;
&lt;p&gt;The next step is to run the images through some OCR. There exists a
&lt;tt class="docutils literal"&gt;pgm2txt&lt;/tt&gt; utility that uses &lt;tt class="docutils literal"&gt;gocr&lt;/tt&gt; for the task and I found the results very
unsatisfactory &lt;a class="footnote-reference" href="#footnote-1" id="footnote-reference-1"&gt;[1]&lt;/a&gt;. I was much luckier with &lt;tt class="docutils literal"&gt;tesseract&lt;/tt&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;tom@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ &lt;span class="k"&gt;for&lt;/span&gt; i &lt;span class="k"&gt;in&lt;/span&gt; *.pgm&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do&lt;/span&gt; tesseract &lt;span class="nv"&gt;$i&lt;/span&gt; &lt;span class="nv"&gt;$i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Now we have a .pgm.txt file for each image and we're almost done. The last step
is to replace the file references in the .srtx file with the referenced files
content. Before I knew &lt;tt class="docutils literal"&gt;srttool&lt;/tt&gt; I used &lt;tt class="docutils literal"&gt;awk&lt;/tt&gt; for this, however it's much
simpler like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;tom@localhost ~&lt;span class="o"&gt;]&lt;/span&gt;$ srttool -s -i title.srtx -o subtitles.srt
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;That's it. The &lt;tt class="docutils literal"&gt;subtitles.srt&lt;/tt&gt; is a text version of the embedded subtitles and
you can do whatever you want with them.&lt;/p&gt;
&lt;hr class="docutils" /&gt;
&lt;table class="docutils footnote" frame="void" id="footnote-1" 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="#footnote-reference-1"&gt;[1]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;And the sad thing is that I'm the gocr Fedora maintainer...&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
</content><category term="Tech"></category><category term="note"></category><category term="video"></category><category term="fedora"></category></entry><entry><title>Starting with a backlog</title><link href="https://www.smetana.name/blog/2014/10/01/starting-with-a-backlog/" rel="alternate"></link><published>2014-10-01T00:00:00+02:00</published><updated>2016-10-19T17:31:44+02:00</updated><author><name>Tomáš Smetana</name></author><id>tag:www.smetana.name,2014-10-01:/blog/2014/10/01/starting-with-a-backlog/</id><summary type="html">&lt;p class="first last"&gt;Looks like the first but it's not: this is another attempt to give
some purpose to this site. Since I already decided to really use it...&lt;/p&gt;
</summary><content type="html">&lt;p&gt;It took several unsuccessful attempts with some CMS systems to actually decide
that static web is perhaps the best thing to use for a site with one writer and one
reader. Especially since it's the same person.&lt;/p&gt;
&lt;p&gt;There are more unsuccessful attempts of various kinds I made in the past year:
the &amp;quot;in progress&amp;quot; part of the  &lt;a class="reference external" href="/pages/coding.html"&gt;Coding section&lt;/a&gt; is largely
incomplete.&lt;/p&gt;
&lt;div class="section" id="todo"&gt;
&lt;h2&gt;TODO&lt;/h2&gt;
&lt;p&gt;As for the stuff that's on my plate right now and I consider useful/interesting
(this list is about to grow I suppose):&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;Find out how to treat the images and galleries with &lt;a class="reference external" href="http://blog.getpelican.com/"&gt;Pelican&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="reference external" href="https://github.com/abarisain/dmix/"&gt;MPDroid&lt;/a&gt; still doesn't have multiserver
support and the upstream seems to go  the way I don't like at all (adding
closed-source automatic crash reporting...)&lt;/li&gt;
&lt;li&gt;The &lt;a class="reference external" href="http://git.smetana.name/nodes/"&gt;game I've been writing&lt;/a&gt; for ages...&lt;/li&gt;
&lt;li&gt;Get Pelican running on Android&lt;/li&gt;
&lt;li&gt;Read book list, possibly in Czech&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There is another dozen of git repositories I don't plan to ever touch again.
Looking at all of what I tried and failed it seems the problem must be in the
approach. So, dear myself, will you be able to really get to do anything every
day? This is actually important.&lt;/p&gt;
&lt;p&gt;Lots of boring fun.&lt;/p&gt;
&lt;/div&gt;
</content><category term="Misc"></category><category term="todo"></category><category term="coding"></category><category term="web"></category><category term="log"></category></entry></feed>