Skip to content

Instantly share code, notes, and snippets.

@poyynt
poyynt / dirctx.zsh
Created December 26, 2025 11:25
DirCtx: directory-based context for zsh
function _dirctx_hook() {
local curp="$(pwd)"
local oldp="$OLDPWD"
if [[ $curp = $oldp/* ]] || ([ $curp = $oldp ] && [ ! -n "${DIRCTX_ACTIVE}" ]); then
if [ -e "${curp}/.dirctx-enter" ]; then
source "${curp}/.dirctx-enter";
fi
else
if [ -e "${oldp}/.dirctx-exit" ] && [ -n "${DIRCTX_ACTIVE}" ]; then
source "${oldp}/.dirctx-exit";
@poyynt
poyynt / linux-nasm-sync-then-shutdown.asm
Created May 4, 2021 09:35
NASM program to sync filesystems and shutdown linux.
global _start
section .text
_start:
mov eax, 0xa2 ; sync syscall.
syscall
mov edx, 0x4321fedc ; LINUX_REBOOT_CMD_POWER_OFF: Stop OS and remove all power from system, if possible. Refer to linux/reboot.h for other possible values.
mov esi, 0x28121969 ; LINUX_REBOOT_MAGIC_2.
mov edi, 0xfee1dead ; LINUX_REBOOT_MAGIC_1.
mov eax, 0xa9 ; reboot syscall.
@poyynt
poyynt / alles_hello.py
Last active July 24, 2020 21:01
something for alles
from flask import Flask, request
from requests import post, get
import json
app = Flask(__name__)
CALLBACK = "https://localhost:2345/callback"
@app.route("/")

Keybase proof

I hereby claim:

  • I am poyynt on github.
  • I am poyynt (https://keybase.io/poyynt) on keybase.
  • I have a public key ASCqij_q_2tcUkFlDTizdJQOQCEaJtwhQiTwn76CdLT1cgo

To claim this, I am signing this object:

@poyynt
poyynt / passgenerator.cpp
Last active March 7, 2020 17:23
simple bulk password generator
#include <iostream>
#include <string>
#include <vector>
#include <random>
#include <fstream>
using namespace std;
const string ASCII_LOWERCASE = "qwertyuiopasdfghjklzxcvbnm";
const string ASCII_UPPERCASE = "QWERTYUIOPASDFGHJKLZXCVBNM";
@poyynt
poyynt / white.space
Created March 2, 2020 19:00
Whitespace character