This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env -S sh -c 'f="$1";shift;sed 1d "$f" | cc -no-pie -o "$f.elf" -xassembler - && ./"$f.elf" "$@"' - | |
.intel_syntax noprefix | |
__USER32_CS = 35 | |
__USER_DS = 43 | |
__USER_CS = 51 | |
.global main | |
main: | |
push rbp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disable ASLR in linux executable | |
// | |
// This bit of code will disable ASLR when it's linked into a linux executable. | |
// It's achieved by setting the process personality (ADDR_NO_RANDOMIZE), | |
// and re-executing itself. | |
// | |
// This can be used on programs that are built from source, as well as on | |
// existing dynamically linked executables through LD_PRELOAD. | |
// | |
// Usage (linked statically with program): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/openrc-run | |
user="${RC_SVCNAME##*.}" | |
name="${RC_SVCNAME%.*} daemon for user $user" | |
pidfile="/var/run/$RC_SVCNAME.pid" | |
command="/usr/bin/tmux" | |
command_args="-D" | |
command_user="$user:$user" | |
command_background=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <X11/Xlib.h> | |
// Simple program to check for the presence of an Xembed tray | |
// Exits with status 0 if the tray exists | |
int main() | |
{ | |
Display *d = XOpenDisplay(NULL); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Merge all attributes of multiple PDF files (pdf-full-merge.js) | |
// Extended from MuPDF's docs/examples/pdf-merge.js | |
// Ever had problems with tools that don't copy certain attributes of a PDF? | |
// This script uses MuPDF to merge/join/concatenate as much as possible, including: | |
// - bookmarks / outlines / table of contents | |
// - link attributes of said outlines, such as viewrect and zoom | |
// - whether outlines appear open or closed by default | |
// - annotations | |
// - 3d objects / PDF3D |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ Bootstrap for running a GBA multiboot game stored in a ROM cartridge | |
@ Assemble with: | |
@ arm-none-eabi-as -o mb2gba.o mb2gba.s | |
@ arm-none-eabi-objcopy -O binary mb2gba.o mb2gba.bin | |
@ base64 mb2gba.bin | |
start: | |
@ Copy the game into ram | |
mov r0, #0x04000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Script to generate a semi-reproducible dotnet source tarball | |
# The only differences accross builds are in the git-info/ directory, | |
# the OfficialBuildId being generated based on the current date. | |
# See tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/WriteSourceRepoProperties.cs | |
version="v${1:-5.0.209.1}-SDK" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Logs in automatically to the "WiFi in de trein" public hotspots, located in | |
# trains in the Netherlands. | |
# Requires: curl, sed | |
set -e | |
tmp="$(mktemp -d -p '' 'hslogin.XXXXXXXXXX')" | |
trap "rm -r '$tmp'" EXIT | |
curl="curl --dns-servers 8.8.8.8,8.8.4.4 -s -v -m 30" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sys import argv | |
from struct import unpack, unpack_from, pack | |
from os import makedirs | |
from os.path import isdir | |
from json import dumps, loads | |
def unpack_wchar_str_from(bytes, pos): | |
string = b"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dummy .rsf file for 3DS games |
NewerOlder