I've thought about tying a hidden link, excluded in robots.txt, to fail2ban. Seems quick and easy with no side-effects, but I've ever actually gotten around to it.
"A glass is not impossible to make the file and so deepen the original cut. Now heat a small spot on the glass, and a candle flame to a clear singing note.
— context_length = 2. The source material is a book on glassblowing."
On my site, I serve them a subset of Emergent Misalignment dataset, randomly perturbed by substituting some words with synonyms.
It should make the LLMs trained on it behave like dicks according to this research https://www.emergent-misalignment.com/
Industrial ag regularly treats product to modify the texture, color, and shelf life. Its extremely common to expose produce to various gases and chemicals to either delay or hasten ripening, for example. Other tricks are used while the plants are still in the ground or immediately after harvest, for example spraying grains with roundup to dry out more quickly.
Same as any other consumer using Meta products. You sell out because it’s easier to network that way.
I am the son of a farmer.
Edit: added disclosure at the bottom and clarified as agricultural farming
https://www.farmkind.giving/the-small-farm-myth-debunked
Tldr; the concept of farmers as small family farms has not been rooted in truth for a very long time in America
In general though, the easy rule of living and eating non-mega farmed food and sustainable living is to “eat aware”:
My other advice is a one-size-fits-all food equation, which is, simply, to know where it came from. If you can't place it, trace it, or grow it/raise it/catch it yourself, don't eat it. Eat aware. Know your food. Don't wait on waiters or institutions to come up with ways to publicize it, meet your small fishmonger and chat him or her up at the farmer's market yourself. [0]
[0] https://www.huffpost.com/entry/the-pescatores-dilemma_b_2463...
1. When read_word() reads the last word in a string, at line 146 it will read past the end (and into uninitialised memory, or the leftovers of previous longer strings), because you have already added 1 to len on line 140 to skip past the character that delimited the word. Undefined behaviour.
2. grow_chain() doesn't assign to (*chain)->capacity, so it winds up calling realloc() every time, unnecessarily. This probably isn't a big deal, because probably realloc() allocates in larger chunks and takes a fast no-op path when it determines it doesn't need to reallocate and copy.
3. Not a bug, but your index precomputation on lines 184-200 could be much more efficient. Currently it takes O(n^2 * MAX_LEAF) time, but it could be improved to linear time if you (a) did most of this computation once in the original Python extractor and (b) stored things better. Specifically, you could store and work with just the numeric indices, "translating" them to strings only at the last possible moment, before writing the word out. Translating index i to word i can be done very efficiently with 2 data structures:
char word_data[MAX_WORDS * MAX_WORD_LEN];
unsigned start_pos[MAX_WORDS + 1];
(Of course you could dynamically allocate them instead -- the static sizes just give the flavour.)word_data stores all words concatenated together without delimiters; start_pos stores offsets into this buffer. To extract word i to dest:
memcpy(dest, word_data + start_pos[i], start_pos[i + 1] - start_pos[i]);
You can store the variable-length list of possible next words for each word in a similar way, with a large buffer of integers and an array of offsets into it: unsigned next_words[MAX_WORDS * MAX_LEAF]; // Each element is a word index
unsigned next_words_start_pos[MAX_WORDS + 1]; // Each element is an offset into next_words
Now the indices of all words that could follow word i are enumerated by: for (j = next_words_start_pos[i]; j < next_words_start_pos[i + 1]; ++j) {
// Do something with next_words[j]
}
(Note that you don't actually store the "current word" in this data structure at all -- it's the index i into next_words_start_pos, which you already know!)Part of the reason I did this is to get good numbers on how bad the problem is: A link maze is a great way to make otherwise very stealthy bots expose themselves.
So by blocking these IPs, you are blocking your users. (ie: in many coffeshops, I get the "IP Blocked" banner, my guess is that they are running software on unsuspecting users to route this traffic).
There were 122 million residential internet connections in the US in 2024 so for an app with 1 million users the chance of affecting a single user is <1%.
[1] https://docs.fcc.gov/public/attachments/DOC-411463A1.pdf
Otherwise, there are residential IP proxy services that cost around $1/GB which is cheap, but why pay when you can get the user to agree to be a proxy.
If the margin of error is small enough in detecting automated requests, may as well serve up some crypto mining code for the AI bots to work through but again, it could easily be an (unsuspecting) user.
I haven't looked into it much, it'd be interesting to know whether some of the AI requests are using mobile agents (and show genuine mobile fingerprints)