{ | |
config, | |
pkgs, | |
options, | |
... | |
}: let | |
hostname = "oatman-pc"; # to alllow per-machine config | |
in { | |
networking.hostName = hostname; |
I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.
For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.
Note Windows uses the DLL system, and in this case, this does not necessarily have to be in native code.
One example is DLLs written in C#, which runs on a virtual machine. Because I do not use windows, I ended up not testing if it is poss
import json | |
import uuid | |
from IPython.display import display_javascript, display_html, display | |
class RenderJSON(object): | |
def __init__(self, json_data): | |
if isinstance(json_data, dict) or isinstance(json_data, list): | |
self.json_str = json.dumps(json_data) | |
else: | |
self.json_str = json_data |
- Create certificates
- Edit Docker options
- Restart Docker
- Copy client certificates from host
- (optional) Add remote endpoint in Portainer
Tested on a standard $5/mo DigitalOcean VPS running Ubuntu 16.04.
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.
This is just a picture of this link from March 2, 2019
Originally, I had included some other solution
#!/usr/bin/env bash | |
# This script requires `curl`, `jq`, `xargs` `bc` and `awk` | |
add_arrows() { | |
foo=$(echo $1 | sed -e 's/^\([0-9]\)/▲ \1/g') | |
foo=$(echo $foo | sed -e 's/^-/▼ /g') | |
echo $foo | |
} |