Setup Wireguard Between Two Servers

WireGuard is a modern VPN that utilizes state-of-art cryptography. It’s very easy to set up compared to other VPNs. In this post we are exploring how to set up secure networks between two servers over the internet. Preparation First, we will need the necessary components: wireguard-go and wg from wireguard-tools. wireguard-go is used to create the network interface that the system uses to create the tunnel between the servers. wg manages the configuration of the interfaces....

published on December 28, 2023 · last edited on July 17, 2024 · 4 min · 654 words

Tracking Http Upload Progress Using Golang

I wrote a simple cli tool to upload files to my Cloudreve instance. It’s easy to figure out which api to call when uploading files. However, it will be helpful to know how the upload is going. Visualizing Speed When creating an upload request, golang allows us to use a io.Reader as the request body. The body will be responsible for displaying upload progress. info Although Cloudreve and its storage providers require Content-Length header to be set, thus requiring the total length to be known beforehand, this method is applicable even if the total is unknown....

published on December 10, 2023 · 3 min · 574 words

Compiling Static Binaries With Alpine

A static build is compiled version of a program which has been statically linked against libraries, according to Wikipedia. In practice, it means we can run a binary anywhere in compatible environments without installing dependencies. Although the binary is considerably larger, it greatly simplifies deployments. Learning by Example - cURL First, we take a look at how a static binary of cURL can be produced: 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 # dependencies to build curl apk add build-base clang openssl-dev nghttp2-dev nghttp2-static libssh2-dev libssh2-static # these are missing on at least armhf apk add openssl-libs-static zlib-static || true # gcc is apparantly incapable of building a static binary, even gcc -static helloworld....

published on November 20, 2023 · 3 min · 592 words

Advanced Postman Features

Postman is an API platform for developers. For average users, it can be used to send HTTP requests very easily. It has an intuitive interface - you can specify different aspects of an HTTP request: the method, the url, the query parameters, the headers and the body if any. Sometimes it’s also easier to call an API using Postman than to use the UI to do something. Postman has some features to make this accessible....

published on November 8, 2023 · 2 min · 375 words

Customizing ArtPlayer

ArtPlayer is a modern and fully-featured HTML5 video player that is very easy to use. In this post we show several examples how to customize it to better suit our needs. Schedule a Pause Sometimes we want to pause a video after some time has passed. We can use an input html element to enter the amount of the time after which the video will pause. However, we can sort of hack it as an ArtPlayer setting....

published on August 28, 2023 · 3 min · 480 words