Skip to content

Instantly share code, notes, and snippets.

View niepiekm's full-sized avatar

Marek Niepiekło niepiekm

View GitHub Profile
@viega
viega / defer.h
Created March 20, 2025 01:58
A C implementation of defer using `goto`
// defer.h
// [email protected]
// © 2025 Crash Override, Inc.
// Licensed under the BSD 3-Clause license
#pragma once
#include <stdint.h>
typedef struct n00b_defer_ll_t n00b_defer_ll_t;
@ngxson
ngxson / FAQ.md
Last active April 11, 2025 16:27
convert ARM NEON to WASM SIMD prompt

Why did you do this?

Relax, I only have one Sunday to work on idea, literally my weekend project. So I tried Deepseek to see if it can help. Surprisingly, it works and it saves me another weekend...

What is your setup?

Just chat.deepseek.com (cost = free) with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

This is from man bash:

A pipeline is a sequence of one or more commands separated by one of the control operators | or |&. The format for a pipeline is:

[ time [ -p ]] [ ! ] command [ [ | | |& ] command2 ... ]

This is the only place in which ! can appear. It never prefixes commands, it prefixes pipelines.

@timothyham
timothyham / ipv6guide.md
Last active April 17, 2025 04:55
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@throwaway96
throwaway96 / webos-notes.md
Last active February 23, 2025 11:48
Notes about webOS stuff

Debugging apps (inspect)

Inspectability

Developer mode apps (those installed in /media/developer) are inspectable by default. Other apps (e.g., from the LG Content Store) are not inspectable by default, but you can add "inspectable": true to their appinfo.json to enable it. Debugging system apps (i.e., those in /usr/palm/applications) may require a special flag.

Ports

The developer mode app debugger listens on port 9998.

System service and system app debugging uses ports 5885 and 9999, respectively. However, debugging for these is not normally enabled.

Inspecting an app

C/C++ performance pitfall: int8_t, aliasing and the ways out

When I was working on a generic port of Google's hashmap to C, I wrote a function that (ignoring irrelevant parts) looked like this:

typedef struct {
    uint8_t *bytes;
    size_t len;
} bytebuf;
@kconner
kconner / macOS Internals.md
Last active April 18, 2025 00:52
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@buahaha
buahaha / httrack_manual.md
Created February 19, 2023 04:11
Httrack manual, kept here because I can't on my website, https://nutek.neosb.net

Httrack Users Guide (3.10)

By Fred Cohen


Background and Introduction

I started using httrack in mid-2000 and found it to be an excellent tool for imaging web sites. Various words are used to describe this process -

@throwaway96
throwaway96 / crashd.md
Last active April 17, 2025 21:19
crashd instructions

News

EOL (2024-07-21)

I'm not going to be maintaining this document anymore. I'm leaving it as-is since much of the FAQ section is still accurate and has yet to be incorporated into other resources.

Use CanI.RootMy.TV to find an exploit for your TV.

New exploit for webOS 3.5+: DejaVuln (2024-04-21)

@niepiekm
niepiekm / _gitconfig
Last active September 15, 2023 09:29
[user]
name = Marek Niepieklo
email = [email protected]
[alias]
alias = "!f() {[ $# = 2 ] && git config --global alias.\"$1\" \"$2\" && exit 0 || echo \"usage: git alias <new alias> <original command>\" >&2 && exit 1}; f"
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
amend = commit --amend -m