Skip to content

Instantly share code, notes, and snippets.

mondrian.rolap.queryTimeout - we set it typically to 60 seconds to cancel too long running ad-hoc queries which generate too much load on the server
mondrian.rolap.maxQueryThreads - increase it to higher number to allow more parallel Mondrian query threads if you have many concurrent users
mondrian.rolap.cellBatchSize - we have been experimenting with this value but typically set it to 100000 (which is now the default value for Mondrian), by changing it you can modify batch size when retrieving large set of result cells
mondrian.native.ExpandNonNative - set to true to expand more MDX expressions to SQL
mondrian.rolap.evaluate.MaxEvalDepth - we set it to 20 as otherwise sometimes more complex MDX calculated members were failing
mondrian.rolap.EnableInMemoryRollup - we set it to false as we have some multi-valued dimensions which cannot be rolled up by making sum of measure values for detailed members therefore we always want rollup to be calculated using SQL
mondrian.util.memoryMon
@movEAX
movEAX / gist:d47dae4ca517172f87c6
Created September 3, 2015 22:35
SEND + MORE = MONEY (python3)
from itertools import permutations
for p in permutations(range(10)):
(s,e,n,d,m,o,r,y,*_) = p
send = (10*(10*(10*s+e)+n)+d)
more = (10*(10*(10*m+o)+r)+e)
money = (10*(10*(10*(m+o)+n)+e)+y)
if send + more == money:
print('send=%d', send)
print('more=%d', more)
@movEAX
movEAX / gist:2efbd42450cfab72f4e6
Created May 19, 2015 21:28
XML scheme definition draft
struct Attribute {
name: &str
required: bool
}
let attr: Attr = Default::default();
let nested: Nested = Default::default();
let baseColor = OOXMLObjectBuilder::base()
.def(Attr {name: "auto", ..attr}
.def(Attr {name: "indexed", ..attr}
@movEAX
movEAX / gist:7ca78153e5eaf0eafd98
Last active August 29, 2015 14:20
Replace short links in text to full links
import requests
import re
DOMAINS = ['bit.ly']
PATTERN = 'https?://{}/\w+'
def expand_short_url(short_url):
resp = requests.get(short_url, allow_redirects=False)
return resp.headers['location']
#!/usr/bin/env python2
import curses
import random
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
curses.halfdelay(1)
#!/usr/bin/python
"""
Building (Python3.4):
> cython --embed window.pyx
> gcc -I/usr/include/python3.4m -o window -lpython3.4m -lpthread -lm -lutil -ldl
"""
#------------------------------------------------------------------------------
# Imports
#------------------------------------------------------------------------------
import logging
@movEAX
movEAX / gist:f53d90c24f83071ed8cc
Last active August 29, 2015 14:17
Simple HLS player
# buggy - no sound
gst-launch-1.0 -v souphttpsrc location="http://hlsstr03.svc.iptv.rt.ru/hls/CH_2X2/variant.m3u8" ! hlsdemux ! tsdemux ! h264parse ! avdec_h264 ! autovideosink
@movEAX
movEAX / gist:e4a0b1164b7a813ccd72
Created September 27, 2014 13:48
DHCP Shellshock
#!/usr/bin/perl
# largely purloined from http://www.perlmonks.org/?node_id=1093916 as my PoC for the old options overflow proved too messy^wPerlish to rework - [machine]
use strict;
use IO::Socket;
use Net::DHCP::Packet;
use Net::DHCP::Constants;
my $server_ip = "10.10.10.1";

radare2 is a very cool set of tools that you probably don't know how to use! Let's go through a simple exploit CTF challenge to understand how to use it for exploit development.

We'll be focusing on "ropasaurus rex" which is a simple challenge from Plaid CTF After checking out the latest and greatest radare from git, let's get started!

Open up ropasaurusrex in r2 and call analyze on the binary. We can list the functions with "afl"

@movEAX
movEAX / gist:32740fc0d3c52e52a568
Created September 1, 2014 20:30
Поковырять под gdb
const int bufferSize = 32;
void first()
{
char buffer[bufferSize];
memset( buffer, 'A', sizeof( buffer ) );
}
void second()
{