Skip to content

Instantly share code, notes, and snippets.

View foolsh's full-sized avatar
💭
Rebel Scum

Benjamin Brown foolsh

💭
Rebel Scum
  • Practically Perfect Pixel
  • Saint Joseph, MI
View GitHub Profile
@foolsh
foolsh / index.html
Created November 24, 2019 20:18
Lightmapping shader with Pixi.js
<div id="renderer">
</div>
@foolsh
foolsh / cursed_mandelbrot.c
Created November 14, 2018 03:50 — forked from DavidBuchanan314/cursed_mandelbrot.c
Compile-time mandelbrot in pure C. Outputs a PGM image file to stdout.
#include <stdio.h>
#define SQ(x) (x)*(x)
#define M0(x,y) SQ(x)+SQ(y)<4?0:0xe0
#define M1(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M0(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0)):0xc0
#define M2(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M1(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0xa0
#define M3(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M2(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x80
#define M4(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M3(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x60
#define M5(x,y,x0,y0) (SQ(x)+SQ(y)<4)?M4(SQ(x)-SQ(y)+(x0),2*(x)*(y)+(y0),x0,y0):0x40
@foolsh
foolsh / comcast.js
Created November 30, 2015 00:06 — forked from Jarred-Sumner/comcast.js
Comcast injects this into webpages to show copyright notices
// Comcast Cable Communications, LLC Proprietary. Copyright 2014.
// Intended use is to display browser notifications for critical and time sensitive events.
var _ComcastAlert = (function(){
return {
SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/notify.do'
, dragObj: {zIndex: 999999}
, browser: null
, comcastCheck: 1
, comcastTimer: null
, xmlhttp: null

SSL over :80 with nginx

Using nginx's error_page directive we can support SSL over both :80 and :443

Why?

Some intrusive firewalls, ISPs, companies, and ``Anti-virus'' programs attempt to intercept SSL connections on :443. Some of these programs even offer their own certificate, in order to perform MiTM attacks. In more extreme cases, connections may be entirely blocked on :443.

By allowing SSL connections on :80, users with these threats may still access the server securely.

How?

Using nginx's

@foolsh
foolsh / frag32.py
Last active September 10, 2015 14:54 — forked from ryancdotorg/frag32.py
A FAT32 fragmenter, because I am a horrible person.
#!/usr/bin/env python
import random
import struct
import sys
# Most of the Fat32 class was cribbed from https://gist.github.com/jonte/4577833
def ppNum(num):
return "%s (%s)" % (hex(num), num)
#!/bin/bash
## Install ISPConfig3 on Ubuntu 14.04 64Bits
## Author: Nilton OS blog.linuxpro.com.br
## http://blog.linuxpro.com.br/posts/instalando-ispconfig3-no-ubuntu-1404.html
## http://www.howtoforge.com/perfect-server-ubuntu-14.04-apache2-php-mysql-pureftpd-bind-dovecot-ispconfig-3-p2
dpkg-reconfigure dash
service apparmor stop
# -*- mode: shell-script -*-
#
# Control node power through WOL, via `wakeonlan` or `etherwake`.
#
mac_address={{mac_address}}
power_change={{power_change}}
ip_address={{node_ip_address}}
#if [ -n "${ip_address}" ]