Skip to content

Instantly share code, notes, and snippets.

View ohnx's full-sized avatar
💭
:shipit:

Mason ohnx

💭
:shipit:
View GitHub Profile
@ohnx
ohnx / Makefile
Created February 5, 2020 06:20 — forked from ilammy/Makefile
Linux kernel system call table hooking
obj-m += afw.o
afw-objs := afw_main.o locate_sct.o ttgl.o
ccflags-y := -std=gnu99 -O2
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

dlkg3

script to download audio clips from https://kg3.qq.com

tries to infer filename from title and falls back to using the song code.

this worked on january 8th, 2020; good luck getting it to work in the future!

@ohnx
ohnx / cat2think.svg
Last active August 9, 2019 01:55
emojis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ohnx
ohnx / build_cross_gcc
Created November 26, 2018 17:18 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@ohnx
ohnx / README.md
Last active January 4, 2018 21:31
Giving userspace access to EFI NVRAM variables

Haiku has an EFI bootloader now (I'm a few months late to the party, sorry). Yay!

Now, on to the next step... allowing user applications to access EFI-related things, e.g. EFI NVRAM.

From my understanding, there's three things that need to happen before userspace applications can take advantage of EFI variables:

  1. Pass RuntimeServices to the kernel

This shouldn't be too bad to implement. Add an additional variable to struct kernel_args which will be NULL on non-EFI systems, and will be a pointer to the RuntimeServices on EFI systems.

PuTTY colour scheme copied from cloud9's terminal

-----BEGIN PGP MESSAGE-----
Version: Keybase OpenPGP v2.0.76
Comment: https://keybase.io/crypto
wcBMA3GOjzBTqTV/AQf+MWyPCW5CchENjCUF8PYBcCBrjP3VVTpnGUvXXonMLp5r
NQOJKLJgjAVjBmtPn/1w6jlT4Emt54odb+9NnmHCdfM5a3DUxsnpgh3uN8EZQt3Z
KPYR67laqPPQRD76bN9iEkA/MiN3w9ZzuAwb2B6LZPDC/yykNqVG4H34G9t0pAmj
YoxVCw7Prqe7e96f6AJU9A7Zx+c6Xlf10jynbeDwAPYo2d4j3FMdO7/MnvU2eZuB
UQb2O6JhzR/HvADbUBGGyg66puY4VGdP32c6znZlff06VMWV4toANVRspyj+wtZc
+C3eBzVvZELkqC/w9OeFC7I811moWdHLbr0r3/t+NMHATANxjo8wU6k1fwEIAKPt
@ohnx
ohnx / libvirt-bootstrap.sh
Last active October 3, 2017 18:28 — forked from brenard/libvirt-bootstrap.sh
libvirt-bootstrap.sh adapted for Debian Jessie
#!/bin/sh -
#===============================================================================
# vim: softtabstop=4 shiftwidth=4 expandtab fenc=utf-8 spell spelllang=en cc=81
#===============================================================================
#
# FILE: bootstrap-webvirtmgr.sh
#
# DESCRIPTION: Bootstrap webvirtmgr installation for various distributions
#
# BUGS: https://github.com/retspen/webvirtmgr-boostrap/issues
@ohnx
ohnx / style.css
Last active January 17, 2018 00:54
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.p

Keybase proof

I hereby claim:

  • I am ohnx on github.
  • I am ohnx (https://keybase.io/ohnx) on keybase.
  • I have a public key whose fingerprint is 3797 7596 FBA9 1303 9511 6E5A 1D06 7752 0535 327F

To claim this, I am signing this object: