Skip to content

Instantly share code, notes, and snippets.

View gmatheu's full-sized avatar
🤠
yeehaw!

Gonzalo Matheu gmatheu

🤠
yeehaw!
View GitHub Profile
@digilist
digilist / delay.sh
Created June 2, 2015 14:29
Delaying network traffic to a specific IP
#!/bin/bash
interface=lo
ip=10.0.0.1
delay=100ms
tc qdisc add dev $interface root handle 1: prio
tc filter add dev $interface parent 1:0 protocol ip prio 1 u32 match ip dst $ip flowid 2:1
tc qdisc add dev $interface parent 1:1 handle 2: netem delay $delay
@romainl
romainl / gist:1f93db9dc976ba851bbb
Last active March 13, 2024 23:15
Vim: available key pairs in normal mode…

Vim: available key pairs in normal mode

All lowercase

The operators c, d, and y expect a motion, like w, e, etc. The second character in the following pairs is not a motion so it is a NOP and nothing is overridden if we use them in mappings.

cd cm co cp cq cr cs cu cx cy cz

dc dm dq dr ds du dx dy dz
@arr2036
arr2036 / delay.sh
Last active May 23, 2024 02:59
Simple script to introduce delay on outbound packets to one or more (run multiple times) ip addresses
#!/bin/bash
# root qdisc handle
r_handle=1
# netem qdisc handle
n_handle=2
interface=
delay=
dstip=
qdpresent=