Skip to content

Instantly share code, notes, and snippets.

View emersion's full-sized avatar

Simon Ser emersion

View GitHub Profile
@emersion
emersion / debian-mips64el-on-qemu.md
Last active January 7, 2023 12:01 — forked from extremecoders-re/debian-mipsel-on-qemu.md
Installing debian stretch mips64el on qemu
@emersion
emersion / fullscreen-client-unmapped.c
Last active April 19, 2018 21:11
Creates a client that sends a fullscreen request while unmapped
#include <GLES2/gl2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client.h>
#include <wayland-egl.h>
#include <wlr/render/egl.h>
#include "xdg-shell-unstable-v6-client-protocol.h"
#include "idle-inhibit-unstable-v1-client-protocol.h"
#include <GLES2/gl2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client.h>
#include <wayland-egl.h>
#include <wlr/render/egl.h>
#include "xdg-shell-unstable-v6-client-protocol.h"
#include "idle-inhibit-unstable-v1-client-protocol.h"
@emersion
emersion / Makefile
Created December 24, 2017 10:47
Fuck GOPATH
PKGNAME = github.com/emersion/fuckgopath
GOPATH = $(realpath .go)
PKGPATH = .go/src/$(PKGNAME)
all: fuckgopath
.go:
mkdir -p $(dir $(PKGPATH))
ln -fTrs $(realpath .) $(PKGPATH)
@emersion
emersion / arch-install.sh
Last active January 6, 2021 08:13
Arch Linux installation
# Arch Linux installation
# - EFI with systemd-boot
# - LUKS encryption
# - BTRFS with two subvolumes: @root and @home
# - Intel/AMD ucode
# See https://wiki.archlinux.org/index.php/Installation_guide
# Connect to the Internet
ls /sys/firmware/efi/efivars # Check EFI
timedatectl set-ntp true
// Source: https://oroboro.com/file-handle-leaks-server/
#define _POSIX_C_SOURCE 200112L
#include <unistd.h>
#include <fcntl.h>
int maxfd = sysconf(_SC_OPEN_MAX);
for (int fd = 3; fd < maxfd; fd++) {
int fd_flags = fcntl(fd, F_GETFD);
if (fd_flags < 0) {
// clang -Wall -L/usr/X11R6/lib -lX11 -o xlib-resize xlib-resize.c
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void) {
Display *d;
Window w;
// Source: https://jan.newmarch.name/Wayland/Input/
// clang -o wl_shell_client wl_shell_client.c -lwayland-client -lwayland-egl -lEGL -lGL -g
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-client-protocol.h>
#include <wayland-client.h>
@emersion
emersion / erase-likes.js
Created September 26, 2017 19:14
Erase Twitter
// https://twitter.com/i/likes
setInterval(function() {document.body.parentNode.scrollTop = 99999999999999999}, 1000)
$('.ProfileTweet-actionButtonUndo').click()
#[macro_use]
extern crate nom;
use nom::{IResult,digit};
// Parser definition
use std::str;
use std::str::FromStr;