Outer perimeter fence under construction around the base during Day 4.The roofline of the base is complete and the tree farm is cleared for fresh oak and acacia saplings.Sun setting over the fresh house frame as Day 2 brings sand collection for windows.The wooden frame of the new house begins to take shape on Day 1.
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.
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.
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_erroriferrorlevel1(echo An error occurred!
exit /b 1
)
To use this function in your script, you would simply call it after running a
command, like this:
some_command
call:check_error
This would run the “some_command” and then call the “check_error” function to
check the exit status and handle any errors that may have occurred. This
approach allows you to reuse the error-checking logic in your script, which can
make it easier to write and maintain.
Acacia biome spawn with trees and resources in a new hardcore world.
This is my first time journaling a Minecraft hardcore world, my son Wyatt is
also documenting his journey in a survival world on
wyattbubbylee.com [1].
Day 0 # [2]
init
[3]
I logged into a brand new hardcore world. I was welcomed by a great Acacia
biome spawn full of resources. I quickly cut my first tree, crafted an axe and
set out to find my first sheep. I was able to find enough sheep for a bed,
several cows and pigs.
I crafted a set of wooden tools, and farmed out a wheat farm till my wooden
hoed died at the shore of a nearby stream. I found a small stone outcropping
in the side of a hill and harvested nearly a full stack of cobblestone from my
first wooden pick.
I ended the first day by sleeping in my bed safe from mobs.
Achievements # [4]
- bed
- furnace
- stone
- wheat farm
Day 1 # [5]
[6]
Thoughout the course of day one I collected wood and started the framework for
my new house.
Day 2 # [7]
[8]
The sun sets over the new frame of my house on Day 1
Day two...
Looking for inspiration? sshfs [1] by libfuse [2].
A network filesystem client to connect to SSH servers
References:
[1]: https://github.com/libfuse/sshfs
[2]: https://github.com/libfuse
I recently setup some vm’s on my main machine and got sick of signing in with
passwords.
ssh-keygen
ssh-copy-id -i ~/.ssh/id_rsa.pub virt
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.
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 horizonallybind -n M-f join-pane -ht scratch
# pull the last active pane from the scratch session horizonally into this sessionbind -n M-F join-pane -hs scratch
joehillen [1] has done a fantastic job with sysz [2]. Highly recommend taking a look.
An fzf terminal UI for systemctl
References:
[1]: https://github.com/joehillen
[2]: https://github.com/joehillen/sysz
I like eth-p’s [1] project bat-extras [2].
Bash scripts that integrate bat with various command line tools.
References:
[1]: https://github.com/eth-p
[2]: https://github.com/eth-p/bat-extras
Just starred clipmenu [1] by cdown [2]. It’s an exciting project with a lot to offer.
Clipboard management using dmenu
References:
[1]: https://github.com/cdown/clipmenu
[2]: https://github.com/cdown
I’m impressed by neix [1] from qw3rtty [2].
neix - a RSS/Atom feed reader for your terminal.
References:
[1]: https://github.com/qw3rtty/neix
[2]: https://github.com/qw3rtty
rwhitt2049 [1] has done a fantastic job with df-viewer-poc [2]. Highly recommend taking a look.
No description available.
References:
[1]: https://github.com/rwhitt2049
[2]: https://github.com/rwhitt2049/df-viewer-poc
The work on ansible-vault-pre-commit [1] by pypeaday [2].
pre-commit hook to ensure sensitive info in a repo is encrypted with ansible-vault
References:
[1]: https://github.com/pypeaday/ansible-vault-pre-commit
[2]: https://github.com/pypeaday
The work on PySnooper [1] by cool-RR [2].
Never use print for debugging again
References:
[1]: https://github.com/cool-RR/PySnooper
[2]: https://github.com/cool-RR
I just shared some ssh keys with myself and ran into this error telling me that
I did not set the correct permissions on my key.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0750for'/home/waylon/.ssh/id_*******' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/home/waylon/.ssh/id_*******": bad Permissions
repo: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Mr-Destructive [1] has done a fantastic job with djankata [2]. Highly recommend taking a look.
Django + Markata blog starter
References:
[1]: https://github.com/Mr-Destructive
[2]: https://github.com/Mr-Destructive/djankata
Check out nvim [1] by Allaman [2]. It’s a well-crafted project with great potential.
Minimal, blazingly fast, and pure Lua based Neovim configuration for my work as DevOps/Cloud Engineer with batteries included for Python, Golang, and, of course, YAML
References:
[1]: https://github.com/Allaman/nvim
[2]: https://github.com/Allaman
Looking for inspiration? dotfiles [1] by jessarcher [2].
$HOME sweet $HOME
References:
[1]: https://github.com/jessarcher/dotfiles
[2]: https://github.com/jessarcher
With the latest release of version of nvim 0.8.0 we get access to a new winbar
feature. One thing I have long wanted somewhere in my nvim is navigation for
pairing partners or anyone watching can keep track of where I am. As the
driver it’s easy to keep track of the file/function you are in. But when you
make big jumps in a few keystrokes it can be quite disorienting to anyone
watching, and having this feedback to look at is very helpful.
Then you need to use that on_attach function on all of the lsp’s that you
want navic to work on.
Then in a lua file you need to setup the winbar, for now I put this in my
lsp-config settings file, but eventually I want to move my settings to lua and
put it there.
Just starred nvim-navic [1] by SmiteshP [2]. It’s an exciting project with a lot to offer.
Simple winbar/statusline plugin that shows your current code context
References:
[1]: https://github.com/SmiteshP/nvim-navic
[2]: https://github.com/SmiteshP
I came across winbar.nvim [1] from fgheng [2], and it’s packed with great features and ideas.
winbar config for neovim
References:
[1]: https://github.com/fgheng/winbar.nvim
[2]: https://github.com/fgheng
I came across pre-commit [1] from pre-commit [2], and it’s packed with great features and ideas.
A framework for managing and maintaining multi-language pre-commit hooks.
References:
[1]: https://github.com/pre-commit/pre-commit
[2]: https://github.com/pre-commit
I really like having global cli command installed with pipx. Since textual
0.2.x (the css release) is out I want to be able to pop into textual devtools
easily from anywhere.
In order to install optional dependencies with pipx you need to first install
the library, then inject in the optional dependencies using the square bracket
syntax.
I am working through the textual tutorial, and I want to put it in a proper cli
that I can pip install and run the command without textual run --dev app.py.
This is a fine pattern, but I also want this to work when I don’t have a file
to run.
Now to get devtools through a cli without running through textual run --dev.
I pulled open the textual cli source code, and this is what it does at the time
of writing.
Note: I used sys.argv as a way to implement a --dev quickly tutorial. For a
real project, I’d setup argparse, click, or typer. typer is my go to these
days, unless I am really trying to limit dependencies, then the standard
library argparse might be what I go with.
deftui():fromtextual.featuresimportparse_featuresimportosimportsysdev="--dev"insys.argv# this works, but putting it behind argparse, click, or typer would be much betterfeatures=set(parse_features(os.environ.get("TEXTUAL","")))ifdev:features.add("debug")features.add("devtools")os.environ["TEXTUAL"]=",".join(sorted(features))app=StopwatchApp()app.run()if__name__=="__main__":tui()
I like AnH0ang’s [1] project kedro-aim [2].
A kedro plugin that enables logging to the ml experiment tracker aim
References:
[1]: https://github.com/AnH0ang
[2]: https://github.com/AnH0ang/kedro-aim
The work on PrismLauncher [1] by PrismLauncher [2].
A custom launcher for Minecraft that allows you to easily manage multiple installations of Minecraft at once (Fork of MultiMC)
References:
[1]: https://github.com/PrismLauncher/PrismLauncher
[2]: https://github.com/PrismLauncher
I’m really excited about learn-cloudformation [1], an amazing project by widdix [2]. It’s worth exploring!
Learn how to use Infrastructure as Code on AWS with the help of CloudFormation.
References:
[1]: https://github.com/widdix/learn-cloudformation
[2]: https://github.com/widdix
For far too long I have had to fidget with v4l2oloopback after reboot. I’ve
had this happen on ubuntu 18.04, 22.04, and arch.
After a reboot the start virtual camera button won’t work, It appears and is
clickable, but never turns on. Until I run this command.
sudo modprobe v4l2loopback video_nr=10card_label="OBS Video Source"exclusive_caps=1
Today I learned that you can turn on kernel modules through some files in /etc/modules...
This is what I did to my arch system to get it to work right after boot.
echo"v4l2loopback"| sudo tee /etc/modules-load.d/v4l2loopback.conf
echo"options v4l2loopback video_nr=10 card_label=\"OBS Video Source\" exclusive_caps=1"| sudo tee /etc/modprobe.d/v4l2loopback.conf
I ran into an issue where I was unable to ask localstack for its status. I
would run the command and it would tell me that it didn’t have permission to
read files from my own home directory. Let’s fix it
It dawned on me that the first time I ran localstack was straight docker, not
the python cli. When docker runs it typically runs as root unless the
Dockerfile sets up a user and group for it.
If you have sudo access to the machine you are on you can recursively change
ownership to your user and group. I chose to just give myself ownership of my
whole ~/.cache directory you could choose a deeper directory if you want. I
feel pretty safe giving myself ownership to my own cache directory on my own
machine.
The first example that you can use right now is markata-gh. It will render
repos by GitHub topic and user using the gh cli, which is available in github
actions!
Get it with a pip install
pip install markata-gh
Use it with some jinja in your markdown.
## Markata plugins
It uses the logged in uer by default.
{% gh_repo_list_topic "markata" %}
You can more explicitly grab your username, and a topic.
{% gh_repo_list_topic "waylonwalker", "personal-website" %}
The jinja extension details are for another post, but this is how markata-gh
exposes itslef as a jinja extension.
classGhRepoListTopic(Extension):tags={"gh_repo_list_topic"}def__init__(self,environment):super().__init__(environment)defparse(self,parser):line_number=next(parser.stream).linenotry:args=parser.parse_tuple().itemsexceptAttributeError:raiseAttributeError("Invalid Syntax gh_repo_list_topic expects <username>, or <username>,<topic> both must have the comma")returnnodes.CallBlock(self.call_method("run",args),[],[],"").set_lineno(line_number)defrun(self,username=None,topic=None,caller=None):"get's markdown to inject into post"returnrepo_md(username=username,topic=topic)
In my adventure to learn django, I want to be able to setup REST api’s to feed
into dynamic front end sites. Potentially sites running react under the hood.
I already have the following model from last time I was playing with django. It
will suffice as it is not the focus of what I am learning for now.
Note the name of the model class is singular, this is becuase django will
automatically pluralize it in places like the admin panel, and you would end
up with Itemss.
fromdjango.dbimportmodels# Create your models here.classItem(models.Model):name=models.CharField(max_length=200)created=models.DateTimeField(auto_now_add=True)def__str__(self):returnf"{self.priority}{self.name}"
Next I will make some dummy data to be able to return. I popped open ipython
and made a few records.
Next we need to set up a serializer to seriaze and de-serialize data between
our model and json. You can specify each field individually or all of them by
passing in __all__.
Now we need a view leveraging the djangorestframework. The serializer we
just created will be used to serialize all of the rows into a list of objects
that Response can handle.
Note: to return a collection of model objects we need to set many to True
Markata 0.5.0 is now out, and it’s huge. Even though it’s the backend of this
blog I don’t actually have that many posts directly about it. I’ve used it a
bit for blog fuel in generic ways, like talking about pluggy and diskcache, but
very little have I even mentioned it.
Over the last month I made a big push to get 0.5.0 out, which adds a whole
bunch of new configurability to markata.
Before cutting all of my personal projects over to hatch. The first thing I
did was to setup a solid github action,
hatch-actionthat I can resue.
It automatically bumps versions, using pre-releases on all branches other than
main, with special branches for bumping major, minor, patch, dev, alha, beta,
and dev.
To convert the project over to hatch, and get rid of setup.py/setup.cfg, I ran
hatch new --init. This automatically grabs all the metadata for the project
and makes a pyproject.toml that has most of what I need.
hatch new --init
I then manually moved over my isort config, put flake8 config into .flake8,
and dropped setup.cfg.
Part of my hatch-action is to run a before-command, for markata, this runs
all of my linting and testing in one hatch script called lint-test. If this
fails CI will fail and I can read the report in the logs, make a fix and
re-publish.
My typical workflow is to work on features in their own branch where they do
not automatically version or publish, they keep the same version they were
branched off of. Then I do a pr to develop, which will do a minor,dev bump
and publish a pre-relese to pypi.
# starting with version 0.0.0
Feature1 -- │
Feature2 -- ├── dev 0.1.0.dev1,2,3 ── main 0.1.0
Feature3 -- │
I will let several features collect in develop before cutting a full relese
over to main. This gives me time to make sure the solution is what makes the
most sense, I try to use it in a few projects, and generally its edges show,
and another pr is warranted to make the feature useful for more use cases.
After running and using these new releases in a few projects, I am confident
that its ready and release to main.
hatch makes building and publishing pretty straightforward. It’s one command
inside my hatch-action to build and one to publish. On each project that uses
my hatch-action I only need to give it a token that I get from PyPi.
lkwq007 [1] has done a fantastic job with stablediffusion-infinity [2]. Highly recommend taking a look.
Outpainting with Stable Diffusion on an infinite canvas
References:
[1]: https://github.com/lkwq007
[2]: https://github.com/lkwq007/stablediffusion-infinity
Check out toumorokoshi [1] and their project deepmerge [2].
A deep merging tool for Python core data structures
References:
[1]: https://github.com/toumorokoshi
[2]: https://github.com/toumorokoshi/deepmerge
My next step into django made me realize that I do not have access to the admin panel, turns out that I need to create a cuper user first.
My next issue trying to run off of a separate domain was a cross site request
forgery error.
Since this is a valid domain that we are hosting the app from we need to tell
Django that this is safe. We can do this again in the settings.py, but this
time the variable we need is not there out of the box and we need to add it.
You might find these settings helpful as well if you are trying to run your
site on a remote host like aws, digital ocean, linode, or any sort of cloud
providor. I had it running in my home lab while I was out of the house and
ssh’d in over with a chromebook.
I am continuing my journey into django, but today I am not at my workstation. I
am ssh’d in remotely from a chromebook. I am fully outside of my network, so I
can’t access it by localhost, or it’s ip. I do have cloudflared tunnel
installed and dns setup to a localhost.waylonwalker.com.
I found this in settings.py and yolo, it worked first try. I am in from my
remote location, and even have auth taken care of thanks to cloudflare. I am
really hoping to learn how to setup my own auth with django as this is one of
the things that I could really use in my toolbelt.
ALLOWED_HOSTS=['localhost.waylonwalker.com']
I have no experience in django, and in my exploration to become a better python
developer I am dipping my toe into one of the most polished and widely used web
frameworks Django to so that I can better understand it and become a better
python developer.
If you found this at all helpful make sure you check out the django tutorial
The first thing I need to do is render out a template to start the project.
For this I need the django-admin cli. To get this I am going the route of
pipx it will be installed globally on my system in it’s own virtual
environment that I don’t have to manage. This will be useful only for using
startproject as far as I know.
pipx install django
django-admin startproject try_django
cd try_django
Once I have the project I need a venv for all of django and all of my
dependencies I might need for the project. I have really been diggin hatch
lately, and it has a one line “make a virtual environment and manage it for
me” command.
hatch shell
If hatch is a bit bleeding edge for you, or it has died out by the time you
read this. The ol trusty venv will likely stand the test of time, this is what
I would use for that.
Next up we need to start the webserver to start seeing that development
content. The first thing I did was run it as stated in the tutorial and find
it clashed with a currently running web server port.
python manage.py runserver
I jumped over to that tmux session, killed the process and I was up and running.
I opened up the urls.py to discover that the only configured url was at
/admin. I tried to log in as admin, but was unable to as I have not yet
created a superuser. Next time I play with django that is what I will explore.
While updating my site to use Markata’s new configurable head I ran into some
escaping issues. Things like single quotes would cause jinja to fail as it was
closing quotes that it shouldnt have.
Jinja comes with a handy utility for escaping strings. I definitly tried to
over-complicate this before realizing. You can just pipe your variables into
e to escape them. This has worked pretty flawless at solving some jinja
issues for me.
The issue I ran into was when trying to setup meta tags with the new
configurable head, some of my titles have single quotes in them. This is what
I put in my markata.toml to create some meta tags.
[[markata.head.meta]]name="og:title"content="{{ title }}"
Using my article titles like this ended up causing this syntax error when not
escaped.
After making a complicated system of using html.escape I realized that jinja
included escaping out of the box so I updated my markata.toml to include the
escaping, and it all just worked!.
When I am developing python code I often have a repl open alongside of it
running snippets ofcode as I go. Ipython is my repl of choice, and I hace
tricked it out the best I can and I really like it. The problem I recently
discovered is that I have way overcomplicated it.
So in the past the way I have setup a few extensions for myself is to add
something like this to my ~/.ipython/profile_default/startup directory. It
sets up some things like rich highlighting or in this example automatic
imports. I even went as far as installing some of these in the case I didn’t have them installed.
I missed the fact that some of these tools like pyflyby and rich already
have an ipython extension maintained by the library that just works. It’s less
complicated and more robust to future changes in the library. If anything ever
changes with these I will not have to worry about which version is installed,
the extension will just take care of itself.
The issue that I found with this is that you can end up with a sea of errors
flooding your terminal. Personally I will know immediately if ipython is
working right or not and typically have scriped venv installs so I have
everything I need, so If I don’t have everything it’s probably for a reason and
I don’t need an error message lighting up.
My way around this was to test if the module was importable and if it had a
load_ipython_extension attribute before appending it as an extension.
defactivate_extension(extension):try:mod=importlib.import_module(extension)getattr(mod,"load_ipython_extension")c.InteractiveShellApp.extensions.append(extension)exceptModuleNotFoundError:"extension is not installed"exceptAttributeError:"extension does not have a 'load_ipython_extension' function"extensions=["rich","markata","pyflyby"]forextensioninextensions:activate_extension(extension)
I like pypeaday’s [1] project stable-diffusion-pype-dev [2].
No description available.
References:
[1]: https://github.com/pypeaday
[2]: https://github.com/pypeaday/stable-diffusion-pype-dev
Check out gradio-app [1] and their project gradio [2].
Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
References:
[1]: https://github.com/gradio-app
[2]: https://github.com/gradio-app/gradio
Just starred stable-diffusion-webui [1] by AUTOMATIC1111 [2]. It’s an exciting project with a lot to offer.
Stable Diffusion web UI
References:
[1]: https://github.com/AUTOMATIC1111/stable-diffusion-webui
[2]: https://github.com/AUTOMATIC1111
kedro-plugins [1] by kedro-org [2] is a game-changer in its space. Excited to see how it evolves.
First-party plugins maintained by the Kedro team.
References:
[1]: https://github.com/kedro-org/kedro-plugins
[2]: https://github.com/kedro-org
If you’re into interesting projects, don’t miss out on knossos [1], created by modrinth [2].
[Archived] Former repo of the Modrinth frontend
References:
[1]: https://github.com/modrinth/knossos
[2]: https://github.com/modrinth