Skip to content

Instantly share code, notes, and snippets.

View zeehio's full-sized avatar

Sergio Oller zeehio

View GitHub Profile
@flaviovs
flaviovs / README.md
Last active April 21, 2025 06:07
How to use TARPIT in Linux without consuming (your) resources

Iptables(8) TARPIT is a useful security mechanism that can slow down or stop attacks on a network. If everyone used TARPIT to block attackers, in theory their resources would be exhausted as their connection attempts would be delayed, which would discouraged people from attempting unauthorized access. Here's a brief description of how TARPIT works:

To achieve this tar pit state, iptables accepts the incoming TCP/IP connection and then switches to a zero-byte window. This forces the attacker's system to stop sending data, rather like the effect of pressing Ctrl-S on a terminal. Any attempts by the attacker to close the connection are ignored, so the connection remains active and typically times out after only 12–24 minutes. This consumes resources on the attacker's system but not

inner_fn <- function() {
cat("-- Entering Inner Function --\n")
# This step of the body is targeted by `at = 3L` in `trace()`
cat("-- Exiting Inner Function --\n")
return("inner_fn")
}
outer_fn <- function() {
cat("---- Entering Outer Function ----\n")
x <- inner_fn()
@qdm12
qdm12 / README.md
Last active March 20, 2025 08:49
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@gadenbuie
gadenbuie / join-animations-with-gganimate.R
Last active January 11, 2022 15:48
Animated dplyr joins with gganimate
# Animated dplyr joins with gganimate
# * Garrick Aden-Buie
# * garrickadenbuie.com
# * MIT License: https://opensource.org/licenses/MIT
# Note: I used Fira Sans and Fira Mono fonts.
# Use search and replace to use a different font if Fira is not available.
library(tidyverse)
library(gganimate)
@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@gerdr
gerdr / utf8.c
Created June 4, 2012 16:05
UTF-8 encoder
/*
Copyright 2012 Gerhard R. <gerd.r.devel@googlemail.com>
Permission is granted to use, modify, and / or redistribute at will.
This includes removing authorship notices, re-use of code parts in
other software (with or without giving credit), and / or creating a
commercial product based on it.
This permission is not revocable by the author.