Skip to content

Instantly share code, notes, and snippets.

View lifning's full-sized avatar
💜

liffy lifning

💜
View GitHub Profile
@lifning
lifning / ec2-backup.sh
Created February 15, 2013 19:48
A backup script I wrote as a system administration course assignment in 2011.
#!/bin/bash
set -e
# print usage information if -h flag is passed
usage()
{
cat 1>&2 <<EOF
usage: $0 [-hv] [-i instance] [-m method] [-t tag] -d dir
-h Print a usage statement and exit.
-v Be verbose.
@lifning
lifning / Makefile
Last active August 29, 2015 13:56
Messing with nuances of stdin/stdout timing in C
CFLAGS = -Wall -pedantic
all: print-time delayed-receiver
./print-time | ./delayed-receiver
clean:
$(RM) print-time delayed-receiver *.o
print-time: print-time.o
@lifning
lifning / _io.S
Last active June 21, 2017 07:42
building gambit for m68k-elf
This file has been truncated, but you can view the full file.
#NO_APP
.file "_io.c"
.text
.align 2
.type ___setup_mod, @function
___setup_mod:
move.l %a5,-(%sp)
lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
move.l ___lp@GOT(%a5),%a0
move.l (%a0),%d0
@lifning
lifning / frick.diff
Created June 19, 2017 08:33
update newlib url in gendev
diff --git a/Makefile b/Makefile
index 5fa8fc2..0f3c687 100644
--- a/Makefile
+++ b/Makefile
@@ -114,7 +114,7 @@ work/binutils-$(BINUTILS_VERSION).tar.bz2:
NEWLIB_PKG=work/newlib-$(NEWLIB_VERSION).tar.gz
work/newlib-$(NEWLIB_VERSION).tar.gz:
- cd work && $(MGET) ftp://sources.redhat.com/pub/newlib/newlib-$(NEWLIB_VERSION).tar.gz
+ cd work && $(MGET) ftp://sourceware.org/pub/newlib/newlib-$(NEWLIB_VERSION).tar.gz
@lifning
lifning / mkvoidchroot.sh
Created July 29, 2021 05:30
quickly make a void chroot in a foreign architecture for testing things in a binfmt-misc context
#!/bin/bash
set -exo noclobber
ARCH="${1:?}"
ROOT="/var/chroot/void-$ARCH"
REPO=https://alpha.us.repo.voidlinux.org/current
if [[ "$ARCH" =~ ^ppc ]] ; then
case "$ARCH" in
ppc) REPO=https://repo.voidlinux-ppc.org/current/ppc ;;
ppc-musl) REPO=https://repo.voidlinux-ppc.org/current/ppc/musl ;;
@lifning
lifning / AFS_Unpk.c
Last active April 23, 2022 09:49
an ancient (ca. 2005) sega dreamcast AFS archive unpacker written by a high schooler who still commented every line of their programs
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
struct afsHeader // Header of the file
{
char magic[4]; // Magic word "AFS"
uint32_t count; // Number of .ADX files in the archive
};