Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Update & Delete Kubernetes resources in one-line command

It recently troubles me that my GKE cluster is managing more and more resources and causing difficulties in maintenance, one of which involves how to delete resources properly.Next, I will explain step by step the difficulties I encountered in my work and how I finally used the combination of bash commands and kubectl to implement the edition of Kubernetes objects through one-line command.In generalThe following are the basic operations that almost every Kubernetes user takes. Check 👉 the cheatsheet if you’re not familiar with the process.Delete a single resource throu...

6,327 1       KUBERNETES


  Mock Solutions for GoLang Unit Test

In Go development, Unit Test is inevitable. And it is essential to use Mock when writing Unit Tests.Mock can help test isolate the business logic it depends on, enabling it to compile, link, and run independently.Mock needs Stub. Stub function replaces the real business logic function, returns the required result, and assists the test.I involved the related test code for Controllers while writing Kubernetes Operator recently, and there would be mocks for GRPC and HTTP requests. I did it in an old fashion way, but I believe there is a better and more graceful way to han...

12,335 0       UNIT TEST GOMOCK GOSTUB TESTIFY


  Encrypting and decrypting PGP file or text on MacOS

When doing data exchange among different parties, there is a frequent need of encrypting data or file and sending it to partner and asking partner to use corresponding key to decrypt the data or file. A famous way of exchanging data is using asymmetric keys where no secret key needs to be shared. One party can just use the public key shared by partner to encrypt the data and the other party uses the private key to decrypt the data.Today, we will introduce how to use PGP to encrypt and decrypt data on MacOS. Pretty Good Privacy (PGP) is an encryption system used for both sending encrypted ...

32,103 1       TUTORIAL ENCRYPTION DECRYPTION PGP GPG


  Must-Have Tech for Your Living Room

The living room is considered by many to be the central point of the home. Therefore, it makes sense that you would want to equip it with lots of enhancements to make it more relaxing and a great place for entertaining yourself, members of your family or household, and any guests. With so many different technological advancements over the last couple of decades, though, you might be stuck as to what you should pick and what would fit in with your lifestyle.To help you out a little, we have put together a list of some of the best pieces of tech you should consider investing in for your living r...

2,917 0       SMART HOME RADIO


  WireGuard VPN: Setup WG_VPN client App on Android phone and connect to local WG_VPN server on VM

We will show the detail steps about how to setup the WireGuard VPN client on an Android phone/pad and configure the VPN client to connect a WG_VPN server in local network. The setup process contents three main steps:Install WireGuard and create a key-pair in WireGuard client.Add the Android client peer information in the WireGuard server’s config file.Config the Android WireGuard client to connect to the server.The test environment network configuration: Step 1. Install WireGuard App and create a key-pair in WireGuard client.Open the Android phone/pad Google App Play Store and searc...

3,816 0       TUTORIAL VPN WIREGUARD


  Generate signed certificate from CSR in Java

In our previous tutorial, we have explained how to generate CSR which can be sent to CA for generating a signed certificate. In this tutorial, we will explain how to generate the signed certificate from CSR in Java. We will not use an actual CA but a self-signed certificate to act as a CA certificate.Since the CSR contains the subject information where a certificate needs to be generated and signed for. The key here is to extract the subject information from the CSR and then set it as the subject of the newly generated certificate.The source code can be found below which has a complete example...

7,420 10       SIGN CERTIFICATE CSR JAVA


  Create customized GitHub profile page

How long have you been using GitHub? Have you ever wondered whether one can customize his profile page with some fancy looking? Indeed GitHub allows developers to customize profile page through a secret repository.The secret is to create a repository with the same name as your GitHub username. And you will be granted into the work of customizing your own profile page. In this post, we will show a simple walk through on how to create it.Create secret repositoryAs indicated by the term secret repository, it indicates the repository name will be a bit special. You are right, it should be the same...

5,382 0       SECRET REPOSITORY CUSTOMIZED PROFILE GITHUB


  Understand more about Go basics with one interview question

First, let's take a look at below Go interview question:package mainconst s = "Go101.org"// len(s) == 9// 1 << 9 == 512// 512 / 128 == 4var a byte = 1 << len(s) / 128var b byte = 1 << len(s[:]) / 128func main() { println(a, b)}What would be the output in your mind? The output would be 4 0. Surprising?Before getting to the output values, some concepts in Go need to be introduced and explained in more detail.len() len() is a built-in function in Go to get the length of array, slice or string. There is one important statement about len() in Go specification.For some argume...

3,901 0       LEN() SHIFT OPERATION CONSTANT GOLANG