Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am 0mp on github.
  • I am 0mp (https://keybase.io/0mp) on keybase.
  • I have a public key whose fingerprint is 0510 719A F215 8358 DBE5 F578 CB3B 7FCE 2CB4 ED30

To claim this, I am signing this object:

@0mp
0mp / apibunny-2015-agent.js
Created November 1, 2016 17:40
An agent for solving the API Bunny 2015 mazing riddles.
var request = require('request');
var readline = require('readline');
var colors = require('colors');
var _ = require('underscore');
var links = [];
var visited = {};
var exitLink = "";
var winningLink = "";
@0mp
0mp / insert-a-file-into-file-with-sed-after-first-empty-line.sh
Last active November 5, 2016 23:12
Insert the first file into the second file after the first empty line with sed.
# basefile.txt - The file where we want to put the content of the
# injectedfile.txt.
# injectedfile.txt - The file we want to inject into the basefile.txt.
# -n disables automatic line printing.
sed -n \
# Set up a label to jump to.
# It's called 'head' because we use it to print lines before the first empty
# line.
-e ':head' \
@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
test:
date
develop:
find . | entr -d ${MAKE} test || expr "$$?" : "[012]" >/dev/null 2>&1 && ${MAKE} develop
@0mp
0mp / makefile
Created June 6, 2019 09:51
Recursive bmake
test:
date
develop:
find . | entr -d ${MAKE} test || expr "$$?" : "[012]" >/dev/null 2>&1 && ${MAKE} develop
@0mp
0mp / logs.yml
Created June 23, 2020 19:52
petclinic
apiVersion: v1
kind: PersistentVolume
metadata:
name: logs-volume
labels:
type: local
spec:
storageClassName: manual
capacity:
storage: 10Gi
@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;
}