Skip to content

Instantly share code, notes, and snippets.

@brandonprry
Last active March 15, 2023 11:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonprry/4305328f069f7a951ccc to your computer and use it in GitHub Desktop.
Save brandonprry/4305328f069f7a951ccc to your computer and use it in GitHub Desktop.
Parallelize afl-tmin to use multiple cores
#!/bin/bash
cores=$1
inputdir=$2
outputdir=$3
pids=""
total=`ls $inputdir | wc -l`
for k in `seq 1 $cores $total`
do
for i in `seq 0 $(expr $cores - 1)`
do
file=`ls -Sr $inputdir | sed $(expr $i + $k)"q;d"`
afl-tmin -i $inputdir/$file -o $outputdir/$file -- & #put the command to run after the --
done
wait
done
@fennecdjay
Copy link

very handy, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment