The rich console is themeable, I’ve been a long time user of rich and had no
Idea. You can define your own theme keywords and use them just like you use
normal rich keywords in square brackets like'[bold red]'.
from rich.console import Console
from rich.theme import Theme
custom_theme = Theme({
"info": "dim cyan",
"warning": "magenta",
"danger": "bold red"
})
console = Console(theme=custom_theme)
console.print("This is information", style="info")
console.print("[warning]The pod bay doors are locked[/warning]")
console.print("Something terrible happened!", style="danger")
You can unset multiple environment variables at once. I did not know this was a
thing, its something that ended up happening organically on a call and asking
someone to run unset. They had never done it before and did not know how it
works, but did exactly as I said instead of what I meant. I like this handy
shortcut doing it in one line rather than each one individually, I will be
using this in the future. You might need this for something like
running aws cli commands with localstack.
unset AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION
i3lock is a fantastic lockscreen for tiling window managers.
If you are using a tiling window manager within a public space you need to add a lockscreen. I have one machine that I take with me to a public space. Its secure enough that I can leave it, but not secure enough that I want to leave it unlocked. So when I need to leave it behind for the restroom I need to lock it up.
paru -S i3lock
# or
apt install i3lock
Now that you have i3lock installed lets lock that screen.
# lock it with a pure white flashbang
i3lock
# lock it with a black background
i3lock -c 000000
# lock it with a custom color
i3lock -c 2e1330
# lock it with a wallpaper
i3lock -c 000000 ~/Pictures/Wallpapers/mywallpaper.png
You can use your window manager or something more generic like xbindkeys to set
a hotkey. This way you don’t have to open a terminal and type out the command
every time you leave your desk. You can just press something like SUPER+L
like you would on other OS’s.
Fancy #
If you like it a bit fancier, you can use i3lock-fancy, it can blur,
pixelate, and greyscale your current screen. I did not really like this
because you can still tell what is going on the screen. It’s probably secure
enough and looks better, but I went with regular i3lock.
paru -S i3lock-fancy-git
# or
apt install i3lock-fancy
kraft
my nvim spellcheck setup
If you need to target a specific k8s node in the cluster, you can use labels. You want to treat your nodes as much like cattle as you can, but sometimes budgets get in the way. You might be like me and just run any free hardware you can get in your cluster, or you might have some large storage or gpu needs that you can’t afford to put on every node in the cluster.
kubectl get nodes --show-labels
# add the bigpool label
kubectl label node k8s-1 bigpool=true
kubectl get nodes --show-labels
# remove the bigpool label
kubectl label node k8s-1 bigpool-
To use the label in a pod set spec.nodeSelector to the label that you
applied.
apiVersion: v1
kind: Pod
metadata:
name: busybox
spec:
containers:
- name: busybox
image: busybox
nodeSelector:
bigpool: "true"
/wants
Linux Is About Choice
I’m currently [[replacing-google-search-apps-with-self-hosted-web-apps]] and decided to create a simple b64 encoder/decoder, just start typing to enter text, escape to deselect, then e/d to encode/decode.
I’m trying to make these apps super simple, self hosted out of minio, static html, and javascript. It’s been fun to get back to some simple interactive web development like this. No build just a website that does something. No broken builds, no containers to deploy, just push to minio.
encoded = btoa(content);
decoded = atob(encoded);
Here is the result.
tinyapps
I’m trying to replace my usage of google inline search apps with real apps, today I used a stopwatch to time some things out at work by opening stopwatch. This was something I just wanted running in a tab on another screen, it was not timing running code or anything, I was using it as a reminder to check browser caches every 5 minutes or so for some testing.
So tonight I whipped up a stopwatch, clock and timer, all of which are using the wakelock API to keep the screen on while the app is running.
// Wake Lock support
let wakeLock = null;
async function requestWakeLock() {
try {
if ('wakeLock' in navigator) {
wakeLock = await navigator.wakeLock.request('screen');
console.log("Wake lock acquired");
}
} catch (err) {
console.error("Wake lock error:", err);
}
}
document.addEventListener("visibilitychange", () => {
if (wakeLock !== null && document.visibilityState === "visible") {
requestWakeLock();
}
});
requestWakeLock();
I’ve been working on ninesui, inspired by k9s see thoughts-633. I want a good flow for making video for the readme and I am using charm.sh’s vhs for this. Its running in an archBTW distrobox and looks gawdaweful.
The over saturated colors give it a really retro look, seems fine, but not my
cup of tea. I tried to change the textual theme to tokyo-night and it might
have made it a bit better, but still over-saturated.
After #
What I found is that vhs has themes, setting it to dracula made everything much better.
# sort.tape
Output assets/sort.mp4
Output assets/sort.gif
Require echo
Set Shell "bash"
Set FontSize 32
Set Width 1920
Set Height 1080
+ Set Theme 'Dracula'
NinesUI #
I’m using these in my ninesui project, right now they are in the readme, but maybe some docs will grow eventually. Right now its hardcore explore phase.