Skip to content

Instantly share code, notes, and snippets.

View 134130's full-sized avatar

JiHwan Oh 134130

View GitHub Profile
@iwanhae
iwanhae / main.go
Created November 5, 2023 06:51
Kubernetes API Audit PoC
package main
import (
"compress/gzip"
"context"
"crypto/tls"
"errors"
"fmt"
"io"
"log"
@ptc-mrucci
ptc-mrucci / unit.sh
Last active July 2, 2025 00:12 — forked from tvlooy/unit.sh
Bash test: get the directory of a script
#!/bin/bash
python3 --version || { echo "ERROR: Missing python3"; exit 1; }
tmp=$(python3 -c "import os, sys; print(os.path.realpath('/tmp'))")
function test {
MESSAGE=$1
RECEIVED=$2
EXPECTED=$3
@m-radzikowski
m-radzikowski / script-template.sh
Last active July 20, 2025 04:54
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@latant
latant / rmi-example.kt
Created March 9, 2020 22:59
An example using Java RMI with Kotlin
import java.io.Serializable
import java.rmi.Remote
import java.rmi.RemoteException
import java.rmi.registry.LocateRegistry
import java.rmi.server.UnicastRemoteObject
class Person(val name: String, val age: Int): Serializable
interface HelloService : Remote {
@Throws(RemoteException::class)
@kaleksandrov
kaleksandrov / global-protect.sh
Last active June 24, 2025 19:19
Simple script that starts and stops GlobalProtect.app on Mac OSX.
#!/bin/bash
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
case $1 in
start)