Skip to content

Instantly share code, notes, and snippets.

diff -r f40f48714e04 extensions/oic_login.py
--- a/extensions/oic_login.py Fri Jun 15 20:25:08 2018 +0200
+++ b/extensions/oic_login.py Wed Jun 20 01:52:00 2018 -0400
@@ -11,6 +11,7 @@
from roundup.cgi.actions import Action
from roundup.cgi.exceptions import *
from roundup import password, hyperdb
+import logging
try:
Branch: https://github.com/EcoCityCraft/Spigot/tree/mikeprimm/lighterNibbleArrays
This is an experimental change I've made to try to reduce basic memory use due to chunks. Specifically,
it exploits several facts that I've confirmed (via instrumentation) to be true:
1) The NibbleArrays used for block data are all zero, on a section by section basis, 60+% of the time.
This is largely due to world generated blocks being almost exclusively block data free (stone, dirt, etc).
2) The NibbleArrays used for Emitted lighting data are 90%+ all zeros, due to the fact that most chunk sections don't
contain emitting sources (e.g. lava, torches)
3) The NibbleArrays used for Sky lighting data are 80%+ all zeros OR all 15s, due to the chunk section being below
import Data.Char (isDigit)
data Month = January | February | March | April | May | June
| July | August | September | October | November | December
deriving (Show)
data DSTType =
DayV Integer
| MonthV Month
| Year Integer
@ammaraskar
ammaraskar / gist:f2de65f3f2cb0c003b5a36f4018375e9
Created February 16, 2018 07:17
Demonstration of Haskell's type defaulting converting Num -> Integer
λ ghci -Wtype-defaults
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help
Prelude> :t 23
23 :: Num p => p
Prelude> quot 23 2
<interactive>:2:1: warning: [-Wtype-defaults]
* Defaulting the following constraints to type `Integer'
(Show a0) arising from a use of `print' at <interactive>:2:1-9
(Integral a0) arising from a use of `it' at <interactive>:2:1-9
import os
import tqdm
import cryptography
import base64
from multiprocessing import Pool
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
encrypted = base64.b64decode("U2FsdGVkX1+1KcLc+WlP8rcjdSP8DnOx/W1h+lww6rGCUVH4ghAuhSs+Xs9ShwJNEFlJ4IWDoG00T4LnAqIMrsY9EODHGc7Jv/Rn1lC/h7k=")
Parsing new function: sym.main
NodeIndex(78) Op(OpSub) NodeData { vt: ValueInfo { vty: Unresolved, width: Known(64) }, nt: Op(OpSub) }
- arg 0: NodeIndex(77) NodeData { vt: ValueInfo { vty: Scalar, width: Known(64) }, nt: Op(OpConst(1)) } []
+ arg 0: NodeIndex(16) NodeData { vt: ValueInfo { vty: Unresolved, width: Known(64) }, nt: Comment("rdi") } ["rdi"]
+ arg 1: NodeIndex(77) NodeData { vt: ValueInfo { vty: Scalar, width: Known(64) }, nt: Op(OpConst(1)) } []
NodeIndex(80) Op(OpNarrow(32)) NodeData { vt: ValueInfo { vty: Unresolved, width: Known(32) }, nt: Op(OpNarrow(32)) }
+ arg 0: NodeIndex(12) NodeData { vt: ValueInfo { vty: Unresolved, width: Known(64) }, nt: Comment("rax") } ["rax"]
NodeIndex(82) Op(OpAnd) NodeData { vt: ValueInfo { vty: Unresolved, width: Known(64) }, nt: Op(OpAnd) }
- arg 0: NodeIndex(81) NodeData { vt: ValueInfo { vty: Scalar, width: Known(64) }, nt: Op(OpConst(18446744069414584320)) } []
+ arg 0: NodeIndex(12) NodeData { vt: ValueInfo { vty: Unresolved, width: Known(64) }
@ammaraskar
ammaraskar / faster.asm
Created October 15, 2017 21:57
Array indexing comparison
40061c: 48 8d 14 85 00 00 00 lea rdx,[rax*4+0x0]
400623: 00
400624: 48 8d 85 b0 f2 fc ff lea rax,[rbp-0x30d50]
40062b: 48 8d 34 10 lea rsi,[rax+rdx*1]
...
40065d: 89 06 mov DWORD PTR [rsi],eax
#!/bin/bash
tmux new-session -d -s lab2
tmux send-keys 'cd ~/cs252/lab2-src' 'C-m'
tmux send-keys './script-consumer.sh' 'C-m'
tmux rename-window 'Monitor'
tmux select-window -t lab2:0
tmux split-window -h
tmux send-keys 'htop -u $USER' 'C-m'
tmux split-window -v -t 0
#!/usr/bin/env python3
inputs = """qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
abcd5
aBcDeF
aBcDeFgHiJkLmNoPqRsTuVwXyZaBcDe
aBc9F1
aBcDeFg94JkLmNo8qRsTuVwXyZaBcD2
aBcDeF@
aBcDeF$
import sys
import struct
from pwn import *
context(arch='amd64', os='linux')
#r = gdb.debug(["./sandman"])
#r = remote("52.72.171.221", 9982)
url = 'http://'