“How social networks work”

This popped up in my twitter stream:

How social networks work: Marketing bozos decide to game the system until it collapses. Then they look for a new place to piss. The End

Now what did that remind me of? A comment about marketing droids that I had left somewhere years ago. It took me a while to locate it, but here it is. The blog’s author in his conclusion was wondering:

It’s amazing to me that some people are so blind to that outcome. A savvy marketer ought to already know that it’s not all that smart to burn up the medium in a way that arrests your future ability to make money from it?

To which I responded:

They are not blind. They simply work within their time-frame of maintaining their job in email marketing. How much is this going to be? Three, Five years? Then they will switch subject and will not care for the ruins left behind. People in marketing and management are always that “blind” because they care more about their bonuses than the lifetime of the company they work for. As for the demise of their previous company, it is never their fault, right?

* Sometimes you have to copy comments that you leave elsewhere back somewhere where you exercise more control.

OpenVPN: “The data area passed to a system call is too small”

On a Windows 7 client I was getting the following error message after the VPN connection was completed and everything looked like normal. While the connection was completed (and the “lights” were green) the user could not do anything on the net. The log message on the client was repeating:

The data area passed to a system call is too small

In such cases it may help to check whether both sides have (or have not) comp-lzo set and set at the same value. In my case this was solved by setting:

comp-lzo no

at both the server and the client(s).

100ms

Let’s take the following diagram for granted:

NSA infiltrates links to Yahoo, Google data centers worldwide, Snowden documents say
NSA infiltrates links to Yahoo, Google data centers worldwide, Snowden documents say

Now why would that happen? Why would they choose to have unencrypted traffic through their network? And then something I read struck me:

“For an organization with a large-scale website doing business via advertising or e-commerce, or whose primary source of revenue is via interaction with a website, one of the most notable concerns is web page load times. A well-known metric that supports this comes from Greg Linden of Amazon.com, who posited that an increase in 100 ms of load time caused a 1 percent drop in sales on Amazon.com1.”

At such scales all milliseconds translate to money I guess.

[1] – “Make Data Useful” [PPT slides]

Thank you Packt Publishing

I was going through my copy of “Nginx HTTP Server, 2nd edition” when I located a typographical error regarding WordPress installations with nginx. I used the errata submission form provided by the publisher to inform them. A few days later, they replied confirming the error and they offered me a complimentary copy of any of their titles. And so I got “Haskell Financial Data Modeling and Predictive Analytics” :)

Thank you Packt Publishing!

Ansible, git and Rails

I think I wrote the following playbook a few months ago, when I was halfway through watching the 2 hour introduction (now replaced with this):

---
- name: automatic deploy new version
  hosts: ruby-production
  user: root
  sudo: yes
  tasks:

  - name: stop monit
    command: service monit stop

  - name: checkout correct version
    sudo_user: projectuser
    command: chdir=/workspace/project git checkout release-1.0

  - name: grab latest sources for that release
    sudo_user: projectuser
    command: chdir=/workspace/project git pull origin release-1.0

  - name: run db:migrate
    sudo_user: projectuser
    sudo: no
    script: migrate.sh

  - name: restart apache
    command: service httpd restart

  - name: start monit
    command: service monit start

What the above playbook does is simple:

– Stop monit to avoid any automatic restarts when you’re half way through updating stuff that it monitors.

– It makes sure that you grab the latest updates from the correct branch

– It runs a script on all servers that takes care of any bundle install and db:migrate stuff.

– It restarts apache. Yes, a touch tmp/restart.txt should do the trick but sometimes it does not.

– It restarts monit.

There is plenty of room for improvement here, for example using the git module instead of running an explicit command and even making use of roles as the project expands and becomes more demanding and of course get rid of the script in favor of a more ansible specific play.

So why post it now? Basically at the request of @nanobeep and as a means of self-pressure to improve the playbook. Maybe I should promise this to someone?

So there, nothing complex or elaborate. BTW, here is a similar way to do this with git and Capistrano that I bumped into.

When you dd from Windows

I bought a 8GB SD card for my Raspberry Pi and happily dd’ed the Raspbian image to it. But it did not boot. @namp and @eliaschr suggested that I re-dd-ed (redid?) the image to the disk. But I know how to run dd(1), right?

Yes and no :(

I run dd.exe from a windows machine:

C:\TEMP> dd.exe if=2013-09-25-wheezy-raspbian.img of=\\.\e:

Ding! The above does not start writing from the beginning of the disk. It starts writing from the beginning of the E:\ partition. I dd-ed the image from a Mac and all boot well.

I suppose (but have not yet checked) that had I used the \\.\path\to\physical\drive path, I would not have bumped into this.

10 λεπτά

[ Έχω την εντύπωση πως το παρακάτω σχόλιο το έχω ξαναγράψει. Διάβασα αυτό και το θυμήθηκα, έψαξα το blog όμως και δεν το βρήκα, οπότε here goes: ]

Ένα από τα πράγματα που έμαθα από τη sage-members είναι πως είναι καλό να παίρνεις τον καφέ σου και να κάνεις βόλτα γύρω-γύρω τα γραφεία για ένα δεκάλεπτο. Οι χρήστες βλέπουν πως “είσαι εκεί” και μαζεύεις προβλήματα που μπορεί να υπάρχουν αλλά δεν τα έχεις ακούσει ακόμα (που σημαίνει πως θα τα ακούσεις όταν μεγαλώσουν και σκάσουν). Ίσως τα πιο πολύτιμα 10 λεπτά της μέρας. Σε γλιτώνουν από πολλές τηλεφωνικές διακοπές σίγουρα.

Η αλήθεια είναι πως δεν το κάνω κάθε μέρα πια.

[ Το είχα γράψει τελικά – Ου γαρ έρχεται μόνον ]

The Square Law of Computation

“Experience has shown that unless some simplifications can be made, the amount of computation involved increases at least as fast as the square number of equations. This we call the Square Law of Computation.” [source]

Whenever I see a n2 expression I dig. O(n2) seems to be a fine rough metric for a lot of things. And the above was first stated in 1975, almost five years before Metcalfe. Which reinforces my admiration to Metcalfe, for he was the first to link the complexity of a problem with value in such a back-of-the-envelope metric.