Skip to content

Instantly share code, notes, and snippets.

@0mp
0mp / measure-opens-and-closes.d
Created March 5, 2023 15:54 — forked from szaydel/measure-opens-and-closes.d
Dtrace snippets for observing the syscall interaction.
dtrace -qn '
/* Result is a CSV with three columns:
1) path,
2) count of open(s) without matching close(s)
3) number of times opened*/
int self fd[int];
string self path;
BEGIN {
start = timestamp;
}
@0mp
0mp / colortrans.py
Created November 24, 2016 19:59 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code