8. GBT = Go Bullet Train
Highly configurable prompt builder for Bash and ZSH written in Go.
It's inspired by the Bullet Train theme for Oh My ZSH framework.
17. Benchmark
# Execution of the testing script by Bash
for N in $(seq 10); do time (for M in $(seq 100); do bash /tmp/test.sh 1>/dev/null 2>&1; done)
done 2>&1 | awk '{ total_cpu += $19; total_time += $21 } END { print "Avg CPU:
"total_cpu/NR"%; Avg time: "total_time/NR"s" }'
Avg CPU: 102%; Avg time: 1.9407s
# Execution of the testing script by ZSH
for N in $(seq 10); do time (for M in $(seq 100); do zsh /tmp/test.sh 1>/dev/null 2>&1; done)
done 2>&1 | awk '{ total_cpu += $19; total_time += $21 } END { print "Avg CPU:
"total_cpu/NR"%; Avg time: "total_time/NR"s" }'
Avg CPU: 103%; Avg time: 1.9079s
# Execution of GBT
for N in $(seq 10); do time (for M in $(seq 100); do GBT_SHELL='zsh' GBT_CARS='Git' gbt
1>/dev/null 2>&1; done) done 2>&1 | awk '{ total_cpu += $18; total_time += $20 } END { print
"Avg CPU: "total_cpu/NR"%; Avg time: "total_time/NR"s" }'
Avg CPU: 115%; Avg time: 1.8817s
21. How does it work?
ssh myserver -t "
echo "PS1='$(gbt)'" > /tmp/.gbt;
bash --rcfile /tmp/.gbt;
rm -f /tmp/.gbt"
22. Features
● GBT executes only locally
● GBT generates a string which is then forwarded to a remote machine
● Supports forwarding of local aliases
● Integrates with SSH, Docker, Vagrant, MySQL
● Supports su and sudo
25. Contribution and support
● Contribute
○ Create new themes (e.g. solarized)
○ Create new cars
■ SCM (e.g. Mercurial)
■ CPU load
■ ...
○ Optimize sequence string produced by GBT
○ Make tests running in parallel
● Spread the word
○ Thanks Gareth Rushgrove for advertising it in the next DevOps Weekly ;o)
● Star the project on Github
https://github.com/jtyr/gbt