Skip to content

Instantly share code, notes, and snippets.

View Thanajade's full-sized avatar

Thanajade Dechananthachai Thanajade

View GitHub Profile
@nik-sta
nik-sta / build_application.sh
Last active July 5, 2022 06:27
Production-ready Application Build Bash Script for layered Spring Boot Applications
#!/bin/sh
JAR_FILE=application.jar
if [ ! -f "$JAR_FILE" ]; then
echo "build.error: application jar is missing!"
exit 1
fi
jar xf application.jar
REQUIRED_JAVA_MODULES="$(jdeps \
@nik-sta
nik-sta / run_application.sh
Last active July 3, 2023 17:16
Production-ready Entrypoint Bash Script for layered Spring Boot Applications
#!/bin/bash
JAVA_OPTS="${JAVA_OPTS:="-Dfile.encoding=UTF-8 -Duser.timezone=UTC -XX:NativeMemoryTracking=summary -XX:+HeapDumpOnOutOfMemoryError"}"
PORT="${PORT:="8080"}"
term_handler() {
if [ $pid -ne 0 ]; then
kill -SIGTERM "$pid"
wait "$pid"
fi
@nik-sta
nik-sta / Dockerfile
Last active May 10, 2023 13:21
Layered Production-ready Dockerfile for Spring Boot Applications
# Making here use of a docker multi-stage build
# https://docs.docker.com/build/building/multi-stage/
# Build-time container
FROM azul/zulu-openjdk-alpine:17.0.7 as builder
ARG JAR_FILE
WORKDIR application
COPY $JAR_FILE application.jar
COPY build_application.sh ./
RUN sh build_application.sh
@KamalakannanRM
KamalakannanRM / sonarq.nginx.conf
Created November 29, 2019 13:57
SonarQube reverse proxy through Nginx with SSL
ssl_certificate /etc/nginx/ssl/sonar.domain.tld/cert.pem;
ssl_certificate_key /etc/nginx/ssl/sonar.domain.tld/privkey.pem;
upstream sonar {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
listen 80;
server_name sonar.domain.tld;
@ntamvl
ntamvl / install-multiple-jdk-on-macos-high-sierra.md
Last active February 19, 2025 16:29
Install Multiple Java Versions on macOS High Sierra

Install Multiple Java Versions on macOS High Sierra

Install Homebrew Cask

On Mac, Homebrew is the de-facto package manager, and Homebrew Cask is the app manager. I’m going to use Cask to install Java 7 and 8.

Install Homebrew Cask first if you haven’t:

brew update
brew tap caskroom/cask
@marcelmaatkamp
marcelmaatkamp / gist:123e8793e07a72a382d8d0e8d66bbd8f
Last active November 3, 2025 09:12
Fix Sonatype Nexus OrientDB
$ ls /opt/sonatype/sonatype-work/nexus3/db/
OSystem accesslog analytics audit component config model.properties security
$ docker-compose exec nexus java -jar ./lib/support/nexus-orient-console.jar
CONNECT PLOCAL:/opt/sonatype/sonatype-work/nexus3/db/component admin admin
REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
@leonardofed
leonardofed / README.md
Last active April 25, 2026 09:05
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@gorangajic
gorangajic / es6-spread-immutable-cheatsheet.md
Last active December 19, 2025 05:46
es6 spread immutable cheatsheet

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
@kristw
kristw / index.html
Last active January 25, 2025 12:14
Thailand map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Josefin+Slab|Arvo|Lato|Vollkorn|Abril+Fatface|Old+Standard+TT|Droid+Sans|Lobster|Inconsolata|Montserrat|Playfair+Display|Karla|Alegreya|Libre+Baskerville|Merriweather|Lora|Archivo+Narrow|Neuton|Signika|Questrial|Fjalla+One|Bitter|Varela+Round);
.background {
fill: #eee;
pointer-events: all;
}