Prove your tool is the right choice

I see two common approaches at work when it comes to choosing tools.

Photo of different tools
How do you choose?

Bad

I have heard about this new shiny cool framework/library/tool, let’s use it!

It might be a good approach when you want to learn something in your spare time, just don’t do this at work.

Good

We have this problem and found a few alternative solutions (frameworks/libraries/tools) that might solve it. We will investigate and see if any of them fit our needs.

Note that depending on your situation, it might be the case when none of the existing tools will be a good fit for your project.

It might be tempting to look at existing solutions in a positive light thinking “our problem is not unique, there are tools solving it already”. The problem might appear to be similar to the problems that these tools solve but remember to look and focus and what’s unique to your circumstances.

Suggested approach

You should prove that the points below are wrong.Β  Assume that the tool you are evaluating:

  1. Does not cover your needs.
  2. Has crappy/new/unstable code.
  3. Has no community so getting answers to your questions or help is a nightmare.
  4. Has none or very costly official support.
  5. It will have a steep learning curve.
  6. It will be harder to maintain than any other alternative or your own code.
  7. You will need to modify the tool and it will be tough.
  8. Provides so little that it’s not worth another external dependency.
  9. Will cause lock-in with very high switching costs. (You can affect this one to some degree with your design).
  10. Has big company behind it which
    1. had huge investment and only cares about things like ROI and market share and not you, even if they did at some point in the past.
    2. has more interesting markets than you and optimizes the product for these markets, making it not a good fit for your situation.
    3. generates hype making it all look rosy even when the product has grave flaws.
    4. makes it look like everybody uses this tool.
    5. makes it feel like the next best thing.
  11. Has a big alliance behind it with many interests of different partners with zero intersection with your interests.
  12. Most places that use this tool suffer immensely but either don’t talk about it or you don’t hear that for other reasons. Dig deeper to find such information.

Calling some friends and asking them about the tool is very good but note that your situation is different so most of the points listed above still stand.

I guess that when you start positively when evaluating a tool, you might fall into the confirmation bias trap. Beware!

Winning executives team

0df763b

Brought to you by most trendy positions. You may recognize some of them at your work. Say hello!

  1. VP Downtime
  2. VP Broken Builds
  3. VP Lost Leads
  4. VP Ugly Sites
  5. VP Mediocrity and Disempowering
  6. VP Over-Complication Because it’s Cool
  7. VP of Sales Prevention
  8. VP of Successful Penetration
  9. VP Wrong Solutions
  10. Project Failure Architect
  11. Chief Titles Manager
  12. Chief Hype Evangelist
  13. Chief External Dependencies Promoter
  14. Chief Next Trendy Language Adopter
  15. Chief Instances Killer
  16. Chief Budget Overrun Manager
  17. Chief Miscommunication Advocate
  18. Chief Technical Debt Accumulation Promoter
  19. New shiny technologies Team Leader
  20. Misused Frameworks Manager

Some of the entries were contributed by VPs from beame.io

You are very welcome to extend this list in your comments.

Don’t call me DevOps

… unless you are ready to clarify what exactly do you mean by “DevOps”, I suggest you shut up don’t use that word at all.

The reason not to call a person “DevOps” is that DevOps seems to be a set of principles but not a person nor a job position. None of the amorphous definitions say it’s a person or position so don’t call DevOps anyone please.

Here is why I don’t recommend using this term at all:

  1. There is no exact definition. I’ve asked several people from in the industry and none of them could define the term precisely.
  2. Some people think that using specific tools is being DevOps. Some don’t. I don’t. Specific tools can not be used all the time as situations are different.
  3. Wikipedia has a description which I’m not sure can be used as a definition because some people would agree and some won’t.
  4. New Relic guys write “First, let’s just say there is no definitive answer.” in the article What is DevOps?.
  5. Automation seems to be one of the principles. Does it mean that an unsuspecting person that automates processes is now suddenly practicing DevOps? Are we just naming existing practices with a new fancy term now?

OpenStack is not ready

If you read the news you get the impression that OpenStack is the answer to anything (along with Docker but that’s for another post). I would like to balance this hype a bit. This post is my personal opinion.

tl;dr – TCO much higher than expected

When I first started working with OpenStack few years ago numerous issues caused me to mentally summarize “Not ready for production, re-visit in a year or two”. Unfortunately this still stands in 2016.

If you are considering OpenStack for your private cloud, think twice. Here are some examples of what I experienced few years back till now with two different clients that use OpenStack.

  1. Using API is a suffer
    1. API is inconsistent between components like Nova and Neutron so you will have more code.
    2. Neutron documentation for Python client is ridiculous: create network and list networks. That’s all. This is in contrast to the counterpart Nova documentation which is OK.
  2. Few years ago I have edited instance types (“flavors”) using the web UI. Somehow it screwed up all the types. Unfortunately I don’t know if there was an open issue for that.
  3. About a year ago we had production system workaround with a line of bash that would do internal ping within the message bus that OpenStack uses. Without this it would randomly get stuck and not respond to any management commands (create/delete instance for example). If I remember correctly this bug was fixed in Juno or Kilo, unfortunately I can’t find it.

Be sure to visit the bugs lists before your decision.

The Go language TL;DR review

I took a few hours to overview the Go language to make up my mind. Posting here because someone else might also find this useful.

Please note that I just reviewed the language. I did not write big chunks of code so my experience is fairly limited.

  • Compiled.
  • Easy to use almost as any high-level interpreted language, this is not a fiction, works as advertised. Simplicity and ease of use – goal checked.
  • Good libraries (HTTP client+server, FastCGI server, JSON, RPC, …)
  • VIM support in the code repo (syntax, indentation, …)
  • bash completion support in the code repo
  • The language as a whole makes the impression that the right choices were made.
  • It’s pragmatic.
  • It’s minimalistic for the capabilities it provides.
  • The only “big” innovation I see (besides the ease of use) is simplifying interfaces in a statically typed language. All other features resemble things I’ve seen somewhere else already. Actually “familiarity” of the language was one of the goals.
  • Has low level stuff, see http://golang.org/pkg/syscall/ for example.
  • As of this moment the Go language became my second favorite moving down JS and Python. Sorry, Lisp still remains the first. This of course might be a temporary condition till I start writing some real code. I hope it’s not.

Webkit background image wrapping bug

Context: I am doing a mobile web project for one of my clients.

Problem screenshot

WebKit wrapping bug screenshot (zoom)
Android Browser: background image is wrapped. Red arrow shows the height of the DIV.

Problem description

When using DIV with background image that is the same height as the DIV and top pixels of the background image are transparent, with repeat-x (or no repeat) there is an observable line at the top of the div painted with the color of the bottom pixel of the image.

Suspected buggy mechanism

I suppose it’s subpixel smoothing. Because of the observed facts:

  • The additional lines is less than a pixel wide as seen when zooming
  • Pixels affect colors of neighbours pixels

Suggested solution

  • Add two pixels at the bottom of the background image: one of the same color as the last pixel and one transparent. For example, if original image is from top to bottom (transparent,…,transparent,red,green,blue) it should become (transparent,…,transparent,red,green,blue,blue,transparent).
  • Keep the DIV vertical size the same as the original background: the two new pixels should be “rendered” outside the DIV.

Initially I’ve added only the transparent pixel at the very bottom but it interacted badly with both the last visible pixel and the contents of the div (not shown in the example, for simplicity).

I have created a Gist that shows the problem and the suggested solution. The Gist also includes the half-solution of only adding one pixel. For your convenience I have also uploaded the HTML of the problem and the suggested solution to this blog.

Additional info

  • On some devices, when going to landscape mode, the line disappears and is only observable when zooming in

P.S.
I learned something the hard way but I hope you will find this post and it will save you something from 1 to 5 hours of work.

RDS restore from dump time

Doing recovery test for one of my clients. I think recovery times might be useful to not-so-general public πŸ™‚

TLDR version

.sql.gz file size: 829M
DB size after restoring: 6.2G
RDS instance: db.m1.small, MySQL 5.5.20, 50G, us-east-1b, not Multi-AZ.
Recovery tests date: 2012-08-14
Network: MySQL client in same AZ
Instance provisioning time: 8 minutes
Dump loading time: 58 minutes

More info

RDS parameter group: default.mysql5.5

RDS backups configuration: 35 days of backups

Restore command: time pv X.2.sql.gz | gunzip | mysql X

Restore command exact times:

real 57m35.001s
user 2m27.085s
sys 0m22.113s

Backup command: mysqldump --add-drop-table --add-locks --create-options --create-options --extended-insert --single-transaction --quick

Backup time: about 28 minutes.

Client: m1.small

Load on client when restoring: about 0.01, above 90% CPU idle.

Tables sizes info after recovery: SELECT data_length / 1024 / 1024 as "data", index_length / 1024 / 1024 as "index" FROM information_schema.TABLES where table_schema = 'MASKED' :

+---------------+---------------+
| data          | index         |
+---------------+---------------+
|    0.01562500 |    0.03125000 |
|    0.01562500 |    0.01562500 |
|    0.01562500 |    0.00000000 |
|    0.01562500 |    0.00000000 |
|    0.01562500 |    0.00000000 |
|    0.01562500 |    0.01562500 |
|    0.01562500 |    0.01562500 |
|    0.01562500 |    0.00000000 |
|    0.00000000 |    0.00000000 |
|    3.51562500 |    0.00000000 |
|    0.01562500 |    0.04687500 |
|    0.01562500 |    0.03125000 |
|    0.01562500 |    0.01562500 |
|    0.01562500 |    0.01562500 |
|    0.19713211 |    0.01269531 |
|    0.20276260 |    0.04687500 |
|    0.01562500 |    0.00000000 |
|    0.12012100 |    0.03613281 |
|    0.00007629 |    0.00195313 |
|    0.01562500 |    0.00000000 |
|    1.51562500 |    1.51562500 |
| 2053.00000000 | 1946.00000000 |
|   28.56250000 |   31.09375000 |
|    0.01562500 |    0.00000000 |
|    0.26562500 |    0.12500000 |
|    0.01562500 |    0.01562500 |
|    0.00000000 |    0.00000000 |
|    0.00000000 |    0.00000000 |
|    0.00000000 |    0.00195313 |
|   12.56250000 |    0.00000000 |
|    0.34375000 |    0.00000000 |
|    0.46875000 |    0.00000000 |
|    0.01562500 |    0.00000000 |
| 2139.00000000 |    0.00000000 |
+---------------+---------------+

Graphs from AWS RDS console

Screenshots were taken few minutes after restore finished.

HTH, Ilya.

Stop thinking, start doing.

Backgound

I could not find a “todo” software that would staisfy my needs so I decided to create one. The decision was also backed up by the fact that my good friend, Guy Egozy, was also very frustrated by the existing solutions.

The story

I started thinking about my “todo” software that I wanted to create. What it should include, how it should behave, etc… I was thinking for months. The important part is to realize when thinking becomes mental masturbation. Yes it is fun but it’s not productive. I admit I was slow to recognize the situation. When I did, I decided to start writing the code. It was a throw-away code, a protoype. When I had something that worked, I finally understood the following advantages:

  1. You learn a lot when implementing. No thinking + reading + analyzing will take you there. Of course you should but don’t over-do it.
  2. It’s much easiear to collaborate on. I can tell my friend all day about what I think but showing working application is a totally different story. Also he was finally able to participate by adding more code. Which he does till this day. (Thanks!)
  3. Makes possible to get any meaningful feedback from people, possible feature users.
  4. And of course you make steps toward the goal of having a good working version of the application (which we named Tagoholic), something you can share with the world, after few throw away versions.

Conclusion

Stop thinking, start doing — it’s way more productive.

P.S.

We are still working on Tagoholic. Collaboration (sharing) and mobile version are the two top requested features that are not there yet. We will let you know via Twitter when these are ready.

Is it so hard to get the UI right, Youtube?

Let’s keep it short. Obvious things Youtube got wrong:

  1. Can’t drag videos into playlist – WTF? Really? How hard could that be to implement?
  2. The home page with subscriptions and etc. The user does only one thing on all sites – chooses what to click next. (Well, and watches the videos if it’s Youtube). So why the f*ck you are making it so hard? Gray out the videos that were already watched! No one should scan all the page trying to spot new videos! Unjustified cognitive load. Other pages would certainly benefit from this too but the home page is really frustrating.
  3. I wouldn’t complain if it was only this minor bug but since I’m posting anyway … “Added to queue” does not go away if you remove the video from the list. It goes away only if you reload the page after you remove the video from the queue

Find one file of each kind (on Linux)

Suppose you have large number of files but most of them are identical. For example, the files’ contents are: A A A B B C C C C .
You’d like to find one of each kind and for example compare.

mkdir cmp
cd cmp/
find .. -name stupid-page.html | xargs md5sum | sort | awk '{print >$1}'
head -1 -q [0-f]* | awk '{print $2}' | xargs diffuse

Or if you just need the list, replace the last line with

head -1 -q [0-f]* | awk '{print $2}'

Note that you are left with the lists of files. Each list is named after MD5 of the content of the files listed in it.
Like this:

> ls -1
09b37d3089b1c1837e4741973df1e67e
4d701e2420bf49c85dd21c9b1dbb10e1
6135d23fcb0113ab9a2f574d7f0bf703
> cat 09b37d3089b1c1837e4741973df1e67e
09b37d3089b1c1837e4741973df1e67e  ../some-folder/stupid-page.html
09b37d3089b1c1837e4741973df1e67e  ../some-other-folder/stupid-page.html