Skip to content

Instantly share code, notes, and snippets.

View prashant-shahi's full-sized avatar
:shipit:
Working remotely

Prashant Shahi prashant-shahi

:shipit:
Working remotely
View GitHub Profile
@prashant-shahi
prashant-shahi / main.go
Created April 24, 2024 14:04
Example clickhouse DNS strings and how it is parsed
package main
import (
"fmt"
"net/url"
"strings"
)
func main() {
dsnStrings := []string{
@prashant-shahi
prashant-shahi / main.go
Created March 11, 2024 06:25
Array sum using Loop, Goroutines and Recursion in Go
package main
import "fmt"
const (
BATCH_COUNT = 5
)
func loopSum(s []int) int {
sum := 0
@prashant-shahi
prashant-shahi / index.md
Created March 11, 2024 05:29
Time zones available in Go (Linux)

Time zones available in Golang

  • Retrieving time zones from : /usr/share/zoneinfo/
  • OS : linux
  • Total timezone ids : 608
GMT+00:00 Africa/Abidjan
GMT+00:00 Africa/Accra
GMT+03:00 Africa/Addis_Ababa
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script>
L_NO_TOUCH = false;
L_DISABLE_3D = false;
</script>

SigNoz Dashboards for Monitoring Kubernetes

Dashboard URL
PVC Metrics [kubernetes-pvc-metrics.json][1]
Pods Metrics (Overall) [kubernetes-pod-metrics-overall.json][2]
Pods Metrics (Detailed) [kubernetes-pod-metrics-detailed.json][3]
Node Metrics (Overall) [kubernetes-node-metrics-overall.json][4]
Node Metrics (Detailed) [kubernetes-node-metrics-detailed.json][5]
@prashant-shahi
prashant-shahi / main.go
Created January 17, 2024 08:58
kebab casing string for valid URL paths in Golang
package main
import (
"fmt"
"regexp"
"strings"
)
func toKebabCase(s string) string {
// Regular expression to match non-alphanumeric characters
@prashant-shahi
prashant-shahi / gist:2efb55e97cd4c6226c1789ca7b56765b
Created January 11, 2024 12:10 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
#!/usr/bin/env bash
# require: git version > 2.3
# require: `db/letsencrypt` existed in git repo
if [[ -z "$CERTBOT_DOMAIN" ]] || [[ -z "$CERTBOT_VALIDATION" ]]; then
echo '$CERTBOT_DOMAIN and $CERTBOT_VALIDATION environment variables required.'
fi
source /etc/letsencrypt/dns-auth.conf
@prashant-shahi
prashant-shahi / nginx.conf
Created July 8, 2023 19:13 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@prashant-shahi
prashant-shahi / SimpleHttpServer.java
Created June 5, 2023 10:07
Simple HTTP Server in Java
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
public class SimpleHttpServer {
public static void main(String[] args) throws IOException {