Skip to content

Instantly share code, notes, and snippets.

View yohangdev's full-sized avatar
🏠
Working from home

Yoga Hanggara yohangdev

🏠
Working from home
View GitHub Profile
@yohangdev
yohangdev / README.md
Created February 25, 2025 17:39 — forked from marshyon/README.md
Golang Echo web server VueJS App in history mode and Go web services

Golang Echo web server VueJS App in history mode and Go web services

In an previous gist a VueJS application was served using a plain net/http server.

This version uses the Echo web server framework and adds the diversion of any '404' (page not found) errors to the index.html page of the VueJS application. With this enabled, any VueJS routed URLs that are 'bookmarked' by a user will be sent to the index.html of the VueJS application. This way 'routing' is passed to the single page app running on the clients browser.

@yohangdev
yohangdev / aws-s3-bulk-metadata.sh
Created February 19, 2024 16:40
AWS S3 Bulk Update Metadata using Command Line (CLI)
aws s3 cp \
s3://bucket/path/ \
s3://bucket/path/ \
--exclude '*' \
--include '*.png' \
--no-guess-mime-type \
--content-type="image/png" \
--metadata-directive="REPLACE" \
--recursive
@yohangdev
yohangdev / xdebug-mac.md
Created October 14, 2023 11:11 — forked from ankurk91/xdebug-mac.md
php xDebug v3 on Ubuntu/Mac and phpStorm

🪲 Install and Configure xDebug v3 on MacOS for PhpStorm 🐘

  • Assuming that you have already installed php and apache via Homebrew

  • Install xDebug php extension

pecl channel-update pecl.php.net
pecl clear-cache

pecl install xdebug
@yohangdev
yohangdev / download_playlist.sh
Created May 28, 2022 03:03
Youtube Downloader Batch (Also Convert)
yt-dlp --download-archive archive.txt --no-abort-on-error --exec "ffmpeg -i {} -target pal-dvd -q:v 20 -aspect 16:9 -y {}.mpg && rm {}" https://www.youtube.com/playlist?list=xxxx
@yohangdev
yohangdev / benchmark.sh
Created December 27, 2021 13:46
CLI commands for benchmarking linux servers
# https://bench.sh
curl -Lso- bench.sh | bash
# https://github.com/masonr/yet-another-bench-script
curl -sL yabs.sh | bash
# Ref
# https://repo.telematika.org/project/haydenjames_bench-scripts/
@yohangdev
yohangdev / helpful-docker-commands.sh
Created October 17, 2021 11:06 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@yohangdev
yohangdev / jcc-openapi-spec.yaml
Last active April 6, 2022 05:31
Jabar Coding Camp - Backend Challenge - API Specification
swagger: "2.0"
info:
description: "Ini adalah dokumentasi API Specification untuk challenge Get Nearby Places."
version: "1.0.0"
title: "Get Nearby Places"
host: "localhost:8000"
schemes:
- "http"
- "https"
paths:
@yohangdev
yohangdev / delete-evicted-pods-all-namespaces.sh
Last active December 26, 2021 15:49
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# https://github.com/kubernetes/kubernetes/issues/55051
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all stuck shutdown
kubectl get pods --all-namespaces | grep Shutdown | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
@yohangdev
yohangdev / BlastTemplate.txt
Last active July 11, 2021 16:27
AWS Lambda (Python 3.8 runtime) for bulk processing CSV file, processing message template with dynamic variables, then push message to AWS SQS
Hello {param1}
This is your invoice number {param2}
Total cost: {param3}
@yohangdev
yohangdev / datadog.sh
Created May 19, 2021 17:20
Datadog Cheatsheet
# Docker
docker run -d -v /var/run/docker.sock:/var/run/docker.sock:ro -v /proc/:/host/proc/:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -p 8126:8126 -e DD_API_KEY=XXX datadog/agent:latest
docker run -p 8080:8080 -e APP_KEY="base64:DehW3/DSAR0r4R+tEOuT8MUw/br98yVdOWHbaVh/qsk=" --rm -it -e CONTAINER_ROLE=app -e DD_AGENT_HOST=172.17.0.3 -e DD_SERVICE=test-service -e DD_ENV=production -e DD_VERSION=1.0.0 micro-datadog
# Kubernetes
# https://docs.datadoghq.com/agent/kubernetes/?tab=helm
helm install datadog-agent -f values.yaml datadog/datadog --set datadog.apiKey=XXX --set targetSystem=linux