Installing gmpy2 in Ubuntu 16.04 for Python 3

Installing gmpy2 under Python 3 seems easy:

» pip3 install gmpy2

But this won’t work for the first time because pip whines about not finding mpfr.h in the proper place (this is part of the MPFR library), so libmpfr-dev needs to be installed.

Then it whines about not finding mpc.h in the proper place neither, so libmpc-dev needs to be installed as well. If you are lucky, then you had installed both libs for other reasons and you are wasting time here. But if not:

» sudo apt-get install libmpfr-dev libmpc-dev

Now gmpy2 install at last:

» pip3 install gmpy2
Collecting gmpy2
...(blahblah)Successfully built gmpy2
Installing collected packages: gmpy2
Successfully installed gmpy2-2.0.8
Advertisements

Bitbucket and its brilliant billing logic

Last year, one of my colleague left the company, just to return 6 months later. He is really a boy scout person, tidying up everywhere he can. So when he left to that new company, he modified his Bitbucket profile, especially the company name he works at.

When working with us, he was Billing Contact at our Bitbucket.org account and the Bitbucket account was payed with his superior’s credit card. Atlassian was sending their monthly bill, which we liked, because we like deducing tax where we can.

Little did my colleague know, when he modified his company name, Atlassian managed to modify the Customer’s name on every bill onward sent to us. It is good to hear again: Atlassian modified the frikkin’ customer name because a single, individual person modified the company he works at.

Now I don’t know how bills are created in United States of A, but it has a high probability that Dolphin Inc. cannot really deduce tax by waving a bill, which has “Turtle Inc.” on it. If it is possible, I’ll probably move there to make billions.

The best part is that the cardholder – who really pays the bill – did not change at all.

If you’ve ever met Bitbucket’s annoying account/user mechanism, you know that Bitbucket tries to convince you that you should have a single account, and you can be in multiple teams. This looks convenient, but the above billing procedure makes this very problematic. “Billing Contact” has to be a new account with proper company name, never to change it (however the creating user still holds the capability to modify the profile any time).

Of course, I could advise how to mitigate this problem, but that is so much in the common-sense area, my mind is still going round how this clusterfuck could even happen.

Steam client on Android is pure genius. Almost.

TL;DR: It is impossible to log in to the Steam services with the Android Steam app using only that phone the app is on (until a fix arrives).

The Steam client on Android has two security features built in it.

One of them you might already know.
If you try to authenticate into Steam from a computer/browser where you have never before logged in, Steam will not let you in immediately, but first it will ask a security code. Behind the scenes Steam sends this security code to the current email address in your Steam profile. You have to access that email, read the code and provide it to the login form (which awaits your input).

This feature is very useful. If someone were to get your Steam credentials, he/she cannot log in, as they won’t have access to your email service where the security code arrives.

The second feature is mobile phone specific.

If you download the Steam client, go to the login page, and for some reason you leave the login page in any state, username/password entered or not, and later you return to the Steam app, every field on the login form is cleared and you need to reenter it.

These two security measures combined is the most fantastic, evar.

If you try to log in with the Steam client for the first time on an Android phone and you enter your username/password, Steam’s superb “new-browser” defense mechanism kicks in. The Steam client will ask for the security code. To take a look at the security code, you have to change to Gmail (or whatever mail client) app and read the email. So when you return to the Steam app, the second “clear-the-form” feature kicks in, and the login form is cleared.

What happened to QA?

Ruby Unit test methods MUST* begin with “test_”

While being creative, and writing some tests in Ruby for testing a site release at the company I’m working at, I accidentally removed “test_” in front of the method name of the tests.

require "test/unit"
require 'rest-client'

class TestNewArticleLoad < Test::Unit::TestCase
  def if_site_loads_into_desktop_browser
    assert_equal(200, RestClient.get("http://www.google.com").code )
  end
end

Running this test results in a big nothing, no error message, just a shell prompt without error. It would be nice if Unit Test displayed the skipped methods, even warn, if not a single method were found in a test class.

Lesson learned, “test_” is a must, when defining methods for testing purposes, in Ruby’s Unit tests.

def test_if_site_loads_into_desktop_browser
  assert_equal(200, RestClient.get("http://www.google.com").code )
end

*:as in RFC 2119

Samsung Galaxy S5 dialing annoyance

When I call someone, after touching the green dial button I usually lift the phone to my ear immediately. But recently I become faster than my Samsung Galaxy S5. If I lifted the phone too fast the screen wouldn’t turn off at all, I had to move the phone away from my ear and put it back again to have the screen turned off.

Turns out, this is not a direct bug just a byproduct of a feature. I have turned on a Display feature that keeps the screen on until I look at the phone (under Display -> Smart Stay).

Turning off Smart Stay solved the problem, looks like Samsung needs to polish its software further.

EDIT:

Nope, it did not solved the problem, it is happening all the time.

Extending server support at HP, Dell and Oracle

In an enterprise environment, with fluctuating people, bosses and vendors I have several servers that are different age and of course different configuration. On a rainy day with a routine check I discover that the support for some servers:

  1. has expired
  2. almost expired (there are few weeks to expiration)
  3. haven’t expired (months to expiration)

Let’s assume in every case I want to extend the time period to 3 years instead of the expired/existing 1 year.

Dell’s reaction to these:

  1. Yeah, pay $200 fine, and buy the extension starting from the day the previous support has expired
  2. Yeah, buy the extension
  3. Step 2

Oracle’s reaction to these:

  1. Yeah, buy the extension starting from the day the previous support has expired
  2. Yeah, buy the extension
  3. Step 2

HP’s reaction to these:

  1. Our engineer will check the server for a hefty price, and if anything is faulty, you cannot extend the period
  2. Yeah, you can extend it. Buy an extension pack.
  3. Hell, no. Wait until you have less than 60 day to expiration, and then go to step 2.

Smart move, HP!