Skip to content

Instantly share code, notes, and snippets.

owl be coding

Maddison Hellstrom b0o

owl be coding
Block or report user

Report or block b0o

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ddevault / Makefile
Last active Oct 13, 2019
Tiny Wayland compositor
View Makefile
# wayland-scanner is a tool which generates C headers and rigging for Wayland
# protocols, which are specified in XML. wlroots requires you to rig these up
# to your build system yourself and provide them in the include path.
wayland-scanner server-header \
$(WAYLAND_PROTOCOLS)/stable/xdg-shell/xdg-shell.xml $@
xdg-shell-protocol.c: xdg-shell-protocol.h
jdarpinian / hello-world.shc
Last active Feb 6, 2018
Directly execute C source code by embedding in a bash script.
View hello-world.shc
COMPILER_OPTIONS="-g -Wall -Wextra --std=c11 -O1 -fsanitize=address,undefined"
#include <stdio.h>
int main() {
printf("Hello world!\n");
return 0;
ZenGround0 / client.go
Last active Aug 2, 2019
golang http auto-streaming with transfer-encoding: chunked
View client.go
package main
import (
staaldraad /
Created Dec 12, 2017
Get the uid, gid and user groups without touching /etc/passwd or running the `id` command
awk -F: 'END {print "uid:"u" gid:"g" groups:"gg}{if($1=="Uid"){split($2,a," ");u=a[1]}if($1=="Gid"){split($2,a," ");g=a[1]}if($1=="Groups"){gg=$2}}' /proc/self/status
staaldraad /
Last active Oct 8, 2019
AWK to get details from /proc/net/tcp and /proc/net/udp when netstat and lsof are not available
# Gawk version
# Remote
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
# Local
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($2,index($2,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($2,i,2))}{print x":"strtonum("0x"substr($2,index($2,":")+1,4))}'
# No Gawk
# Local
grep -v "rem_address" /proc/net/tcp | awk 'function hextodec(str,ret,n,i,k,c){
sebastiencs /
Last active Oct 6, 2019
Script to get volume notification with dunst
# You can call this script like this:
# $./ up
# $./ down
# $./ mute
function get_volume {
amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1
naelstrof /
Last active Aug 22, 2017
This script intercepts specific user selections and replaces them with monitor geometry.
# This script intercepts specific user selections and replaces them with monitor geometry.
# The specific user selection is when they click on the root window, or attempt to select the whole X screen.
# Currently there is a bug, clicking and dragging the entire screen will still proc the replacement,
# and only screenshot the monitor that the mouse is on after the drag. There's no way around this without
# changing slop to indicate when a user clicked or dragged. (Which might be done if people care enough.)
# Get a normal selection
read -r X Y W H G ID < <(slop -f "%x %y %w %h %g %i")
sgf-dma / fix-mupdf-fullscreen-xmonad.hs
Created Mar 6, 2017
View fix-mupdf-fullscreen-xmonad.hs
import Data.Maybe
import Control.Monad
import XMonad
import XMonad.Hooks.EwmhDesktops
addNETSupported :: Atom -> X ()
addNETSupported x = withDisplay $ \dpy -> do
r <- asks theRoot
a <- getAtom "ATOM"
roadrunner2 / 0
Last active Oct 13, 2019
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)
View 0


This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

ssaavedra / 57-add-emoji-support.conf
Created Jun 19, 2016
Add Emoji to Linux Fontconfig
View 57-add-emoji-support.conf
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
EmojiOne Color SVGinOT Font
Author: Santiago Saavedra <>
License: CC0
Year: 2016
You can’t perform that action at this time.