How does your OS see goroutines? If you’re beginning your advanture with Go, you’re probably attracted by Go’s support of concurrency. That’s the main selling point of this language. If you know some Go, you probably tell your friends that Go’s model of concurrecy is based on CSP (Communicating Sequential Processes). But how does it look under the hood? Does it use threads, green threads? If someone asked you to explain it how does it look from an OS perspective, what would you say?
Have you actually ever verified it? If you are a developer, you probably deal with already set up environment and your only job is to write a Dockerfile and push an image to a registry (or even less work if use Continues Integration). Altough I’m going to focus on production environment where Docker images are pulled and running, which is set up by DevOps or sysAdmiss, there’s still a good few things to check on your end to increase the level of security:
LibGDX and Kotlin Current libGDX version (night build v1.9.8) has issues with generating the boilerplate code when ‘Use Kotlin as the main language’ option is selected. the error: You can try generate the code for Java but the gradle scripts generated by libGDX are built for older versions of Gradle than the one used by the newest Android Studio 3.1.2 (stable) and the build process of your Android project may fail.
What is RabbitMQ? RabbitMQ is an Erlang-based implementation of AMQP (Advanced Message Queuing Protocol) which is an open standard that defines a protocol for systems to exchange messages. RabbitMQ provides support for the STOMP, MQTT, and HTTP protocols by the means of RabbitMQ plug-ins. Ok, simply speaking it’s a message broker (it accepts and forwards messages). Core Concepts Publishers (Producers) create messages and publish (send) them to a broker server (RabbitMQ).
How to aggregate multiple network interfaces into a single logical interface? If you haven’t heard about network bonding - it’s a network setup that allows you to use two or more network devices to act as one interface, giving you expanded bandwidth and some redundancy. Basically you can turn a 1 GiB link into a 2 GiB link for the one virtual interface. Usually it’s used to bond ethernet devices, but let’s try to mix wifi and ethernet.
How to organize multi-container application Sidecar pattern Let’s start with a single node. It’s a common practice to seperate concerns also on the container levels. One container could act as a static content server, and the other could perform computations. They both exist on the same node and both have access to the same resources - although you may allocate different CPU and memory consumption. Another popular scenario is to have a seperate container that handles logs of the other container as both share the same disk volume.
How to associate different git account to different projects? Let’s say you have two github accounts, one used at work and the other for your own projects but you want to use both from one linux account. You want to work on each project without a need to type in appropriate credentials everytime you push changes. Firstly you need to generate unique ssh keys for each of them: ssh-keygen -t rsa -C "your-work-email-address" -f NAME_OF_THE_FILE For instance:
Simple but handy Formatting time in Go is a very interesting topic but let’s focus on a particular case: a popular TIMESTAMP format used in MySQL: ‘0000-00-00 00:00:00’. It turns out that if you want to use it in Go, you have to format time yourself. Luckily it’s a very easy job in Go. Let’s take current time: t := time.Now() fmt.Println(t) This will result in displaying time in the following format:
Build your network of containers There’s a lot of tutorials showing how to link containers using the docker run –link option, but the link flag is a depricated feature of Docker and may be eventually removed. I will show you how to link containers via docker network providing a template of Dockerfile for your Golang application, but the focus here is really on the process. It’s there already… Assuming you haven’t created any networks yet, executing docker network ls should list the default Docker networks:
Can you translate that to human language? A little over a week ago, Loïc Hoguin, the creator of Cowboy - a very popular web server built in Erlang, published an article about his experience of conviencing people to use Erlang, or rather their reaction when they see the Erlang’s syntax :) It inspired me to write this post. It’s hard to change humans habits (that’s how our brain works), so even if you give someone a super tool solving their problems but it will require changing their habits it might take longer than you expect.