Skip to content

Instantly share code, notes, and snippets.

@jleungs
jleungs / avellaneda_stoikov.cpp
Created October 15, 2025 13:15
The Avellaneda-Stoikov market making model implemented in C++
#include <cmath>
class AvellanedaStoikov {
double sigma, k, gamma, T; /* volatilty, intensity, risk aversion, terminal time */
double q = 0.0; /* inventory */
public:
void init_params(double, double, double, double);
double reservation_price(double, double);
double optimal_spread(double);
double quote_bid_price(double, double);
#!/bin/bash
export DISPLAY=:0
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
export XAUTHORITY=/home/username/.Xauthority
BAT0=$(cat /sys/class/power_supply/BAT0/capacity)
if [[ $BAT0 -lt 10 ]];then
/usr/bin/notify-send -u critical "=== LOW BATTERY ==="
fi
@jleungs
jleungs / enum
Last active May 9, 2022 22:19
Small init-enum bash script used for OSCP
#!/bin/bash
webservEnum() {
# If HTTP/HTTPS -> nikto & Gobuster
if [[ $(grep -w 80/tcp enum/nmap/init.nmap) ]]; then
nikto -h http://$1 -o enum/nikto80.txt
gobuster -u http://$1 -w /usr/share/wordlists/dirb/common.txt > enum/gobust80.c 2>/dev/null
fi
if [[ $(grep -w 8080/tcp enum/nmap/init.nmap) ]]; then