Useful GitHub Gists

hugepages.sh

Shell
# Display huge page data for Ubuntu
cat /proc/meminfo | grep Huge
# Set huge pages for ubuntu
sudo sysctl -w vm.nr_hugepages=102400

View Gist

tc_commands.sh

Shell
#!/bin/bash

# Network Simulation Commands using tc (Traffic Control)

# 1. Packet Loss
sudo tc qdisc add dev eth0 root netem loss 10%

# 2. Latency (Delay)
sudo tc qdisc add dev eth0 root netem delay 100ms

# 3. Jitter
sudo tc qdisc add dev eth0 root netem delay 100ms 10ms

# 4. Packet Corruption
sudo tc qdisc add dev eth0 root netem corrupt 5%

# 5. Packet Reordering
sudo tc qdisc add dev eth0 root netem delay 10ms reorder 25% 50%

# 6. Packet Duplication
sudo tc qdisc add dev eth0 root netem duplicate 5%

# 7. Bandwidth Limitation
sudo tc qdisc add dev eth0 root tbf rate 1mbit burst 32kbit latency 400ms

# 8. Combining Multiple Conditions
sudo tc qdisc add dev eth0 root netem delay 100ms loss 10% duplicate 1%

# Remove the qdisc and return to normal network conditions
sudo tc qdisc del dev eth0 root

View Gist