Skip to content

Instantly share code, notes, and snippets.

@graste
graste / race-condition-probe.java
Created April 24, 2025 04:38 — forked from albinowax/race-condition-probe.java
Race condition custom action for Burp Repeater
// This will use the single-packet attack for HTTP/2, and last-byte synchronisation for HTTP/1
int NUMBER_OF_REQUESTS = 10;
var reqs = new ArrayList<HttpRequest>();
for (int i = 0; i < NUMBER_OF_REQUESTS; i++) {
reqs.add(requestResponse.request());
}
var responses = api().http().sendRequests(reqs);
var codes = responses.stream().map(HttpRequestResponse::response).map(HttpResponse::statusCode).toList();
logging().logToOutput(codes);
@graste
graste / Git Subtree basics.md
Created April 15, 2025 11:16 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@graste
graste / falsehoods-programming-time-list.md
Created January 17, 2025 22:32 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@graste
graste / text_to_timestamp.sql
Created December 8, 2024 16:18 — forked from jgaskins/text_to_timestamp.sql
Parse Postgres TIMESTAMPs from JSON blobs
CREATE FUNCTION text_to_timestamp(text) RETURNS TIMESTAMP
LANGUAGE sql IMMUTABLE AS
$$
SELECT CASE
WHEN $1 ~ '^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d+)?$' THEN
CAST($1 AS timestamp without time zone)
END
$$;
CREATE TABLE t (
@graste
graste / get_geojson.md
Created October 30, 2024 20:00 — forked from knudmoeller/get_geojson.md
Get WGS84-GeoJSON from WFS with Soldner-Coordinates

Get WGS84-GeoJSON from WFS with Soldner-Coordinates

The problem: get GeoJSON data from a WFS that uses a projection other than WGS84. This is e.g. true for all geo data in Berlin's FIS-Broker GIS. The data there uses the "Soldner" projection (or EPSG:25833).

Download as XML

@graste
graste / css-2024-reading-list.md
Created October 5, 2024 22:28 — forked from jensgro/css-2024-reading-list.md
State of CSS 2024 Reading List

CSS 2024 Reading List

lvh / lvw / lvmin / lvmax, sv*, dv*, etc.

The CSS data type represents a distance value. Lengths can be used in numerous CSS properties, such as width, height, margin, padding, border-width, font-size, and text-shadow.

Anchor Positioning

  • Future CSS: Anchor Positioning (kizu.dev)
@graste
graste / base.css
Created October 5, 2024 22:26 — forked from jensgro/base.css
Eine Art Reset-Normalisierung :-)
*,
::after,
::before {
box-sizing: border-box;
}
html {
font-size: 16px;
}
@graste
graste / foxs-laws-of-software-development.md
Created September 21, 2024 19:04 — forked from sleepyfox/foxs-laws-of-software-development.md
Fox's Laws of Software Development
author: @sleepyfox
title: Fox's laws of software development
date: 27 October 2021
preamble: A not entirely serious treatise on the immutable fundamental laws of software development activities

Fox's laws of software development

A not entirely serious treatise

@graste
graste / HowToOTG.md
Created April 7, 2024 12:31 — forked from gbaman/HowToOTG.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int