Skip to content

Instantly share code, notes, and snippets.

View spacelatte's full-sized avatar
🤔
0x727E3A21F2

Mert Akengin spacelatte

🤔
0x727E3A21F2
View GitHub Profile
@spacelatte
spacelatte / main.c
Last active July 25, 2020 14:23
send & receive #pipe pair example in #c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <time.h>
#include "pipe.h"
{
"rules": [
{
"description": "Change caps_lock key to command+control+option+shift if pressed with other keys",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": {
"optional": [
'use strict';
/*
window (right-hand)
kbd-focused
under-mouse
screen (left-hand)
#!/usr/bin/env -S docker-compose -p kafka -f
version: "3.5"
networks:
default:
driver: bridge
internal: false
external: false
@spacelatte
spacelatte / bash.build.sh
Last active October 26, 2023 21:49
#bash #build #install #auto #script #compile #source
#!/usr/bin/env bash
set -eo pipefail
# 5.0.18
# 5.1.16
# 5.2.15
VERSION="${1:-5.2.15}"
#!/usr/bin/env python3
# coding: utf-8
import sys, time, uuid, random, threading, multiprocessing
def process(thread, gen, res, ch=[ "foo", "bar" ], dly=0.1):
print("[GO] Thread:", thread)
while gen:
try:
res[str(next(gen))] = random.choice(ch)
@spacelatte
spacelatte / proxy.pac
Last active September 7, 2020 07:39
proxy pac wpad auto config file
function FindProxyForURL(url, host) {
if(false
|| shExpMatch(host, "*iyz*")
|| shExpMatch(host, "*.vpn")
|| shExpMatch(host, "*.ssh")
|| shExpMatch(host, "*.nip.io")
|| shExpMatch(host, "*imgur.com")
|| shExpMatch(host, "*.wtfismyip.com")
|| shExpMatch(host, "*hopperapp.com")
|| shExpMatch(host, "*wikileaks.org")
@spacelatte
spacelatte / thermal.py
Created October 23, 2019 08:07
#pylepton #lepton #python #thermal #camera
#!/usr/bin/env python
import sys, time, socket, pylepton, numpy, cv2
TYPE = numpy.uint8
TARGET = ("224.0.0.1", 1234)
FRAMERATE = 25
def main(args):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
#!/usr/bin/env bash
ORIG=$PWD
TEMP=$(mktemp -d)
curl -#L "https://www.ibiblio.org/pub/linux/games/amusements/fortune/fortune-mod-9708.tar.gz" \
| tar --strip=1 -C "${TEMP}" -ox
sed -i '' 's%/usr/local/games%/usr/local/bin%g' "${TEMP}/Makefile"
sed -i '' 's%/usr/local%$(PREFIX)%g' "${TEMP}/Makefile"
async function fn() {
let split = (await fetch("").then(x => x.text())).split("-")
return (await fetch("", {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ answer: JSON.parse(split[0].replace(/'/g, '"')).map(x => isNaN(parseInt(x)) ? x : parseInt(x)).sort((a, b) => ((typeof(a) === typeof(b)) ? ((a === b) ? 0 : ((a > b) ? +1 : -1)) : ((split[2].search("Number") > 0) ? ((typeof(a) === "number") ? -1 : +1) : ((typeof(a) === "string") ? -1 : +1)))), }),
}).then(x => x.text()).then(x => (x.search("STMCTF") >= 0) ? alert(x) : x))
}