Place theme files in ~/.k9s/ and create a symlink to the theme you wish to use as the current skin:
ln -s ~/.k9s/theme-to-use.yml ~/.k9s/skin.yml| # https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
| # requires pycryptodome lib (pip install pycryptodome) | |
| import sys | |
| import base64 | |
| import os | |
| import json | |
| from Crypto.Cipher import AES |
| #!/usr/bin/env bash | |
| say() { | |
| echo "$@" | sed \ | |
| -e "s/\(\(@\(red\|green\|yellow\|blue\|magenta\|cyan\|white\|reset\|b\|u\)\)\+\)[[]\{2\}\(.*\)[]]\{2\}/\1\4@reset/g" \ | |
| -e "s/@red/$(tput setaf 1)/g" \ | |
| -e "s/@green/$(tput setaf 2)/g" \ | |
| -e "s/@yellow/$(tput setaf 3)/g" \ | |
| -e "s/@blue/$(tput setaf 4)/g" \ | |
| -e "s/@magenta/$(tput setaf 5)/g" \ |
Place theme files in ~/.k9s/ and create a symlink to the theme you wish to use as the current skin:
ln -s ~/.k9s/theme-to-use.yml ~/.k9s/skin.yml| """ | |
| WARNING: dont use loguru, use structlog | |
| https://gist.github.com/nkhitrov/38adbb314f0d35371eba4ffb8f27078f | |
| Configure handlers and formats for application loggers. | |
| """ | |
| import logging | |
| import sys | |
| from pprint import pformat |
| import signal | |
| from contextlib import contextmanager | |
| from time import perf_counter | |
| @contextmanager | |
| def timeout(duration: int): | |
| def timeout_handler(signum, frame): | |
| raise Exception(f"Block timed out after {duration} seconds") |
Motor is an async Python driver for MongoDB.
You should use Motor when you're trying to interact with a MongoDB database in an asynchronous context. When you're making something that needs to be asynchronous (like a web server, or most commonly from what I've seen here, Discord bots), you also want all the database calls to be done asynchronously. But pymongo is synchronous, i.e it is blocking, and will block the execution of your asynchronous program for the time that it is talking to the database.
Thankfully for us, switching from pymongo to Motor isn't too hard, and won't need you to change much code. This process can be roughly summarized as:
Installing can be done with pip - pip install motor
If you're like me, you want to use Nerd Fonts for your editor and the terminal. If you use a terminal based editor like neovim or emacs, then you need that configued on your terminal emulator. But if you're using Chrome OS, which is more locked down than other desktop OS, then the usually simple task of installing these font and using them isn't as straightforward.
I have used the workaround to achieve this task. There is no guarantee it will continue to work in futuere versions. It depends on whether the old terminal settings page isn't removed from the app bundle and if the app doesn't stop loading the old config. As of Chrome OS 113, it is still working.
Open the old terminal settings page, as it allows more customizations:
chrome-untrusted://terminal/html/nassh_preferences_editor.html
Once there, add the following custom CSS on the field labeled "Custom CSS (inline text)":