Skip to content

Instantly share code, notes, and snippets.

@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@zonque
zonque / xymodem-mini.c
Last active February 27, 2024 06:31
simple xmodem/ymodem implementation in C
/*
* Minimalistic implementation of the XModem/YModem protocol suite, including
* a compact version of an CRC16 algorithm. The code is just enough to upload
* an image to an MCU that bootstraps itself over an UART.
*
* Copyright (c) 2014 Daniel Mack <github@zonque.org>
*
* License: MIT
*/
@lirenlin
lirenlin / build-gcc.md
Last active October 1, 2023 16:57
build cross arm-gcc with newlib

##Set environment variables

export TARGET=aarch64-none-elf
export PREFIX=/work/public/$TARGET
export PATH=$PATH:$PREFIX/bin

##Build binutils

mkdir build-binutils
cd build-binutils
@sentinelt
sentinelt / gist:3f1a984533556cf890d9
Created February 6, 2015 18:44
Program to set arbitrary speed
/*
* Allows to set arbitrary speed for the serial device on Linux.
* stty allows to set only predefined values: 9600, 19200, 38400, 57600, 115200, 230400, 460800.
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <asm/termios.h>
int main(int argc, char* argv[]) {
anonymous
anonymous / gist:de6b81c556b5dc7cdc8b
Created February 20, 2015 01:42
Kernel panic in latest OS X in 10 lines of C
#include <unistd.h>
#include <mach/mach.h>
#include <mach/mach_vm.h>
#include <mach-o/dyld.h>
int
main (int argc, char * argv[])
{
volatile char * library;
const mach_vm_size_t page_size = getpagesize ();
@Belphemur
Belphemur / blacklist.conf
Last active October 20, 2021 10:52
Referrer black list for NGINX
map $http_referer $bad_referer {
hostnames;
default 0;
# Put regexes for undesired referers here
"~social-buttons.com" 1;
"~semalt.com" 1;
"~kambasoft.com" 1;
"~savetubevideo.com" 1;
@alicemaz
alicemaz / nginx.conf
Created January 4, 2016 06:25
my nginx setup
user www;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /usr/local/etc/nginx/mime.types;
default_type application/octet-stream;
-- Floppy disk read data pulse catcher
-- Eric Smith <spacewar@gmail.com>
-- 2016-08-02
-- WARNING: untested
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity floppy_rd_pulse_catcher is
@lizrice
lizrice / main.go
Created August 25, 2016 10:02
Container from scratch
package main
// @lizrice, mostly copied from @doctor_julz: https://gist.github.com/julz/c0017fa7a40de0543001
import (
"fmt"
"os"
"os/exec"
"syscall"
)