Skip to content

Instantly share code, notes, and snippets.

View rnkoaa's full-sized avatar

Richard Agyei rnkoaa

View GitHub Profile
@salkin-mada
salkin-mada / plugins.lua
Created October 26, 2020 11:54
using packer.nvim
-- check if packer is installed (~/local/share/nvim/site/pack)
local packer_exists = pcall(vim.cmd, [[packadd packer.nvim]])
if not packer_exists then
if vim.fn.input("Hent packer.nvim? (y for yada)") ~= "y" then
return
end
local directory = string.format(
'%s/site/pack/packer/opt/',
@youribonnaffe
youribonnaffe / RecordTest.java
Last active December 21, 2020 13:15
Java 14 Record (JEP 359) deserialization with Jackson
package com.github.youribonnaffe.jackson;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
@akhenakh
akhenakh / app.yaml
Last active March 4, 2023 19:22
Example of graceful shutdown with grpc healthserver * httpserver
readinessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 1
livenessProbe:
exec:
command: ["/root/grpc_health_probe", "-addr=:6666"]
initialDelaySeconds: 2
imagePullPolicy: IfNotPresent
@mimoo
mimoo / compress_tar_gzip.go
Last active March 5, 2024 03:53
How to compress a folder in Golang using tar and gzip (works with nested folders)
package main
import (
"archive/tar"
"bytes"
"compress/gzip"
"fmt"
"io"
"os"
"path/filepath"
@dtodt
dtodt / Retry.java
Last active February 23, 2023 18:18
Retrofit2@2.5.0 - Retry Adapter Factory - Call & CompletableFuture
package com.company.retrofit2.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
@pgilad
pgilad / Dockerfile
Last active March 18, 2024 04:37
Minimal Spring Boot 2 on Docker Alpine with Java 11 (Using Jigsaw modules)
FROM alpine:3.8 AS builder
WORKDIR /opt
ARG JDK_TAR=openjdk-11+28_linux-x64-musl_bin.tar.gz
ARG JDK_DOWNLOAD_PREFIX=https://download.java.net/java/early_access/alpine/28/binaries
RUN wget -q "$JDK_DOWNLOAD_PREFIX/$JDK_TAR" && \
wget -q "$JDK_DOWNLOAD_PREFIX/$JDK_TAR.sha256"
RUN cat $JDK_TAR.sha256 | xargs -I{} echo "{} $JDK_TAR" | sha256sum -c - && \
@zupzup
zupzup / main.go
Created September 15, 2018 14:17
Log deletion script for ELK-stack logs written in Go
package main
import (
"context"
"flag"
log "github.com/sirupsen/logrus"
"gopkg.in/olivere/elastic.v6"
"os"
"strings"
"time"

Creating StorageClass with NFS Client Provisioner

We already have an NFS server so the next step is to install NFS client as a StorageClass. We'll use kubernetes nfs-client-provisioner.

Since the provisioner will need to interact with Kube API and we have RBAC enabled, the first step is to create a ServiceAccount.

curl https://raw.githubusercontent.com/kubernetes-incubator/external-storage/master/nfs-client/deploy/auth/serviceaccount.yaml
@penglongli
penglongli / deep_copy.go
Last active March 29, 2023 09:32
golang deep-copy interface with reflect
package main
import (
"reflect"
"fmt"
)
type Cloneable interface {
Clone(inter interface{}) interface{}
}
@lucasjellema
lucasjellema / docker-compose.yml
Created May 22, 2018 04:57
Docker Compose file for Apache Kafka, the Confluent Platform (4.1.0) - with Kafka Connect, Kafka Manager, Schema Registry and KSQL (1.0) - assuming a Docker Host accessible at 192.168.188.102
version: '2'
services:
zookeeper:
image: "confluentinc/cp-zookeeper:4.1.0"
hostname: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181