Skip to content

Instantly share code, notes, and snippets.

View Earnestly's full-sized avatar

Earnestly

  • The Black Gate
View GitHub Profile
@Earnestly
Earnestly / posix-issue8.md
Last active April 22, 2024 09:13
A Selected List of Additions and Changes Coming With POSIX Issue 8

A Selected List of Additions and Changes Coming With POSIX Issue 8

Last major change: 10th March 2023

New Commands

Additions

@Earnestly
Earnestly / c99_ub_list.rst
Last active March 29, 2024 03:52
C99 List of Undefined Behavior (193 Cases)

C99 List of Undefined Behavior

From N1256: (See http://port70.net/~nsz/c/c99/n1256.html#J.2)

  • A "shall" or "shall not" requirement that appears outside of a constraint is violated (clause 4).
  • A nonempty source file does not end in a new-line character which is not immediately preceded by a backslash character or ends in a partial preprocessing token or comment (5.1.1.2).
  • Token concatenation produces a character sequence matching the syntax of a universal character name (5.1.1.2).
  • A program in a hosted environment does not define a function named main using one of the specified forms (5.1.2.2.1).
  • A character not in the basic source character set is encountered in a source file, except in an identifier, a character constant, a string literal, a header name, a comment, or a preprocessing token that is never converted to a token (5.2.1).
  • An identifier, comment, string literal, character constant, or header name contains an invalid multibyte character or does not
@Earnestly
Earnestly / makepkg_overview.rst
Last active March 22, 2024 03:48
A brief overview of the process involved in creating a pacman package.

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

:xdg-support: https://wiki.archlinux.org/index.php/XDG_Base_Directory
:xdg-spec: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
:fhs: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
:madness: http://pub.gajendra.net/2012/09/dotfiles
:litter: https://www.reddit.com/r/linux/comments/971m0z/im_tired_of_folders_littering_my_home_directory/
:systemd: https://www.freedesktop.org/wiki/Software/systemd/
:systemd-fhs: https://www.freedesktop.org/software/systemd/man/file-hierarchy.html
:systemd-fhs-bin: https://www.freedesktop.org/software/systemd/man/file-hierarchy.html#~/.local/bin/
:toc: macro
@Earnestly
Earnestly / statusbar.adoc
Last active August 7, 2023 09:06
Simple reactive statusbar
Table of Contents

The main event loop

statusdir=$XDG_RUNTIME_DIR/statusbar
mkdir -pm0700 "$statusdir"
@Earnestly
Earnestly / pulseserver.adoc
Last active June 27, 2023 20:10
PulseAudio as a Server

Multiplexing Access to Audio Hardware via a Single PulseAudio Server

The goal of this setup is to create a single pulseaudio service which has sole access to the audio hardware while providing a server for many clients to use. This is not using the system wide mode as it doesn’t run as root, nor does it use the --system flag.

One disadvantage of this arrangement is that the commands pacmd and pactl will no longer work when run as your user. Both rely on the user dbus session

@Earnestly
Earnestly / !README: opentype-bitmap.pe and opentype-bitmap.py
Last active March 4, 2023 07:25
Convert PCF and BDF files to bitmap only OpenType (.otb) using fontforge
Convert PCF and BDF files to bitmap only OpenType (.otb) using fontforge
If you have a new enough fontforge, the python version of this script can
optionally read filenames from standard input, generating multiple .otb
font files as it finds new families. It also handles gzipped PCF and BDF
files.
@Earnestly
Earnestly / fonts.adoc
Last active March 17, 2022 08:04
Better Defaults for Freetype

Better Defaults for Freetype

Table of Contents

Introduction

@Earnestly
Earnestly / llpp.conf.xml
Last active February 22, 2022 10:20
Basic vi-like emulation using llpp's new keymapping. Also some other defaults and examples for custom fonts.
<llppconfig>
<ui-font size='18'>
<![CDATA[/home/earnest/.local/share/fonts/Fontin-Regular.otf]]>
</ui-font>
<defaults zoom='100'
auto-scroll-step='12'
horizontal-scroll-step='24'
case-insensitive-search='true'
uri-launcher='$BROWSER &quot;%s&quot;'
#!/bin/python
import os, sys, hashlib
def main():
progname = 'epub-font-obfuscation'
algorithms = {'idpf': 1040, 'adobe': 1024}
if len(sys.argv) > 2:
uid = sys.argv[1]