Skip to content

Instantly share code, notes, and snippets.

@angelsl
angelsl / nginx.conf
Created October 22, 2017 15:20
thelounge nginx proxy
location = / {
include thelounge_pass;
}
location = /index.html {
include thelounge_pass;
}
location /socket.io/ {
include thelounge_pass;
#!/usr/bin/python3
import sys
import hashlib
BLOCKSIZE=0x200
f1d = {}
f2h = []
with open(sys.argv[1], 'rb') as f:
#!/usr/bin/python3
# Parses the ROM => NOR map of r4isdhc family carts
import struct, sys
canonical = (
'''N.B. mapping does not apply to 0x00 header read and 0x20 secure area read
Header [0x0, 0x200) => NOR [0x1F0000, 0x1F0200)
Header [0x200, 0x1000) => zeroes (presumably past 0x1000 too)
Sep 28 18:10:52 slarch kernel: xhci_hcd 0000:03:00.0: xHCI Host Controller
Sep 28 18:10:52 slarch kernel: xhci_hcd 0000:03:00.0: new USB bus registered, assigned bus number 2
Sep 28 18:10:52 slarch kernel: DMAR: DRHD: handling fault status reg 3
Sep 28 18:10:52 slarch kernel: DMAR: [DMA Read] Request device [03:00.0] fault addr de483000 [fault reason 01] Present bit in root entry is clear
Sep 28 18:10:52 slarch kernel: DMAR: DRHD: handling fault status reg 3
Sep 28 18:10:52 slarch kernel: DMAR: [DMA Read] Request device [03:00.0] fault addr de483000 [fault reason 01] Present bit in root entry is clear
Sep 28 18:10:52 slarch kernel: DMAR: DRHD: handling fault status reg 3
Sep 28 18:10:52 slarch kernel: DMAR: [DMA Read] Request device [03:00.0] fault addr de483000 [fault reason 01] Present bit in root entry is clear
Sep 28 18:10:52 slarch kernel: DMAR: DRHD: handling fault status reg 3
Sep 28 18:10:52 slarch kernel: DMAR: [DMA Read] Request device [03:00.0] fault addr de483000 [fault reason 01] Present bit in r
#0 0x00007f4a221cf8ad in mozilla::ScrollFrameHelper::ScrollToImpl(nsPoint, nsRect const&, nsIAtom*) (this=this@entry=0x7f4a12293708, aPt=..., aRange=..., aOrigin=0x7f4a1b3796e0,
aOrigin@entry=0x0) at /home/angelsl/Development/Mozilla/mozilla-central/layout/generic/nsGfxScrollFrame.cpp:2821
#1 0x00007f4a221d2921 in mozilla::ScrollFrameHelper::ReflowFinished() (this=0x7f4a12293708) at /home/angelsl/Development/Mozilla/mozilla-central/layout/generic/nsGfxScrollFrame.cpp:5335
#2 0x00007f4a220b65b7 in mozilla::PresShell::HandlePostedReflowCallbacks(bool) (this=this@entry=0x7f4a12290000, aInterruptible=aInterruptible@entry=true)
at /home/angelsl/Development/Mozilla/mozilla-central/layout/base/PresShell.cpp:4023
#3 0x00007f4a220b667b in mozilla::PresShell::DidDoReflow(bool) (this=this@entry=0x7f4a12290000, aInterruptible=aInterruptible@entry=true)
at /home/angelsl/Development/Mozilla/mozilla-central/layout/base/PresShell.cpp:9183
#4 0x00007f4a220b6a20 in mozilla::PresShell::ResizeReflowIgnoreOverri
@angelsl
angelsl / c(a)b.pdf
Last active August 16, 2017 02:07
Constitution (Amendment) Bill 2016
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/python3
import sys, os, struct
def main():
if len(sys.argv) < 2:
print('usage: {} <file name>'.format(sys.argv[0]))
return -1
fp = '.'.join(sys.argv[1].split('.')[:-1])
with open(sys.argv[1], 'rb') as f:
@angelsl
angelsl / e31.rs
Last active April 16, 2017 19:15
fn combinations(target: i32) -> usize {
fn val(c: &[i32; 8]) -> i32 {
c[0]*200 + c[1]*100 + c[2]*50 + c[3]*20 +
c[4]*10 + c[5]*5 + c[6]*2 + c[7]
}
fn try_prefix(mut c: [i32; 8], p: usize, t: i32) -> usize {
if p == 7 {
c[7] = 0;
return if val(&c) <= t {
@angelsl
angelsl / sb.html
Last active September 17, 2016 15:38
<html>
<head>
<title>MathJax Sandbox</title>
<style>
body { font-family: "Open Sans", sans-serif; }
hr { margin: 2em auto; }
textarea { width: 100%; height: 10em; }
div.link-container { display: none; margin-top: 3em; font-size: 70%; }
</style>
<link href="//fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
sudo dd if=/dev/sdc of=NAND_emu.bin skip=1931264 count=1 bs=512
sudo dd if=/dev/sdc of=NAND_emu.bin seek=1 count=1931263 skip=1 bs=512