Firefox Focus, a brilliant use case posted on 19 August 2017

Mozilla recently announced Firefox Focus, a new lightweight browser that is the perfect fit for one off session. For example a friend just sent you an article and you want to be able to quicky read it.

  • Focus is shipped with a native ad blocker. Load the content you are looking for, not the ads.

  • Focus has a single screen, no tabs. This means a faster start up. There is no need for your phone to load unrelated tabs.

  • Focus clears cookies and history after each session. Again this means a fresh (e.g faster) start but more importantly you are less vulnerable to a whole set of attacks like CSRF attacks. No one can trick you into sharing an article on Facebook since you are not even logged in.

What I believe will make Focus successful is that it tries to solve a very specific yet common use case: quickly open a link or perform a search. You can also safely make it your default browser as once a page is open in Focus, you can easily switch to any other browser.

Grab it for Android or for iOS.


Convincing people takes time and effort posted on 12 August 2017

Convincing people takes time and effort. If you are not willing to be patient and understanding, your actions will likely have the opposite effect.

A few days ago, an engineer’s manifesto caused a uproar. People took to social media to give their opinion on the situation and many got into heated discussions. The main issue behind these is that social platforms (e.g Twitter) are not suited for healthy discussions - and in my opinion provide more harm than good.

People form their opinion on different topics over time - maybe their whole life. Tweeting them your opinion is not going to instantly change theirs. Calling them name or labeling them will not help and instead, polarizes people on the subject, making it harder to discuss and reason about it.

If one wants to spread awareness of a social issue and improve the situation, here are a few things that I wish people would do more:

  • Always be polite with others - insulting/labeling someone does not encourage healthy discussions.
  • Keep an open mind. You should approach others with an opinion that you are genuinely willing to change. You want to exchange ideas, not force yours or make the issue more polarized.
  • Try maybe to spend time with people face to face may be more effective, especially if you are talking about a social issue. Empathy is hard to communicate with a tweet/facebook post/etc.

I strongly believe that people are naturally good and that our society can improve as a whole and not as one side winning over the other.

Proxy pass with nginx redirects to localhost posted on 08 July 2017

I have multiple nginx instances running on the same server. The master instance redirects traffic according to the request while the slaves one serve a specific website. The main reason for this weird architecture is that I’m running multiple services each in their own docker instance, and that I want to be able to update a specific service without disturbing others.

The master nginx configuration file was:

server {
  listen 80;
  listen [::]:80;
  server_name example.com *.example.com;
  location / {
    proxy_pass http://127.0.0.1:4001;
  }
}

While the slave’s one was:

server {
  listen 80 default_server;
  listen [::]:80 default_server ipv6only=on;

  root /usr/share/nginx/example;
  index index.html index.htm;

  server_name servername;

  location / {
    try_files $uri $uri/ =404;
  }
}

One issue I had was that https://example.com/foo was redirecting to https://127.0.0.1/foo/ instead of https://example.com/foo/.

The solution is simply to pass the original Host header to the nginx slave with proxy_set_header such that $uri/ resolves to https://example.com/foo/ instead of https://127.0.0.1/foo/. So the proper master configuration is:

server {
  listen 80;
  listen [::]:80;
  server_name example.com *.example.com;
  location / {
    proxy_pass http://127.0.0.1:4001;
    proxy_set_header Host $server_name;
  }
}

Building Magenta on Archlinux posted on 08 July 2017

I have been a bit curious about Fuchsia/Magenta. From the README:

Magenta is the core platform that powers the Fuchsia OS. Magenta is composed of a microkernel (source in kernel/…) as well as a small set of userspace services, drivers, and libraries (source in system/…) necessary for the system to boot, talk to hardware, load userspace processes and run them, etc. Fuchsia builds a much larger OS on top of this foundation.

I decided to poke a bit around. Here are a quick notes on how to build it on Arch. These instructions assume you have the usual tools like base-devel.

The canonical git repository is at https://fuchsia.googlesource.com/magenta. There is also a mirror (read only) on GitHub https://github.com/fuchsia-mirror/magenta.

Download the tool chain:

./scripts/download-toolchain

Install libtinfo from AUR:

yaourt -S libtinfo

Archlinux comes with /usr/lib/libtinfo.so.6 (not /usr/lib/libtinfo.so.5) and I didn’t feel like installing another version of libtinfo, so i just created a symlink to the new version. So far, everything seems to work fine.

sudo ln -s /usr/lib/libncursesw.so.6.0 /usr/lib/libtinfo.so.5

Build it:

make -j4 magenta-pc-x86-64

Install QEMU except if you plan to just test it on real hardware:

sudo pacman -S qemu

Run it:

./scripts/run-magenta-x86-64