Skip to content

Instantly share code, notes, and snippets.

@bjackman
bjackman / opcodes.md
Last active October 22, 2024 12:17
A visualisation of eBPF opcodes

This table visualises the space of eBPF opcodes. It was generated by this hack

The *s represent opcodes that are exposed but not actually used, or used internally but not exposed

Note that there are gaps, but no empty columns.

There's also a prettier version here

|  0x00           |  0x01           |  0x02           |  0x03           |  0x04           |  0x05           |  0x06           |  0x07           |
@sigmaris
sigmaris / build_qemu_debian_image.sh
Last active August 9, 2024 13:41
Automate the installation of Debian Buster on a x86_64 QEMU 4.0.0 VM hosted on macOS
#!/bin/bash -e
if [ "$(uname -s)" != "Darwin" ]
then
echo "This script is for building a Debian x86_64 image to use on MacOS"
exit 1
fi
TEMP="$(mktemp -d build.XXXXX)"
cp preseed.cfg $TEMP
DEBUG: Executing python function extend_recipe_sysroot
NOTE: Direct dependencies are ['virtual:native:/mnt/a/oe/sources/openembedded-core/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb:do_populate_sysroot', 'virtual:native:/mnt/a/oe/sources/openembedded-core/meta/recipes-extended/pigz/pigz_2.4.bb:do_populate_sysroot', 'virtual:native:/mnt/a/oe/sources/openembedded-core/meta/recipes-devtools/opkg/opkg_0.3.6.bb:do_populate_sysroot', 'virtual:native:/mnt/a/oe/sources/openembedded-core/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb:do_populate_sysroot', '/mnt/a/oe/sources/openembedded-core/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot', 'virtual:native:/mnt/a/oe/sources/openembedded-core/meta/recipes-devtools/opkg-utils/opkg-utils_0.3.6.bb:do_populate_sysroot', '/mnt/a/oe/sources/openembedded-core/meta/recipes-core/glibc/cross-localedef-native_2.28.bb:do_populate_sysroot', 'virtual:native:/mnt/a/oe/sources/openembedded-core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot',
@hjertnes
hjertnes / doom.txt
Created April 6, 2018 08:28
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch
@henrywang
henrywang / Setup ZNC
Last active March 11, 2022 11:01
How to setup ZNC
# In this guide, the server is hosted by Linode and with Fedora 27 server as OS.
# Register a freenode nick name by following https://freenode.net/kb/answer/registration
# ZNC setup needs this information
sudo dnf -y update
# Follow docker installation doc https://docs.docker.com/install/linux/docker-ce/fedora/#os-requirements
sudo dnf remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
@pdanford
pdanford / README.md
Last active November 14, 2024 21:13
Launching iTerm2 from macOS Finder

Launching iTerm2 from macOS Finder

(Based on info from Peter Downs' gitub but with modified behavior to open a new terminal window for each invocation instead of reusing an already open window.)

The following three ways to launch an iTerm2 window from Finder have been tested on iTerm2 version 3+ running on macOS Mojave+.

pdanford - April 2020


@ybakos
ybakos / osx-for-hackers.sh
Created January 7, 2016 04:47 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
@romankierzkowski
romankierzkowski / 0_falsy_.js
Last active February 22, 2020 11:25
True, False and Equal in JS
/* false, 0, undefined, null, NaN, "" are false */
> Boolean(false)
false
> Boolean(0)
false
> Boolean("")
false
> Boolean(undefined)
false
(ns async-test.timeout.core
(:require [cljs.core.async :refer [chan close!]])
(:require-macros
[cljs.core.async.macros :as m :refer [go]]))
(defn timeout [ms]
(let [c (chan)]
(js/setTimeout (fn [] (close! c)) ms)
c))
@eric-hu
eric-hu / Open iterm tab here
Last active March 11, 2022 02:45
Apple script to open an iterm2 tab from right-clicking on a file or folder in Finder. To use: (1) Open Automator (2) Create a new service (3) Change "Service receives selected" drop downs to "Files or folders" in "Finder" (4) Select "Run applescript" from the sidebar, then paste this script in and save
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer: