Unset (http) env vars
Only if you trust your environment, mind.
eval $(env | grep -i http | sed 's/^/unset /; s/=.*//')
Join a bash array on a character
Watch the quotes in the echo. Only works for single character joins.
PATH="$(IFS=: ; echo "${PATHS[*]}")"
Core Count
cat /proc/cpuinfo | egrep "core id|physical id" | tr -d "\n" | sed s/physical/\\nphysical/g | grep -v ^$ | sort | uniq | wc -l
Socket Count
cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
Iterate through arrays in bash
for i in ${!ARR[@]}; do echo ${ARR[$i]}; done
Restrict outgoing bandwidth on Linux
burst is ((<rate in bits/s> / <kernel tick hz>) / 8)
latency is the amount of data to queue before dropping traffic
tc qdisc add dev bond1 root tbf rate 4.5gbit burst 562500 latency 100ms
Remove:
tc qdisc del dev bond1 root