Skip to content

Instantly share code, notes, and snippets.

View un4ckn0wl3z's full-sized avatar
🖕
An idiot admires complexity; a genius admires simplicity

Anuwat Khongchuai un4ckn0wl3z

🖕
An idiot admires complexity; a genius admires simplicity
View GitHub Profile
@noemi-dresden
noemi-dresden / docker-compose.yml
Created March 28, 2019 19:44
Complete compose file for monitoring spark on prometheus
version: "3.1"
services:
spark-master:
image: bde2020/spark-master:2.4.0-hadoop2.7
container_name: spark-master
ports:
- "8080:8080"
- "7077:7077"
environment:
- INIT_DAEMON_STEP=setup_spark
@NtRaiseHardError
NtRaiseHardError / ClipboardMonitor.c
Last active May 31, 2020 07:13
PoC code to demonstrate clipboard monitoring in Windows using an event-based listener.
// PoC code to demonstrate clipboard monitoring in Windows
// using an event-based listener.
#include <stdio.h>
#include <Windows.h>
#define CLASS_NAME L"MY_CLASS"
#define WINDOW_NAME L"MY_WINDOW"
LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
HANDLE hClipData = NULL;
@binura-g
binura-g / single-line-cert.sh
Last active May 2, 2024 06:52
Convert Certificates ( .pem, / .crt / etc ) into single-line strings for JSON payloads
awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert-name.pem
@isaurssaurav
isaurssaurav / minikubeportforwarding
Last active January 18, 2023 18:04
Port forwarding of VM (minikube) to host machine
The ssh way
Assuming that you have ssh on your ubuntu box.
Minikube user: docker password: tcuser
First run kubectl proxy & to expose the dashboard on http://localhost:8001
Then expose the dashboard using ssh's port forwarding, executing:
ssh -R 30000:127.0.0.1:8001 $USER@192.168.0.20
@jonluca
jonluca / NintendoSystemVersionTable.csv
Last active April 10, 2023 03:04
Nintendo Switch Fuse Blown Count
System version Expected number of burnt fuses (retail) Expected number of burnt fuses (non-retail)
1.0.0 1 0
2.0.0-2.3.0 2 0
3.0.0 3 1
3.0.1-3.0.2 4 1
4.0.0-4.1.0 5 1
5.0.0-5.1.0 6 1
6.0.0-6.1.0 7 1
6.2.0 8 1
7.0.0-8.0.1 9 1
@pjobson
pjobson / MKVToolNix_notes.md
Last active January 31, 2023 13:06
Notes for creating, editing, and extracting MKV files.

MKVToolNix Notes

Various notes for using MKVToolNix.

Probe a Video

mkvinfo lists all elements contained in an MKV container file.

mkvinfo container.mkv
@iMartyn
iMartyn / mini-port-forward.bash
Created December 20, 2017 17:34
Port-forward minikube ports to localhost ports
#!/bin/bash
MINIKUBE_IP=$(minikube ip)
MINIKUBE_KEY_LOCATION=${HOME}/.minikube/machines/minikube/id_rsa
STARTING_PORT=8080
CURRENT_PORT=${STARTING_PORT}
for servicename in $*; do
HIGH_PORT=$(kubectl get svc ${servicename} -o custom-columns=':spec.ports[*].nodePort' | tail -n1)
if echo $HIGH_PORT | grep -q ,; then
@hfiref0x
hfiref0x / inject.c
Last active May 31, 2023 16:23
Process Doppelgänging
//
// Ref = src
// https://www.blackhat.com/docs/eu-17/materials/eu-17-Liberman-Lost-In-Transaction-Process-Doppelganging.pdf
//
// Credits:
// Vyacheslav Rusakov @swwwolf
// Tom Bonner @thomas_bonner
//
#include <Windows.h>
@ViRb3
ViRb3 / OpenVPN Internet Proxy Windows.md
Last active April 18, 2024 16:04
Create an OpenVPN Windows server that proxies internet traffic
Tested on Windows 10 x64, Anniversary Update
17.09.2017

Set up OpenVPN

  1. Set up an OpenVPN connection following this guide

  2. Generate a TA key and place it in the same folder as the other certificates/keys:

@ernsheong
ernsheong / ropc_kong.md
Last active August 25, 2021 07:37
Implementing OAuth2 Resource Owner Password Credentials Grant with Kong

Implementing OAuth2 Resource Owner Password Credentials Grant with Kong

The documentation is okay, but it has some holes, and I had to read it many many times and play with the API myself to "get it" in terms of implementation. So here is a guide that I hope will help someone along the way.

DISCLAIMER: This is by no means the canonical or the most secure way to do this. Below are my findings upon my reading of the docs and the spec. But I might be wrong, very wrong.

This gist is meant to complement the documentation in https://getkong.org/plugins/oauth2-authentication/.

The Resource Owner Password Credentials Grant makes sense if we want to authenticate users who are using our trusted 1st party applications of our own service. (However, you might not want to trust your JavaScript SPA with your refresh token, and maybe you need to store that refresh token in the server on behalf of the SPA if you are paranoid about security. Disclaimer: I am not a security expert)