07 Sep 2016

Notes: DNS basics

Some notes regarding DNS for future reference, after watching DNS for developers - Maarten Balliauw session

  • DNS is just a phone book to translate host names to ip addresses
  • DNS holds different type of records. Using TXT record allows to store almost anything
  • Never use public hotspot WIFI DNS servers
  • Reduce the TTL before making changes to DNS records
  • DNS query results are cached everywhere
  • Simple DNS failover / load balancing
  • AWS (Route53) and Azure allows to monitor the IP addresses and update the DNS records so you get better failover / load balancing

Very interesting for my projects the last section of the talk regarding service discovery.

Useful commands:

    dig A www.example.com +trace

    nslookup www.example.com 8.8.8.8

    # flush dns cache on OSX

    sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

18 Jan 2016

Synology 415+

I’ve been using a Home Server / NAS since 2009. I use it for backups and to hold my personal media. It has served me well, but it’s showing its age. Besides I could get rid of other computers if it was just a litle more powerful.

After sometime exploring the options, I’ve settled on a Synolody 415+. What gave me the final push is their OS (DSM), which seems the best.

Quick notes about this NAS:

Docker

It supports docker. Which opens the NAS to run almost everything.

Power usage

This is one of the most important things if you plan to leave the server running 24x7. With 3 hard drives connected it drains just 27 Watts. You can also let it suspend itself when not in use and it wakes up over LAN.

Memory upgrade

It comes with just 2 GB of RAM. I guess is ok if you plan to use it only as a NAS and maybe install one or two packages. But as soon as you want to use it for docker it quickly falls short.

So I purchased a compatible 8 GB memory stick an upgrade its memory.

Some tips:

  • You can’t freely choose whatever memory you want. It needs to be compatible. This one worked for me
  • The 415+ it’s not supposed to be memory upgradable. I followed this instructions and I had no problem. However, legally, it will void your warranty.
  • Once upgraded, even if it boots normally, you want to perform a memory test. I had random problems (sudden reboots, docker images failing…) until I discovered that I had a faulty memory chip. The replacement worked fine though.
  • You need the Synology Assistant (LINK) to launch the memory test.
  • You can see the memory test log in /var/log/memtester.log. If it has something like: Congrats!

CPU performance

I’m running Gitlab, ELK, Plex, Download Station and it works just fine.

Most people is interested in transcoding videos using Plex. Well, sometimes it chucks with some big videos.

IO performance

Just perfect and very consistent.

Conclusion

I recommend it.

03 Nov 2015

Drink the Elixir

I’ve been playing with Elixir for a month now. Just on my spare time, but can’t stop thinking about how to use it on my projects.

Some years ago I saw a talk by Joe Armstrong, one of the parents of Erlang, and I inmediately purchased his book: Programming Erlang - Software for a Concurrent World.

It was a delight to be introduced to functional programming, pattern matching, message passing concurrency, etc. However I stumbled upon the crude reality: do I have any project which I can use Erlang? The answer unfortunetely was no. I was just moving from Windows desktop apps to simple CRUD Rails apps.

Fast forward a few years and I discover Elixir. A new language built on top of Erlang, which eases the rough edges and makes Erlang a joy to use, like Ruby.

I’m hooked, again. I watched most of the Elixir Conf videos and I bought Programming Erlang and Erlang In Action books. This time however, it might not only be a curious exploration, I might actually use this for real.

Ah! And it’s not just Elixir. A web framework has been developed in paralel with Elixir which feels as Rails (although is a different beast!): Phoenix.

18 Oct 2015

Rails cannot connect to Postgres db

A project that was working on my laptop just fine a few months ago, today throws this error:

PG::ConnectionBad - could not connect to server: No such file or directory Is
the server running locally and accepting connections on Unix domain socket
"/var/pgsql_socket/.s.PGSQL.5432"?

I’m sure Postgres is running as I can connect directly using psql and other rails projects are using it just fine.

I updated the pg gem but it didn’t work. After some googling, I fixed it by adding the following line to my /config/database.yml:

host: localhost

Not sure why this happened as other projects don’t have this line.

07 Oct 2015

Upgrading to Windows 10 in a Fusion VM

Fusion 7 - Windows 10

I have a VMWare Fusion 7 VM running Windows 8.1 to use Visual Studio.

Today I decided to upgrade it to Windows 10 as I have it on my main PC and it works great.

The upgrade from the little Windows notification taskbar icon didn’t work. It complained about the SVGA driver being incompatible. According to VMWare this is a bug in the Windows verification tool.

The workaround is to manually download the Windows 10 image, mount the ISO file using the Fusion CD/DVD and upgrade from there. Be sure to download the appropriate image.

Upgrading from the ISO worked indeed. However, I wasn’t able to run Windows at full resolution. The workaround for this problem was to uninstall the VMWare Tools and install them again. After that it worked like a charm.

25 Sep 2015

Fortigate 60D WIFI

After my recent Internet speed bump, the Cisco ASA 5505 I was using became inmediately obsolete. It cannot handle more than 100 Mbps or so.

Fortinet 60D WIFI

I’ve replaced it by the Fortigate 60D-WIFI. This is much more than a simple router / firewall, it’s a Full UTM appliance. It combines the usual router/firewall features with Antivirus, Intrusion Prevention System, Data Leak Prevention, Web Filter and much more.

It has a nice web user interface to manage most of its features and the CLI seems a lot easier to grasp than the CISCO.

So far I’m pretty happy with it.

However I found some gotchas:

PPPoE connection is not hardware accelerated

Even being in contact with Fortinet support, this one took a few weeks to diagnose.

Testing the internet speed with speedtest.net or downloading multiple files, I wasn’t able to reach 300 Mbps. In fact, it was aroud 180-190 Mbps.

The CPU in the Fortigate was 100% and became unresponsive while downloading.

It seems that this model doesn’t hardware accelerate PPPoE connections and all the traffic is handled by the CPU.

PPPoE is the only connection type my ISP allows, so changing to something else was not an option.

I solved it by keeping the ISP router and put the 60D in the DMZ of the ISP router with a static IP assigned.

Now I can reach 300 Mbps with no impact on the CPU. However I have to keep using the ISP router which I hoped to get rid of.

AP FAP21D radio 1 country GB (826) ==> US (841) set failed.

I also have an Fortinet Access Point 21D. I was getting this error message on the logs. You are supposed to execute the following on the CLI:

config wireless-controller setting
    set country ES
end

However I still was getting the same error. To solve it you have to delete all the WIFI profiles, delete the FAP21 from the managed FortiAPs, make the setting change and then add the FAP21 again.

19 Sep 2015

Raspberry Pi WIFI config

Every time I have to setup the WIFI in a Raspberry Pi I google how to do it. I mostly remember what to put on the /etc/network/interfaces config file, but I need to check out what goes on /etc/suplicant/suplicant.conf. There are many options. Instead of setting up all posible options, start with this. Chances are it would just work ok.

File: /etc/network/interfaces.conf

    auto lo
    iface lo inet loopback

    auto eth0
    allow-hotplug eth0
    iface eth0 inet dhcp

    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    iface default inet dhcp

File: _/etc/wpa_supplicant/wpasupplicant.conf

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1

    network={
        ssid="wifi-ssid"
        psk="wifi-password"
        key_mgmt=WPA-PSK
    }

07 Jul 2015

Movistar 300 Mbps

This was my connection speed yesterday:

Movistar 30 Mbps

And this is my connection speed today:

Movistar 300 Mbps

I still remember my exciment the first time I got my US Robtics 56K connected. At that time, it really felt fast.

US Robotics 56K

27 Mar 2015

Links for the weekend 13 - 2015

Interesting links I’ve bookmarked this week:

23 Mar 2015

Links for the weekend 12 - 2015

Slow week due local holidays.

Older posts...