Skip to content

Instantly share code, notes, and snippets.

@JohnnyonFlame
JohnnyonFlame / 10-mount
Last active February 5, 2022 13:23
OpenWRT '/sbin/block hotplug' substitute- works around missing ntfs.c from libblkid-tiny, also does generic automounting.
#!/bin/sh
# /sbin/block hotplug
# Syntax: query_uci_fstab option value
query_uci_fstab () {
blkindex=$(uci show fstab)
blkindex=$(echo $blkindex | grep fstab.@mount | grep .${1}= | grep ${2})
blkindex=$(echo $blkindex | sed -ne 's/.*\.\@mount\[\([^]]*\).*/\1/p')
blkindex=$(echo $blkindex | tail -1)
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdaf:684c:ea44::/48'
config interface 'br0'
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdaf:684c:ea44::/48'
config interface 'lan'
#!/bin/sh
if [ -z "$1" ]; then
echo "Syntax: $0 cheat.pnach"
exit 0
fi
if [ ! -r "$1" ]; then
echo "File $i doesn't exist or cant be read."
exit -1
@JohnnyonFlame
JohnnyonFlame / raycurse.c
Last active April 6, 2022 20:23
A small raycasting prototype in C using the pdcurses library.
#include <stdio.h>
#include <curses.h>
#include <math.h>
float pos[2] = {(6 * 32) + 16.f, (6 * 32) + 16.f};
int dir = 0;
int is3d = 1;
char dungeon[17][17] =
{
@JohnnyonFlame
JohnnyonFlame / fade-to-white
Created May 24, 2015 13:34
fades between image and full white
#include <stdio.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
int main(int argc, char *argv[])
{
SDL_Surface *vid = SDL_SetVideoMode(320, 240, 32, 0);
SDL_Surface *image = IMG_Load("pepe.png");
SDL_Surface *image2 = IMG_Load("spurdo.png");
@JohnnyonFlame
JohnnyonFlame / fade-swag-memes_v2.c
Created May 24, 2015 13:34
Fades between two 32bpp images
#include <stdio.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
int main(int argc, char *argv[])
{
SDL_Surface *vid = SDL_SetVideoMode(320, 240, 32, 0);
SDL_Surface *image = IMG_Load("pepe.png");
SDL_Surface *image2 = IMG_Load("spurdo.png");
@JohnnyonFlame
JohnnyonFlame / fade-to-black_dither.c
Last active August 29, 2015 14:21
Fade to black with dither @ 16bpp colour depth
#include <stdio.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
int main(int argc, char *argv[])
{
SDL_Surface *vid = SDL_SetVideoMode(320, 240, 16, 0);
SDL_Surface *image = IMG_Load("pepe.png");
SDL_Surface *image2 = IMG_Load("spurdo.png");
@JohnnyonFlame
JohnnyonFlame / fade-swag-meme_dither.c
Last active August 29, 2015 14:21
Fade between two 16bpp images w/ dithering
#include <stdio.h>
#include <math.h>
#include <SDL.h>
#include <SDL_image.h>
int main(int argc, char *argv[])
{
SDL_Surface *vid = SDL_SetVideoMode(320, 240, 16, 0);
SDL_Surface *image = IMG_Load("pepe.png");
SDL_Surface *image2 = IMG_Load("spurdo.png");
#
# Automatically generated file; DO NOT EDIT.
# Buildroot 2015.05 Configuration
#
BR2_HAVE_DOT_CONFIG=y
#
# Target options
#
# BR2_arcle is not set