Skip to content

Instantly share code, notes, and snippets.

View DavidBuchanan314's full-sized avatar
🌍
Hack the planet!

David Buchanan DavidBuchanan314

🌍
Hack the planet!
View GitHub Profile
#define F for(i=0;i<l;i++)
#define W;write(1,// Hire Me
main(n){int i,j,w=640,h=480,
l=w*h,o[]={-w-1,-w,-w+1,-1,1
, w-1, w, w+1}; char b[l*4];
memset(b, 128, l*3); F b[i]=
rand()W"YUV4MPEG2 W640 H480"
" F60:1 C444\n",31);for(W"F"
"RAME\n",6)W b,l*3)){F{for(n
=0,j=0;j<8;n+=b[(i+l+o[j++])
@DavidBuchanan314
DavidBuchanan314 / gol2.c
Last active December 4, 2016 13:19
gcc gol.c -Ofast && ./a.out | mpv -
#define F for(i=0;i<l*2;i++)
#define W;write(1,// David B
main(n){int i,j,w=640,h=480,
l=w*h,o[]={-w-1,-w,-w+1,-1,1
,w-1,w,w+1};char b[l*3];F b[
i]=rand()W"YUV4MPEG2 W640 H"
"480 F60:1 C444\n",31);for(W
"FRAME\n",6)W b,l*3)){F{for(
n=j=0;j<8;n+=b[(i+l+o[j++])%
l]&1);b[i+l]=(n^3&&!b[i]|n^2
#define F for(i=0;i<l*3;i++)
main(n){int i,j,w=640,h=480,l
=w*h,o[]={~w,-w,-w+1,-1,1,w-1
,w,w+1},b[l*4];F b[i]=rand();
for(puts("YUV4MPEG2 W640 H48"
"0 F30 C444");puts("FRAME");)
{F{for(n=j=0;j<8;n+=b[(i+l+o[
j++])%l]&1);b[i+l]=(n^3&&!b[i
]|n^2)-1;}F putchar(b[i]=b[i+
l]);}}// gcc c&&./a.out|mpv -
# This file has been auto-generated by i3-config-wizard(1).
# It will not be overwritten, so edit it as you like.
#
# Should you change your keyboard layout some time, delete
# this file and re-run i3-config-wizard(1).
#
# i3 config file (v4)
#
# Please see http://i3wm.org/docs/userguide.html for a complete reference!

#Notes on compiling LineageOS for Sony Xperia Z2 (sirius)

Firstly, this is a great guide for the general procedure: https://harryyoud.co.uk/blog/android/2016/12/29/building-lineageos/

This is the contents of my roomservice.xml file which I eventually got to work:

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
  <project name="AdrianDC/proprietary_vendor_sony" path="vendor/sony" remote="github" />
// ==UserScript==
// @name fbhax
// @namespace davidbuchanan
// @description hax
// @include https://*.apps.fbsbx.com/*
// @version 1
// @grant none
// ==/UserScript==
var originalSetScore = FBInstant.setScore;
# This class renders an undefined subset of Markdown to HTML
class Markdown
def initialize(fileName)
@input = preprocess(File.read(fileName))
@line_count = @input.lines.count
@line_state = []
@line_flags = {
isCodeBlock: false
"""
Solution for RCTF 2017 challenge "Need a waiter"
714 points, 9 solves
"""
import codecs
rearranger = [11,15,14,13,7,9,6,3,0,1,2,10,5,12,8,4]
# This code is very slow, and only cracks one key byte at a time. Choose which byte by changing keyi:
keyi = 0
import matplotlib.pyplot as plt
import numpy as np
ins = []
outs = []
samples = []
"""/*
5616f5962674d26741d2810600a6c5647620c4e3d2870177f09716b2379012c342d3b584c5672195d653722443f1c39254360007010381b721c741a532b03504d2849382d375c0d6806251a2946335a67365020100f160f17640c6a05583f49645d3b557856221b2
*/
function my_encrypt($flag, $key) {
$key = md5($key);
$message = $flag . "|" . $key;
$encrypted = chr(rand(0, 126));
for($i=0;$i<strlen($message);$i++) {
$encrypted .= chr((ord($message[$i]) + ord($key[$i % strlen($key)]) + ord($encrypted[$i])) % 126);