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
"""Analyze all DNS queries on systems with systemd. | |
Does our ad-blocker block all the requests that we want it to? Do I have | |
to add more entries to my `/etc/hosts` file? Find out. | |
```sh | |
sudo resolvectl monitor --json=short >> dns-queries-json | |
``` | |
Output: |
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 `CMD` whenever any of the `FORBIDDEN_WORDS` is typed. | |
Reading keyboard input regardless of window focus requires sudo: | |
```sh | |
python3 -m venv venv | |
venv/bin/pip install keyboard==0.13.5 | |
sudo venv/bin/python main.py | |
``` |
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
local function qf_toggle() | |
local qfbufnr = vim.fn.getqflist({ qfbufnr = 0 }).qfbufnr | |
-- Whether the qf buffer is open in a window | |
local has_win | |
if qfbufnr == 0 then -- Quickfix buffer doesn't exist | |
has_win = false | |
else -- Quickfix buffer has been open before | |
if #vim.fn.win_findbuf(qfbufnr) > 0 then | |
has_win = true | |
else |
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
# Check extensions and see whether you want to add any. | |
# Extensions can be added like `--to=gfm+extension_name` | |
pandoc --list-extensions=gfm | |
# Note: make sure you are on the latest version of pandoc. | |
# Older versions might not convert fenced code blocks | |
# correctly. | |
# Known issues: | |
# - "Wikilinks" (the linking to another document) will break. | |
fd -e wiki --exec pandoc \ |