Money is not everything

Back in my days as university student, one of the most important concepts in the classes “Project management”  and “Investment projects evaluation” was the ROI. With WhatsApp saying To handle 50 billion messages a day the focus is on making a reliable system that works. Monetization is something to look at later, it’s far far down the road. [1] and Zuckerberg saying Simply put: we don’t build services to make money; we make money to build better services.[2] in the IPO letter, it is clear that not everything is about money.


“Steve’s talked about the goal of Apple, and the goal of Apple is not to make money but to make really nice products, really great products”, said Jonathan Ive [3].



Yes, not everything is about money, money doesn’t have real value, money shouldn’t be necessary…money shouldn’t exist in the first place

Other unrelated but interesting parts on the WhatsApp architecture article:

– In 2011 WhatsApp achieved 1 million established tcp sessions on a single machine with memory and cpu to spare. (Wow!)

– Ejabberd in FreeBSD. (I played with that!)

-32 engineers, one developer supports 14 million active users. (Good people is worth)



[3] Inside Apple, Chapter 3. Adam Lashinsky


As usual, a lot of interesting things are going  in The Internet, here are some that caught my attention:

1) Mozilla Persona

A better way to sign in.

It can be used to implement SSO (Single-Sign-On), in someway it is similar to OpenID.
The identity provider is not notified, which is very good for privacy.
It is focused on the browser (built on the BrowserID protocol)
Take a look


2) IDEs in the Cloud

Many things are moving to the Cloud, and IDEs are not the exception.
Cloud9 the IDE (not the restaurant with tasty food) is a popular one.

This link lists more options.


3) Visual Regular Expressions

Chances are that you know the saying

Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.
Attributed to jwz.

Well, that is less true with Debuggex, a pretty cool tool to visualize JavaScipt, PCRE and Python regular expressions. Debuggex eases the problem of using regular expressions. It integrates Mozilla’s Persona and embedding in StackOverflow.

RegexPlanet is another good option but isn’t possible to visualize regex…

One thing I would like to see:   Debuggex is  open-source instead of  Debuggex is not open-source

Check it out


4) FreeBSD in the PlayStation 4

Seems like the PlayStation 4 will be running Orbis OS, a modified version of FreeBSD.


5) Synchronization via procrastination

The article Structured Deferral: Synchronization via Procrastination overviews how to maintain data synchronized using a lazy approach.
It compares reference counting, hazard pointers…

Recommended article


6) On Java garbage collection

Article explaining the G1 Garbage Collector.


7) Serval Project

Serval Project brings Open telecommunications using mesh networking.

These are the features that make it interesting:
1) Opertaes in normal phones (there is an app for Android)
2) The nodes keep the phone number
3) All calls are end-to-end encrypted

This has wide range of use cases, e.g., using cell phones in over-crowded places, communicating during disaster, freely communication during civil resistance, communicating with friends without using carrier’s networks…

An article in MIT Technology Review

A related TED’s talk video

The project page in indiegogo

Open Garden is a similar project that is worth looking


8) The Process of Innovation

A software guy named James Gosling (not a Senior Consultant, not a Principal Engineer, not a Dr, just a plain Software Guy) talks in Standford’s Computers Systems Colloquium about the process of innovation. Among other interesting facts and anecdotes he talks about:

  • The cost of risk. For a company, going into a research project is a risk because, research project takes time (time is money, and researchers are not cheap), and there are big chances that the research couldn’t be capitalized.
    So, from the risk point of view, it is safer/better to acquire a company that has already developed a product as result of a research project. This is also better from the accounting point of view, even if the price to pay is high, the company’s is not exactly spending money but just changing the form of an asset, as opposed to literally spend money in a research project until it becomes profitable, if someday turns out to become profitable. For companies is better to buy instead of develop. Around 20′
  • He compares the ‘success rate of R&D projects’ in IBM with 1%-5% considering more than 3% highly productive, and Sun with 10% – 20%. The fact that Sun’s outperformed IBM might be due to the fact that almost every manager at Sun had a technical/engineering background. Around 30′
  • How to do technology transfer? Create something new, killing the old…or transform the old into something new


9) A different approach to schedule public transportation

Self-Organization Leads to Supraoptimal Performance in Public Transportation Systems

This interesting and not conventional paper, argues that self-scheduling public transportation is more efficient than the typical approach where vehicles come at regular intervals.

Take a look

psshfs in DragonFlyBSD

How I got mount_psshfs(8) to work.

mount_psshfs basically offers the same functionality as sshfs(1). Putting it to work is quite easy but it is not enabled by default, so some work is required.

0) Set up ssh keys

1) Build, install and boot a new kernel which includes the following parameters. Here is how.
 pseudo-device putter # PUFFS(4)
options PUFFS #Pass-to-Userspace Framework File System

Alternatively, just load the module
kldload puffs

2) Add device rules in /etc/devfs.conf
 perm putter root:wheel 0666

3) Enable vfs.usermount
In /etc/sysctl.conf add

4) Mount it!
 mount_psshfs -O IdentityFile=/home/earthling/.ssh/mercury_rsa mercurius@ /home/earthling/mnt/remote_to_mercury



mount_psshfs: handshake failed, server does not support sftp?
mount_psshfs: puffs_mount: cannot open /dev/putter
mount_psshfs: puffs_daemon: Permission denied
mount_psshfs: puffs_mount: Permission denied
mount_psshfs: puffs_mount: Operation not permitted

Why fork(2) doesn’t copy all threads?

There are many advises discouraging the use of fork in threaded applications…it is even on “Programming with POSIX Threads” by Butenhof….Avoid using fork in threaded program (if you can) unless you intend to exec a new program immediately.

Certainly using fork in threaded programs is not a good idea but sometimes it becomes necessary, so, the point is: why fork(2) doesn’t copy all threads?

First time I  asked myself  “does a forked process have all the parent’s threads?” I thought yes but, I was wrong.  The specification say it: A process shall be created with a single thread

So why?

  • Because is more practical, easier, and less complex.
    • There are only two alternatives, copy all of them or copy just the one calling fork. Each alternative has it own set of complexities, so, which approach is easier to follow? Copying only the thread that called fork.
  • Critical sections: Other threads could be executing critical sections at fork() call, therefore child process might get a copy of objects that are in undefined status => causing undefined behavior on the application. Σ =
  • Parent and child could be reading from fd or socket at the same time, or even worse writing to it.  あぶない
  • Since state in parent and child should be the same, all parent’s threads should be stopped before to be forked and if in the middle of a system call EINTR would be raised
  • .

Specification mentions forkall was rejected, that means that I was not alone.
It is easier to deal with one thread using pthread_atfork() than dealing with multiple threads on the child.
As long as it is specified it is OK

jailuser en FreeBSD

Antes que nada decir que jailuser es una excelente herramienta para manejar ambientes chrooteados.

La instalé en FreeBSD 7.0 desde ports y packages pero no servía:

# pkg_info |grep jail
jailuser-1.9_1 Builds a chrooted environment

Al intentar

# mkjailenv /tmp/jailuser/

arch i386 doesn't exist.
Compilation failed in require at /usr/local/bin/mkjailenv line 35.
BEGIN failed--compilation aborted at /usr/local/bin/mkjailenv line 35.

Estuve viendo el código y encontre una forma de solucionarlo aunque muy probablemente no es la mejor funciona bien mkjail y los demas comandos de jailuser.

No encontre documentacion, ni pude contactar al autor del jailuser, trataré de informar al mantainer de FreeBSD.

diff entre el original y el modificado de /usr/local/lib/

< local $found = 0;
> local $found = 1;
< return($ARCH_DIR_LOOKUP{$arch});
> #return($ARCH_DIR_LOOKUP{$arch});
> return freebsd;

Mi /usr/local/etc/jail.conf


Otra instalación de OpenBSD [sparc, NFS client]

Pues sí ahora en una sparc tipo pizabox

Aquí el dmesg

OpenBSD 4.2 (GENERIC) #851: Tue Aug 28 12:27:19 MDT 2007
real mem = 133828608 (127MB)
avail mem = 125358080 (119MB)
mainbus0 at root: SUNW,SPARCstation-5
cpu0 at mainbus0: MB86907 @ 170 MHz, on-chip FPU
cpu0: 16K instruction (32 b/l), 16K data (32 b/l), 512K external (32 b/l) DVMA coherent cache enabled
obio0 at mainbus0
clock0 at obio0 addr 0x71200000: mk48t08 (eeprom)
timer0 at obio0 addr 0x71d00000 delay constant 82
zs0 at obio0 addr 0x71100000 pri 12, softpri 6
zstty0 at zs0 channel 0
zstty1 at zs0 channel 1

le0 at ledma0 offset 0x8c00000 pri 6: address 08:00:20:90:86:63
le0: 16 receive buffers, 4 transmit buffers
audiocs0 at sbus0 slot 4 offset 0xc000000 pri 9
audio0 at audiocs0
"power-management" at sbus0 slot 4 offset 0xa000000 not configured
cgsix0 at sbus0 slot 3 offset 0x0 pri 9: SUNW,501-2325, 1152x900, rev 11
wsdisplay0 at cgsix0: console (std, sun emulation), using wskbd0
bootpath: /iommu@0,10000000/sbus@0,10001000/ledma@5,8400010/le@5,8c00000
nfs_boot: using interface le0, with revarp & bootparams
nfs_boot: client_addr=
nfs_boot: server_addr= hostname=pizasol
root on vaio:/var/export/pizasol/root
swap on vaio:/var/export/pizasol/swap

Una vez más constato la muy buena calidad de la documentación de OpenBSD.