Skip to content

Instantly share code, notes, and snippets.

View ionelmc's full-sized avatar
🙃
wat

Ionel Cristian Mărieș ionelmc

🙃
wat
View GitHub Profile
"""Example usage:
In [1]: !cat ayy.s
.text
.global _start
.type _start, @function
_start:
movq $10, %rdx
pushw $10
@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@manojpandey
manojpandey / gotchas.md
Last active August 31, 2021 14:52
Attack of Pythons

Attack of Pythons

Among computer programmers, a “gotcha” has become a term for a feature of a programming language that is likely to play tricks on you to display behavior that is different than what you expect.

Just as a fly or a mosquito can “bite” you, we say that a gotcha can “bite” you. So, let's proceed to examine some of Python's gotchas !

alt text


@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Build a pip-compatible sdist for the flit package in the current directory.
"""
import flit, zipfile, os.path
def build_sdist():
# build wheel
@CAFxX
CAFxX / persistent_pipes_linux.md
Last active January 4, 2024 04:32
Persistent pipes/circular buffers for Linux

📂 Persistent "pipes" in Linux

In a project I'm working on I ran into the requirement of having some sort of persistent FIFO buffer or pipe in Linux, i.e. something file-like that could accept writes from a process and persist it to disk until a second process reads (and acknowledges) it. The persistence should be both across process restarts as well as OS restarts.

AFAICT unfortunately in the Linux world such a primitive does not exist (named pipes/FIFOs do not persist

@paulirish
paulirish / bling.js
Last active May 1, 2024 19:56
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@chernjie
chernjie / git-gh-setup.sh
Created February 9, 2015 09:25
Fetch Github's Pull Request as a remote branch
#!/usr/bin/env bash
git remote -v | grep fetch | grep github | \
while read remote url _; do
if ! git config --get-all "remote.$remote.fetch" | grep -q refs/pull
then
git config --add "remote.$remote.fetch" \
'+refs/pull/*/head:refs/remotes/'"$remote"'/pull/*'
fi
done
@markshannon
markshannon / dynattr.py
Created November 30, 2014 22:06
Dynamic attribute module
import sys
import warnings
from types import ModuleType
from importlib import import_module
try:
basestring
except NameError:
basestring = str
@dutc
dutc / Makefile
Last active September 27, 2023 04:40
function hooking in C
.PHONY: hook
CC=gcc -std=c99 -Wall
hook: hook-main hook-preload.so
./hook-main
LD_PRELOAD=./hook-preload.so ./hook-main
hook-main: hook-main.c
${CC} -O0 -Wl,--export-dynamic -g -ggdb -o $@ $^ -ldl