Skip to content

Instantly share code, notes, and snippets.

View up1's full-sized avatar

Somkiat Puisungnoen up1

View GitHub Profile
@dome
dome / nginx.conf
Created August 23, 2024 05:20
nginx proxy evm rpc
user nginx;
worker_processes auto;
error_log /dev/stderr warn;
pid /var/run/nginx.pid;
worker_rlimit_nofile 100000;
events {
worker_connections 102400;
@winggundamth
winggundamth / vault-init.sh
Created October 17, 2022 04:26
Vault Init Bash Shell to put in postStart for Vault Helm Chart to initial Vault HA Cluster on Kubernetes. This will upload root token and unseal key to MinIO or S3 compatibility storage.
#!/bin/sh
cd /home/vault
if [[ ! -f jq ]]
then
echo "Download jq command..."
wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 -O jq
chmod +x jq
fi
@ThabetAmer
ThabetAmer / docker-compose.yml
Last active May 28, 2024 00:01
Run SonarQube and SonarScanner in Docker-compose
#
# Based on https://hub.docker.com/_/sonarqube
#
version: "3.7"
services:
sonarqube:
container_name: sonarqube
@githubteacher
githubteacher / git-understanding-qs.md
Created November 13, 2019 15:27
Questions to check your understanding of some Git and GitHub concepts.

Beginner: Check for understanding

  1. (multiple answer) Git is:

    • a. A version control system
    • b. Centralized
    • c. Distributed
    • d. The same as GitHub
  2. (T/F) Git and GitHub are the same thing.

@dtinth
dtinth / README.md
Created August 13, 2019 12:59
Transcribing Thai YouTube video using Google Cloud

How to transcribe Thai speech in videos into text.

Requirements

@dalegaspi
dalegaspi / spring_boot_zuul_finchley.md
Last active April 8, 2020 09:20
Spring Boot + Zuul Finchley Notes

Preface

Listen, if you want to use Zuul, the easiest path is just use the Spring Boot version. I'm not exactly a fan of Spring in general, but this is the only solution available that's the least painful. Recent release of Spring Cloud Gateway looks promising but I'm satisfied so far with Spring Boot + Zuul that I'm not that interested in evaluating Spring Cloud Gateway,

We are also talking about Zuul 1.x here. Zuul 2.x is a whole can of worms I'd rather not rant about here.

This applies to Finchley (2.x) from SR1 release (may apply to other releases but not guaranteed)

  • Re: using logback. The documentation says it's recommended to use logback-spring.xml in your classpath, but it doesn't work. You should actually use logback.xml or your logging configuration is not recognized at all. While at the subject, it is recommended not to use asynchronous logging at all. U
@iCyLand
iCyLand / w3c.conf
Last active April 18, 2022 15:25
W3C json log format for nginx
## this GeoIP dat file relate on centos environment please change to your OS path
geoip_country /usr/share/GeoIP/GeoIP-initial.dat;
map $request_uri $request_uri_path {
"~^(?P<path>[^?]*)(\?.*)?$" $path;
}
map $upstream_response_time $new_upstream_response_time {
default $upstream_response_time;
'' null;
@dstroot
dstroot / handlers.go
Last active April 10, 2023 13:22 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"io"
"net/http"
"sync/atomic"
)
func index() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@enricofoltran
enricofoltran / main.go
Last active October 3, 2024 14:08
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@posener
posener / go-shebang-story.md
Last active October 18, 2024 01:42
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.