These formulae provide software created by the discoteq project, including:
flock: locks files from the command line
Just brew tap discoteq/discoteq and then brew install <formula>.
You can also install via URL:
brew install https://raw.githubusercontent.com/discoteq/homebrew-discoteq/master/<formula>.rb
brew help, man brew, or the Homebrew wiki.