Skip to content

Instantly share code, notes, and snippets.

@umutbasal
umutbasal / book.sh
Created January 29, 2024 15:49
pandoc md to pdf
pandoc -i p1hlafsis71j51eol1rjn12gd1v694.md -o podsuj.pdf --template=./eisvogel.latex -V book -V table-use-row-colors:true -V toc-own-page:true -V papersize:a5 -V fontsize="8pt" --listings --number-sections --highlight-style espresso --top-level-division=chapter -V classoption=oneside -V listings-no-page-break -V geometry:top=2cm -V geometry:bottom=2cm -V geometry:left=1cm -V geometry:right=1cm
Ali-CDN-Real-IP
CF-Connecting-IP
Cdn-Real-Ip
Cdn-Src-Ip
Client-IP
Fastly-Client-Ip
Forwarded
Forwarded-For
Proxy-Client-IP
True-Client-IP
@umutbasal
umutbasal / m1cat.c
Created March 26, 2023 05:45 — forked from marcan/m1cat.c
m1cat: a PoC for the M1RACLES covert channel vulnerability in the Apple M1
/*
* m1cat: a proof of concept for the M1RACLES vulnerability in the Apple M1.
*
* This program implements a covert channel that can be used to transmit data
* between two processes when run on the Apple Silicon "M1" CPUs.
*
* The channel is slightly lossy due to (presumably) the scheduler sometimes
* scheduling us on the wrong CPU cluster, so this PoC sends every byte twice
* together with some metadata/framing bits, which is usually good enough.
* A better approach would be to use proper FEC or something like that.
kubectl get pods -A -o json | jq -r '.items[] | "\(.metadata.name) \(.metadata.namespace) \(.spec.containers[]?.ports[]?.containerPort)"' | awk '{print $1"."$2".svc.cluster.local:"$3}' | grep -v null
kubectl get svc -A -o json | jq -r '.items[] | "\(.metadata.name) \(.metadata.namespace) \(.spec.ports[]?.port)"' | awk '{print $1"."$2".svc.cluster.local:"$3}' | grep -v null
kubectl get endpoints -A -o json | jq -r '.items[] | "\(.metadata.name) \(.metadata.namespace) \(.subsets[]?.ports[]?.port)"' | awk '{print $1"."$2".svc.cluster.local:"$3}' | grep -v null
gh repo list myorgname --limit 1000 | while read -r repo _; do
gh repo clone "$repo" "$repo" -- -q 2>/dev/null || (
cd "$repo"
git checkout -q main 2>/dev/null || true
git checkout -q master 2>/dev/null || true
git pull -q
)
done
const axios = require('axios');
const url = "https://www.mediaserver.express/"
const rtmp = "rtmp://ingest.mediaserver.express/live/"
const player = "https://www.mediaserver.express/v/"
const hls = "https://www.mediaserver.express/live/streamId/index.m3u8"
const ffmpegTest = "ffmpeg -r 30 -f lavfi -i testsrc -vf scale=1280:960 -vcodec libx264 -profile:v baseline -pix_fmt yuv420p -f flv"
const serializeStream = (streamkey) => {
let streamId = streamkey.split("?")[0];
const problem = {
operators: {
has: (possibility, numbers, has) => possibility.reduce((acc, cur) => numbers.includes(cur) ? acc + 1 : acc, 0) === has,
rightPlace: (possibility, numbers) => possibility.some(x => possibility.indexOf(x) === numbers.indexOf(x)),
},
possibilities: Array.from(Array(1000).keys()).map(x => x.toString().padStart(3, '0').split('').map(x => parseInt(x))),
sets: [
{ numbers: [6, 9, 0], has: 1, rightPlace: true }, // One number is correct and right place
{ numbers: [7, 4, 1], has: 1, rightPlace: false }, // One number is correct but wrong place
{ numbers: [5, 0, 4], has: 2, rightPlace: false }, // Two numbers are correct but wrong place
@umutbasal
umutbasal / bionic_read.js
Created May 21, 2022 18:13
bookmark for bionic reading
javascript:(()=>{let e,t=document.getElementsByTagName("p"),n=document.getElementsByTagName("font");e=t.length>n.length?t:n;var o=document.createElement("style");o.textContent="b { font-weight: bold; !important }",document.head.appendChild(o);for(let t of e){const e=t.innerText.split(" ").map((e=>{const t=e.length,n=Math.round(t/2);return`<b>${e.slice(0,n)}</b>${e.slice(n)}`}));t.innerHTML=e.join(" ")}})();
@umutbasal
umutbasal / prefixer.go
Last active May 8, 2022 02:45
prefixing with tty colors
package main
import (
"io"
"log"
"os"
"os/exec"
"os/signal"
"syscall"