Split logging output using splitvt
Bookmarklet to enable picture-in-picture controls for Firefox in Google Meet, and other sites that disable PiP
Create a new bookmark with the following "URL":
javascript:(function() {var i, elements = document.querySelectorAll("body video"); for (i = 0; i < elements.length; i++) {elements[i].style.pointerEvents = "all"}})()
Note: this embeds the following function:
function() {
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
MULTIPASS="/snap/multipass/current/etc/bash_completion.d/snap.multipass" | |
if [[ -e "${MULTIPASS}" ]]; then | |
source <( | |
sed \ | |
-e '/_get_comp_words_by_ref/d' \ | |
-e 's^\$(echo \${BASH_VERSION} | .*)^0^' \ | |
"${MULTIPASS}" | |
) | |
fi |
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
flatpak override --user | |
--env=MOZ_ENABLE_WAYLAND=1 --env=MOZ_WEBRENDER=1 --env=MOZ_USE_XINPUT2=1 \ | |
--socket=wayland \ | |
org.mozilla.firefox | |
flatpak info --show-permissions org.mozilla.firefox |
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
FROM python:3.8 | |
# ... | |
ADD entrypoint.sh /usr/local/bin | |
ENTRYPOINT ["bash"] | |
CMD ["-l"] |
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
python -c "import shutil, sys, requests; x = requests.get(sys.argv[1], stream=True); shutil.copyfileobj(x.raw, (sys.stdout if x.ok else sys.stderr).buffer); sys.exit(not x.ok)" https://httpbin.org/get | jq . |
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
import sys | |
import logging | |
from typing import Optional, Dict | |
from colorama import Fore, Back, Style | |
class ColoredFormatter(logging.Formatter): | |
"""Colored log formatter.""" |
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
function track_mem { | |
while (( 1 )); do | |
echo -en "$(date --iso-8601=s)\t" | |
ps -eo comm,pid,pmem,rss,vsz | grep "^$1" | |
sleep $2 | |
done | |
} |
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
using GZip | |
MAX_WIDTH = 4 | |
function Base.filesize(io::GZip.GZipStream) | |
f = open(io.name, "r") | |
seekend(f) | |
skip(f, -4) | |
n = Int64(first(reinterpret(Int32, read(f, 4)))) | |
close(f) |
Modules = [CallTest]
NewerOlder