- It might hit the wrong targets. Do you really trust whatever tool you run and whatever list you received to only hit what you wanted to hit? DDoSing will also unnecessarily increase network load on the route from you to the target.
- It's illegal and might come back at you. DDoSing is illegal on multiple levels. It's usually easy to prove through server logs. Your ISP might - often automatically - ban you. The targets of your attacks might "strike back" or use your attacks as a pretense to inflict even more harm to your region. You can merely hope that you will not be persecuted for your naive criminal offenses.
- It's risky. You'll - one way or another - be running foreign code on your machine. That always comes with a risk (which can only partially be reduced through virtualization, be it through the browser environment or something like Docker). Even if no control over your machine is gained, your IP at the very least
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <unistd.h> | |
#include <assert.h> | |
int main(int argc, char** argv) { | |
if (argc < 1) { | |
printf("Arguments: <program> {args}\n"); | |
return 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Solution to https://leetcode.com/problems/cheapest-flights-within-k-stops/description/ | |
// probably not the intended solution; uses an abridged Dijkstra to solve the much more general problem | |
// of finding all shortest paths to a given node using exactly k nodes | |
package main | |
import ( | |
"math" | |
"container/heap" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Lookup table for format strings | |
local formats = {} | |
for i = 1, 17 do | |
formats[i] = ("%%.%dg"):format(i) | |
end | |
local function _number_to_string(num, min_digits, max_digits) | |
if min_digits > max_digits then | |
return | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Small, hacky Minetest utility to get rid of "unknown entities" as they are activated. Licensed under CC0. | |
Caveat: `/spawnentity <name>` will fail with "<name> failed to spawn" rather than "Cannot spawn an unknown entity." | |
for unknown entities as the unknown entity will immediately be removed inside `on_activate`. | |
]] | |
setmetatable(minetest.registered_entities, { | |
__index = function(_, name) | |
-- Default entity def if `minetest.registered_entities[name]` would otherwise be `nil` | |
-- Necessarily leads to `minetest.registered_entities[name]` being truthy for unknown entities as well |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local eye_pos = player:get_pos() | |
eye_pos.y = eye_pos.y + player:get_properties().eye_height | |
local first, third = player:get_eye_offset() | |
if not vector.equals(first, third) then minetest.log("warning", "First & third person eye offsets don't match, assuming first person") end | |
eye_pos = vector.add(eye_pos, vector.divide(first, 10)) | |
local def = player:get_wielded_item():get_definition() | |
for pointed_thing in minetest.raycast(eye_pos, vector.add(eye_pos, vector.multiply(player:get_look_dir(), def.range or 4)), true, def.liquids_pointable) do if pointed_thing.ref ~= player then --[[do something]] end end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Written by appgurueu, licensed under the MIT license | |
local function patch_tile_texture(tex) | |
if not (tex:match"^%[combine:" or tex:match"^%[inventorycube{") then | |
return | |
end | |
-- Prevent Minetest 5.5 from prepending "blank.png^" for 5.4 and older clients which don't support [png | |
-- See https://github.com/minetest/minetest/pull/12210 | |
return "(" .. tex .. ")" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local _G = _G | |
return function(implicit_declaration, stacklevel) | |
assert(implicit_declaration == "var" or implicit_declaration == "global" or not implicit_declaration) | |
stacklevel = (stacklevel or 1) + 1 | |
local _P = getfenv(stacklevel + 1) | |
local _V = {} | |
local declarations = {} | |
local environment = { | |
_P = _P, | |
_V = _V, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local parent = getfenv(1) | |
local private = {} | |
local public = {} | |
setfenv(1, setmetatable({}, {__newindex = function(self, key, value) | |
local first = key:sub(1, 1); | |
((first >= "A" and first <= "Z") and public or private)[key] = value | |
end, __index = function(self, key) | |
local value = private[key] | |
if value ~= nil then | |
return value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Set boolean metatable | |
debug.setmetatable(false, { | |
__add = function(a, b) | |
if b == nil then | |
return b + a | |
end | |
return a or b | |
end, | |
__mul = function(a, b) | |
if b == nil then |