GitHub - casey/just: 🤖 Just a command runner
🤖 Just a command runner. Contribute to casey/just development by creating an account on GitHub.
GitHub · github.com [1]
I think just, might just be the thing I have been looking for. I’ve been looking for some ci/cd that I can host myself, but everything looks pretty big, so for now I am going to use just as my task runner.
I installed with installer.
curl https://i.wayl.one/casey/just | bash
I set up my devtainer builds with just. Here is my justfile, yes you just need the cli and a file named justfile.
default: base alpine slim
base: build deploy
alpine: build-alpine deploy-alpine
slim: build-slim deploy-slim
build:
podman build -t registry.wayl.one/devtainer:latest .
deploy:
podman push registry.wayl.one/devtainer
build-alpine:
podman build -f docker/Dockerfile.alpine -t registry.wayl.one/devtainer:alpine .
deploy-alpine:
podman push registry.wayl.one/devtainer:alpine
build-slim:
podman build -f docker/Dockerfile.slim -t registry.wayl.one/devtainer:slim .
deploy-slim:
podman push registry.wayl.one/devtainer:slim
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thou...
Posts tagged: cli
All posts with the tag "cli"
96 posts
latest post 2026-04-29
Publishing rhythm
[1]
Wincent (Greg Hurrel) has a pretty solid and fast zshrc. I recently grabbed his completion section and it seems to be working better than whatever I had.
zsh completion snippet
#
# Completion
#
fpath=($HOME/.zsh/completions $fpath)
autoload -U compinit
compinit -u
# Make completion:
# - Try exact (case-sensitive) match first.
# - Then fall back to case-insensitive.
# - Accept abbreviations after . or _ or - (ie. f.b -> foo.bar).
# - Substring complete (ie. bar -> foobar).
zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]}' '+m:{[:upper:]}={[:lower:]}' '+m:{_-}={-_}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
# Colorize completions using default `ls` colors.
zstyle ':completion:*' list-colors ''
# Allow completion of ..<Tab> to ../ and beyond.
zstyle -e ':completion:*' special-dirs '[[ $PREFIX = (../)#(..) ]] && reply=(..)'
# $CDPATH is overpowered (can allow us to jump to 100s of directories) so tends
# to dominate completion; exclude path-directories from the tag-order so that
# they will only be used as a fallback if no completions are found.
zstyle ':completion:*:complete:(cd|pushd):*' tag-order 'local-directories named-directories'
# Categorize completion...
jpillora/installer is the install script generator I have been looking for. It
downloads binaries for your machine from GitHub releases and unzips them for
you. It grabs the latest release, so you can easily update them. I have
tried scripting these installs in the past and struggled to consistently get
the latest version for every package and unpack it correctly.
Also these pre-compiled binaries install rediculously fast compared to building
them from source.
Check out some example links.
opening in a browser will show metadata
https://i.jpillora.com/serve
If you pass in script=true it will instead return the install script as it
would by default through curl.
https://i.jpillora.com/serve?script=true
Use it to install neovim # [1]
All you need to do to generate an install script is to pass in the GitHub repo
slug with the org.
curl https://i.jpillora.com/neovim/neovim | bash
The shell script that it generates for neovim looks like this.
#!/bin/bash
if [ "$DEBUG" == "1" ]; then
set -x
fi
TMP_DIR=$(mktemp -d -t jpillora-installer-XXXXXXXXXX)
function cleanup {
rm -rf $TMP_DIR > /dev/null
}
function fail {
cleanup
msg=$1
echo "============"
echo "Error: $msg" 1>&2
...
GitHub - jpillora/installer: One-liner for installing binaries from Github releases
One-liner for installing binaries from Github releases - jpillora/installer
GitHub · github.com [1]
This is a sick looking bash script generator for installing binaries off of github releases. it reccomends curl into bash, but you could curl into install.sh and toss that in your dotfiles repo or wherever.
Install installer with installer
curl -s https://i.jpillora.com/installer | bash
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://github.com/jpillora/installer
[2]: /thoughts/
Formatter
How to use the Biome formatter.
Biome · biomejs.dev [1]
Tried out biome today and it worked better than prettier on jinja templates, I might adopt this over prettier.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://biomejs.dev/formatter/
[2]: /thoughts/
cURL Command Without Using Cache | Baeldung on Linux
A quick and practical guide to using curl without cache.
Baeldung on Linux · baeldung.com [1]
Busting cache with curl. I’m not sure how much gets cached by curl, but I have ran into several cases where I am looking for new content and I want to ensure the content is new and no chance of being cached.
This article suggests 3 different techniques.
curl -H 'Cache-Control: no-cache, no-store' http://www.example.com
curl -H 'Pragma: no-cache' http://www.example.com
curl http://www.example.com/?xyzzyspoon
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://www.baeldung.com/linux/curl-without-cache#adding-the-pragma-http-header
[2]: /thoughts/
GitHub - sharkdp/bat: A cat(1) clone with wings.
A cat(1) clone with wings. Contribute to sharkdp/bat development by creating an account on GitHub.
GitHub · github.com [1]
Bat is my favorite pager, its the one for me that seems to just work more than the rest. colors, syntax highlighting, line numbers search, it just feels the most natural.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://github.com/sharkdp/bat
[2]: /thoughts/
How To Format All Files in a Directory with Prettier
Format any project, folder, or workspace using Prettier code formatter one line in the Prettier CLI.
Medium · levelup.gitconnected.com [1]
Use prettier to format all files in a directory. By default prettier does not write, it just echos out the format that it would do. Give it the --write and it will write the changes to the files.
prettier --write .
I just used this on my thoughts repo.
prettier --write templates
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://levelup.gitconnected.com/how-to-format-all-files-in-a-directory-with-prettier-5f0ff5f4ffb2
[2]: /thoughts/
Textual - Center things
Textual is a TUI framework for Python, inspired by modern web development.
Textual Documentation · textual.textualize.io [1]
How to center things in textual. Textual has a very unique way of styling text user interfaces for the terminal using css. If you know css it feels natural.
@willmcgugan, has put together a great article on how to center things in textual
here the final result
from textual.app import App, ComposeResult
from textual.widgets import Static
QUOTE = "Could not find you in Seattle and no terminal is in operation at your classified address."
class CenterApp(App):
"""How to center things."""
CSS = """
Screen {
align: center middle;
}
#hello {
background: blue 50%;
border: wide white;
width: 40;
height: 9;
text-align: center;
content-align: center middle;
}
"""
def compose(self) -> ComposeResult:
yield Static(QUOTE, id="hello")
if __name__ == "__main__":
app = CenterApp()
app.run()
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://textual.textualize.io/how-to/center-things/
[2]: /thoughts/
Deleting Specific Lines in a File with sed or yq — Nick Janetakis
We
Nick Janetakis · nickjanetakis.com [1]
sed can be a tricky beast, I often stumble when trying to pipe into it. Next time I need to use sed, I should reference this article by Nick Janetakis. He makes it looks much easier than my experience has been, and it appears to behave like a vim :%s/ substitution does, or a g/ g command.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://nickjanetakis.com/blog/deleting-specific-lines-in-a-file-with-sed-or-yq
[2]: /thoughts/
GitHub - 1j01/textual-paint: :art: MS Paint in your terminal.
:art: MS Paint in your terminal. Contribute to 1j01/textual-paint development by creating an account on GitHub.
GitHub · github.com [1]
1j01 [2] created a complete working clone of ms paint in the terminal using the textual framework. It’s incredible.
Note
This post is a thought [3]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://github.com/1j01/textual-paint
[2]: https://github.com/1j01
[3]: /thoughts/
External Link
duckdb.org [1]
Harlequin is a pretty sweet example of what textual can be used to create. Its a terminal based sql ide for DuckDB.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://duckdb.org/docs/guides/sql_editors/harlequin
[2]: /thoughts/
GitHub - doyensec/wsrepl: WebSocket REPL for pentesters
WebSocket REPL for pentesters. Contribute to doyensec/wsrepl development by creating an account on GitHub.
GitHub · github.com [1]
Very inspiring textual project to check out how they set up the ui. Their intro video has a pretty epic dev experience.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://github.com/doyensec/wsrepl
[2]: /thoughts/
External Link
X (formerly Twitter) · twitter.com [1]
wsrepl is an epic websocket repl built in python on the textual framework.
Note
This post is a thought [2]. It’s a short note that I make
about someone else’s content online #thoughts
References:
[1]: https://twitter.com/Doyensec/status/1681320727465672706
[2]: /thoughts/
Quickly and easily create new versions of your Python package with the gh release
command. Get the version number, changelog, and
Releasing a new version of your Python package can be a daunting task. You need to make
sure that all the necessary files are included, and that the version number is correct.
But now, with the help of the gh release command, you can make the process much
smoother.
The gh release command allows you to quickly and easily create a new version of your
Python package. All you need to do is provide the version number, the changelog, and the
distribution files. For example, if you wanted to create a new version of your package
with the version number v1.2.3, you could use the following command:
gh release create v1.2.3 -F CHANGELOG.md dist/*.whl dist/*.tar.gz
This command will create a new version of your package with the specified version number,
and include the changelog and the distribution files. It’s a great way to make sure that
all the necessary files are included in the release, and that the version number is
correct.
The gh release command is a great tool for quickly and easily creating new versions of
your Python package. With just a few simpl...
Give github actions the -e flag in the shebang #! so they fail on any one
command failure. Otherwise each line will set the exit status, but only the
last one will be passed to ci.
#!/bin/bash -e
What is -e # [1]
The -e flag to the bash command allows your script to exit immediately if any
command within the script returns a non-zero exit status. This can be useful
for ensuring that your script exits with an error if any of the commands it
runs fail, which can help you identify and debug issues in your script. For
example, if you have a script that runs several commands and one of those
commands fails, the script will continue running without the -e flag, but will
exit immediately if the -e flag is present. This can make it easier to
troubleshoot your script and ensure that it runs correctly.
Solution for Windows # [2]
In windows the solution is not quite as simple. You can define a function in a
Windows batch script that wraps an if statement to check the exit status of a
command and handle any errors that may have occurred. Here is an example of how
you might define a function called “check_error” that does this:
:check_error
if errorlevel 1 (
echo An error occurred!
ex...
Moving panes between tmux sessions is something that makes tmux a very flexible
and powerful tool. I don’t need this feature very often, but it comes in
clutch when you need it.
Pull a pane from any other session # [1]
Using choose-window I was able to come up with a way to select any pane
withing any other session and join it into my current session.
# Choose a pane to join in horizontally
bind f choose-window -Z 'join-pane -h -s "%%"'
Push/Pull from scratch # [2]
I’ve long had this one in my tmux config, I always have a “scratch” session
that I’m running, I often use for looking at things like k9s accross repos
within a popup.
This use case puts a pane into the scratch session, then pulls it back out. I
will use this to move a pane between sessions in the rare cases I need to do
this.
# push the active pane into the scratch session horizonally
bind -n M-f join-pane -ht scratch
# pull the last active pane from the scratch session horizonally into this session
bind -n M-F join-pane -hs scratch
References:
[1]: #pull-a-pane-from-any-other-session
[2]: #pushpull-from-scratch
jq has some syntax that will sneak up on you with complexity. It looks so good,
and so understandable, but everytime I go to use it myself, I don’t get it.
ijq is an interactive alternative to jq that gives you and nice repl that you
can iterate on queries quickly.
paru -Syu ijq
Here are some other articles, I decided to link at the time of writing this article.
JUT | Read Notebooks in the Terminal [1]
Comprehensive guide to creating kedro nodes [2]
Kedro - My Data Is Not A Table [3]
References:
[1]: /jut/
[2]: /kedro-node/
[3]: /kedro-pickle/
I am often editing my own scripts as I develop them. I want to make a better
workflow for working with scripts like this.
Currently # [1]
Currently I am combining nvim with a which subshell to etit these files
like this.
for now lets use my todo command as an example
nvim `which todo`
First pass # [2]
On first pass I made a bash function to do exactly what I have been doing.
ewhich () {$EDITOR `which "$1"`}
The $1 will pass the first input to the which subshell. Now we can edit our todo script like this.
ewich todo
Note, I use bash functions instead of aliases for things that require input.
Final State # [3]
This works fine for commands that are files, but not aliases or shell
functions. Next I jumped to looking at the output of command -V $1.
- if the command is not found, search for a file
- if its a builtin, exit
- if its an alias, open my ~/.alias file to that line
- if its a function, open my ~/.alias file to that line
ewhich () {
case `command -V $1` in
"$1 not found")
FILE=`fzf --prompt "$1 not found searching ..." --query $1`
[ -z "$FILE" ] && echo "closing" || $EDITOR $FILE;;
*"is a shell builtin"*)
echo "$1 is a builtin";;
*"is an alias"*)
$EDITOR...
GitPython is a python api for your git [1] repos, it can be quite handy when you
need to work with git from python.
Use Case # [2]
I recently made myself a handy tool for making screenshots in python and it
need to do a git commit and push from within the script. For this I reached
for GitPython.
How I Quickly Capture Screenshots directly into My Blog [3]
Installation # [4]
GitPython is a python library hosted on pypi that we will want to install
into our virtual environments using pip.
pip install GitPython
Create a Repo Object # [5]
Import Repo from the git library and create an instance of the Repo object by
giving it a path to the directory containing your .git directory.
from git import Repo
repo = Repo('~/git/waylonwalker.com/')
Two interfaces # [6]
from the docs
It provides abstractions of git objects for easy access of repository data,
and additionally allows you to access the git repository more directly using
either a pure python implementation, or the faster, but more resource
intensive git command implementation.
I only needed to use the more intensive but familar to me git command
implementation to get me project off the ground. There is a good
tutorial [...