[Golang/VSCode] Master Golang Debugging in VSCode: Step-by-Step Guide with Delve

Introduction If you are rocking VSCode as your IDE for Golang development and haven’t installed the debugger, I would recommend you to do it now. And Don’t worry, I’ve got your back. In this friendly guide, I’m going to walk you through the process of setting up and configuring the Golang debugger in VSCode. Step by step guide 1. Install the Debugger for Golang Delve, a fantastic open-source project, is your go-to debugging companion for Golang in VSCode. This powerful tool works like a charm on Linux, macOS, Windows, and FreeBSD. For this guide, we’ll focus on Windows, but the steps remain consistent across other platforms ...

Drone CI Pipeline Routing

[DroneCI] How to Specify Pipelines to Run on the Particular Drone CI Runner

Let’s say you have multiple Drone CI runners. By some reasons, you want to route pipelines to a particular Drone CI runner. How do you do that? The answer is to use the DRONE_RUNNER_LABELS environment variable to label your Dronce CI runner and in the Drone CI pipeline, specify the the label value under the node section. Scenario Without examples, it’s hard to understand. So let’s go through an example. ...

Illustration: Docker container security - disabling SSH for production environments.

[Dockerfile] How to Prevent Docker Container from SSHing

While SSH is a valuable tool for debugging and testing Docker containers, enabling it in production environments is not recommended due to security concerns. To disable SSH in a Docker container, it’s advisable to remove the SSH server during the image building process. One way to accomplish this is to remove the SSH server during the Docker image building process. For example, if you’re using the alpine base image, you can use the following Dockerfile: ...

[OCI] Error: "iptables failed: iptables --wait -t filter -A DOCKER"

If you encounter the error messages shown below when attempting to run docker-compose up in OCI, a solution to the problem can be found in the following steps: failed to create network traefik_default: Error response from daemon: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-5501386794d6 -j DOCKER: iptables v1.8.4 (legacy): Couldn't load target `DOCKER':No such file or directory Try `iptables -h' or 'iptables --help' for more information. (exit status 2) or ...

Golang timeout feature - Illustration depicting a clock and a task symbolizing the implementation of a timeout feature in Golang

[Golang] Implementing Timeout Feature in Golang for Efficient Task Processing and Error Handling

Let’s dive into an exciting scenario to explore how we can jazz up our Golang code with a cool timeout feature! Imagine this: you’re building an awesome application and you want to delegate a task to a third-party API. But here’s the catch - the processing time for this task is unpredictable. To add some spice to the mix, you decide to set a timeout for the task. If the third-party API takes too long and doesn’t return the result within the timeout, we’ll label it as error and move on, regardless of whether it eventually responds or not. We’re all about efficiency here! However, if the API does manage to return the result within the timeout, we’ll update the task status accordingly. ...

[Docker] Configure Custom TLS Certificates for Docker API Using Docker-in-Docker

Hey there! Have you ever wanted to configure custom TLS certificates for Docker API, but didn’t want to mess up your local Docker environment before you’re sure everything is working smoothly? Well, fear not! I’ve got a secret recipe for you that involves using Docker-in-Docker (DinD) to run a temporary Docker container with custom TLS certificates mounted. To get started, let’s say you already have your custom TLS certificates ready in the path `/tmp/certs``. You can run the following command to start a temporary Docker container with custom TLS certificates mounted: ...

[Portainer] Web UI for Self-Host Docker Registry

Setting up a custom UI for a self-hosted private registry with Portainer can be a great way to manage your Docker images and control access to them. In this blog post, I’ll walk through the steps to set up a custom UI for a private registry using Portainer, a popular open-source tool for managing Docker containers. Step 1: Set up a private registry The first step in setting up a custom UI for a self-hosted private registry is to set up the registry itself. You can do this by running the following command: ...

[WSL/Swarm] Fail to Join Docker Swarm as Worker

1. Problem I was trying to set up a Docker Swarm environment in my home network. My plan was to run the Docker Swarm manager node in a WSL2 Ubuntu distro on my Windows laptop, and run the Docker Swarm worker node on my MacMini. Both of them have Docker Desktop installed. When I tried to add a worker to the Swarm, I received the following error: Error response from daemon: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 192.168.65.3:2377: connect: connection refused" My operation is as followed below ...

[Multipass] Command Cheatsheet

A quick reference guide for commonly used Multipass commands. 1. Launch multipass launch This command will launch a new instance of Ubuntu on your machine. 2. Install multipass install <image> This command will download and install a specific image of Ubuntu onto your machine. For example, multipass install 18.04 will install Ubuntu 18.04. 3. List multipass list This command will list all the instances of Ubuntu running on your machine. ...

[OCI] How to Setup Self-Host SMTP Server on Oracle Cloud Infrastracture($0 cost)

Configuring an SMTP Server on Oracle Cloud Infrastructure can be a useful way to send email messages from your applications or services. However, Oracle Cloud Infrastructure will block Port 25 by default and it cannot be removed by configuring engress rule in the security list. To bypass it, you will need to create an Email Relay in the Oracle Cloud Infarstracture. In this blog, I will show you how to configure the SMTP relay on Oracle Cloud Infrastructure (OCI). ...

DigitalOcean Referral Badge
Sign up to get $200, 60-day account credit !