December 27, 2021

How to Grep in PDF Documents

The end of the year usually also means having some fun with the tax declaration. One of the tedious tasks is to match payments for insurances with bank statements. As all my bank statements are PDF documents, I wondered how to search/grep in them. pdfgrep for the rescue Turns out there is pdfgrep, which you might need to install via sudo apt install pdfgrep or similar, depending on your operating system....

March 29, 2021

How to Restrict All Repos Grep to Specific Files

Back at the end of 2020, when Travis announced you need to move your open source projects from https://travis-ci.org to https://travis-ci.com, I wanted to know in which README files I used the link to the org-site - of the many, many repositories I manage. That is a textbook example what you can do with all-repos. A naive way would be to grep in all repositories like … all-repos-grep travis-ci.org Instead of grepping in all files, it is a better idea to restrict the search to only README files....

March 24, 2021

How to Find Duplicate Words

When contributing to a new open source project, from time to time I searched the codebase for occurrences of the the. This is a common mistake in comments in English codebases. My friend Miroslav came up with an even better way: Use a regex to find duplicate words! rg --pcre2 "\b(\w+)\s+\1\b" rg stands for ripgrep, which is a blazing fast implementation of a regex command line tool, written in Rust....