Monthly Shaarli

All links of one month in a single page.

June, 2024

Show the first commit from each repo across many repos at once, sorted by date

Thanks to git log -1 it is trivial to view the latest commit in a repo, and combined with find ... -exec ... we can easily do that for multiple repos at once (for example see my commits bash function).

Turns out doing the same for the earliest commit in each repo is not at all trivial. Here is my approach (it should be said up-front that it's not pretty). But I wanted to get a handle on when I started working on some repos, and this pulled out the data I needed without having to do it manually for each individual repo.

$ find . -maxdepth 2 -name ".git" -exec sh -c "git -C {} --no-pager log --all --pretty=format:\"%cs %h%d %s [%cn]\" | tail -n1" \; -exec printf " %s\n" {} \; | sort -n
2021-03-14 02506d4 Initial commit [taha] ./texlive/.git
2021-03-14 14ddd9a Initial commit [taha] ./desktop-tools/.git
2021-03-14 2bfe5bc Initial commit [taha] ./R/.git
2021-03-15 0c2deda Initial commit [taha] ./calibre-web/.git
2021-04-02 7a2bdb2 Initial commit [taha] ./iriun-webcam/.git
2021-04-13 167ef2d First commit [taha@asks2] ./shaarli/.git
2021-05-28 ca70e06 Initial commit [taha] ./wallabag/.git
2021-06-09 3d4891e Initial commit [taha] ./lxd-server/.git

The directory roles contains a bunch of git repos (and possibly also a few folders that are not repos, which we exclude from find with -name ".git". Then for each repo, we list all commits (across all branches) using a custom format but then, importantly, only showing the last one which is the earliest commit.
To be able to tail this git command (and not the entire find command) we need to put it inside sh -c ....
Then we use a second exec statement to append the current directory name (so we can orient ourselves in the output) and then sort the entirety on the output (which thanks to our custom git format lists the commit date in the first column). Note that piping strips the colour from the git output, so no need to set colours in our pretty-format.

Search millions of full-text research papers

The collection spans from digitized copies of eighteenth century journals through the latest Open Access conference proceedings and preprints crawled from the World Wide Web.

Medfarm Play - Uppsala universitet

Medfarm Play är en videoportal som skapats i samarbete mellan pedagoger och MedfarmDoIT.
Här kan du hitta tusetals undervisningsfilmer, många av dem indelade i ämnesspecifika kanaler.

Video recordings on many subjects from Uppsala University, such as Nobel lectures, doctoral conferment ceremonies, etc. Use the search function or browse the channels.


Month-by-month moonsighting reports from around the world.

Secure messaging apps
Find all `vars/` folders with more than one file

Let's say you are looking for old Ansible code dealing with multiple distros (meaning multiple files in the ./vars/ directory) to draw inspiration from. How can we quickly identify the roles with vars directories containing more than a single file?

$ cd /media/bay/taha/projects/ansible && find . -not -path "*/archived/*" -not -path "*/testing/*" -path "*/vars/*" -printf "%h\n" | sort | uniq -d && cd $OLDPWD

All of the returned paths indeed contain at least two files.
Note how we limited find to only directories named vars.