This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash | |
# Usage: | |
# systemd-search.sh WorkingDirectory | |
word=$1 | |
get_doc() { | |
exec {awkfd}<<AWKS | |
/^ ((${word}=(, [A-Z])?)|(([^ ]+=, )+${word}=))/ , /^[^ ]/ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: | |
# python3 -m venv pytools | |
# cp Makefile pytools/ | |
# cd pytools | |
# make lock && make install | |
# ln -snf /path/to/pytools/bin/some_useful_cli_tool ~/bin/ | |
# Runs all commands in a target in a single shell. Otherwise each line is run in a seperate shell | |
.ONESHELL: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Dependencies: | |
# yq - https://github.com/mikefarah/yq | |
# xsv - https://github.com/burntsushi/xsv | |
# Usage: | |
# ❯ ./show-podcast.sh https://gotime.fm/rss | |
# This exec statement puts the script to a free file descriptor. i.e. to a in-memory temporary file whose path is /dev/fd/$fd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Run as below: | |
❯ pip install pex | |
❯ pex httpx tqdm -- ./example.py | |
""" | |
import asyncio, tqdm, httpx | |
async def get_chunks_with_progress(response: httpx.Response): | |
total = int(response.headers["Content-Length"]) |