Skip to content

Instantly share code, notes, and snippets.

@dmfay
Created September 26, 2020 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmfay/32a327869c40ec2673d622957a7b6289 to your computer and use it in GitHub Desktop.
Save dmfay/32a327869c40ec2673d622957a7b6289 to your computer and use it in GitHub Desktop.
#! /bin/bash
for i in {100000..1}; do
d=$(($(date +%s) - i))
cmd="vi $i.txt"
mod=$((i % 10))
if [[ $mod -eq 1 ]]; then
cmd="cat $i.txt | grep $d"
elif [[ $mod -eq 2 ]]; then
cmd="ls *$i*"
elif [[ $mod -eq 3 ]]; then
cmd="kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic $i"
elif [[ $mod -eq 4 ]]; then
cmd="git add -p $i"
elif [[ $mod -eq 5 ]]; then
cmd="mv $i.txt $i-moved.txt"
elif [[ $mod -eq 6 ]]; then
cmd="sudo systemctl restart $i-am-not-a.service"
elif [[ $mod -eq 7 ]]; then
cmd="cat $i/*.txt | wc -l"
elif [[ $mod -eq 8 ]]; then
cmd="mkdir $i"
elif [[ $mod -eq 9 ]]; then
cmd="cargo run -- search --fuzzy"
fi
# echo ": $d:0;$cmd" >> ~/.histfile
mcfly add --append-to-histfile -d ~ -e 0 -w $d "$cmd"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment