Skip to content

Instantly share code, notes, and snippets.

View pprince's full-sized avatar

Paul Prince pprince

View GitHub Profile
mine_functions:
private_ips:
- mine_function: network.ip_addrs
- eth1
fqdn:
- mine_function: grains.get
- fqdn
@pprince
pprince / perf.sh
Created March 28, 2016 12:49 — forked from anonymous/perf.sh
#!/usr/bin/zsh
SHELL=/usr/bin/zsh
do_perf () {
printf "Going to run: %s\n" "$1"
for i in {1..5}; do
time $SHELL -c "$1"
done
Going to run: find /usr -name "*c*" -type f -exec cat {} \; | wc -l
0.23s user 0.91s system 17% cpu 6.468 total
0.34s user 0.87s system 18% cpu 6.659 total
0.27s user 0.87s system 17% cpu 6.527 total
0.31s user 0.89s system 17% cpu 6.777 total
0.29s user 0.96s system 17% cpu 6.928 total
Going to run: find /usr -name "*c*" -type f -exec cat {} + | wc -l
0.14s user 0.32s system 95% cpu 0.484 total
{% set home_dir = pillar['general']['my_home_dir'] %}
add-local-search-path:
file.replace:
- name: {{ home_dir }}/.bash_profile
- pattern: "^PATH=\\$PATH"
- repl: "PATH=$PATH:$HOME/usr/bin"
- unless: grep "\$HOME/usr/bin" {{ home_dir }}/.bash_profile