We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
I made a little spinoff of the blog to write about traveling with Selmi. It is in German.
Today I want to share a small little tool, which converts your favorite images and wallpapers with a given color palette. This makes it inedible easy to create a consist styling. And your style is everything.
The tool is called dipc and is of course written in Rust. Give it a try!
I used the following settings for the header image.
dipc -s "Dark mode" gruvbox original_image.jpg
Btw. do you know which delicious fungi is featured in the header?
I am not the most passionate youtube consumer. I mainly watch educational videos (How to repair XY, how to do something), but there are a few exceptions of course. Both recommendations here are german and I know the creators, so I might be a bit biased.
Pfadgefährten
Hannes and Tobi are hiking with different animals in the Kyrgyz mountains. Right now only the trailer is available, but seems like a great adventure. Also Hannes is my landlord and he is a great guy, who knows how to tell stories. Trailer
Sailing Lea
Johannes and Olena are sailing around the world with their yacht. Great pictures and the relaxed sailor lifestyle are making me quite jealous. I can connect, as I also enjoy sailing and I have briefly met Johannes two or three times. Channel
In the last months I added and also removed some content from the thepid.de. Three new pages are waiting for you to be explored.
view /gardencam
content
Have a look in my garden and enjoy the green scenery. You can also see how the weather conditions are in the garden.
tech
Pictures are taken with a Logitech external webcam attached to a rpi4. motioneye is taking care of the webcam feed and shooting of the pictures. Pictures are uploaded to a self-hosted minio instance. Temperature, humidity and pressure readings are from a ruuvi tag, which is integrated in the home assistant instance running on the same rpi4. Home assistant sends the data to a self-hosted influxdb database, which is then queried from thepid.de
now /now
content
I think this one is pretty self-explaining. Just have a look.
tech
Hard-coded for now.
starred /starred
content
A list of blog posts, which I have starred in my feed reader. Probably pretty random, german, english, mixed topics. Not very curated at the moment. But I guess it will improve.
tech
Simple API call to my self-hosted miniflux instance. Love it.
This year has been an exceptionally good for chili. As you may not know I like hot food and have become a passionate chili gardener and consumer.
The harvest
Unlike previous years I could harvest a lot of chilies already in July and August. I think this is because I overwintered some plants and also build a raised bed, which dramatically accelerates the growth of the plants. I grow several chili strains this year, including two different kinds of habaneros, scotch bonnets, lemon drop, and some others I forgot the name ;)
Preparation
The sauce I prepared this time was more or less free style with ingredients readily available in the garden and kitchen. I like to combine chili with something fruity. This time I used figs from the garden and pears picked from some trees.
Preparation is easy. Cut the chilies and fruits, roast or cook them for some minutes, add some vinegar and lemon juice and finally blend it!
The result
Very tasty and also pretty hot.
I like being able to subscribe to random websites using rss/atom feeds. I self host a miniflux instance, where I manage my subscriptions and read articles. So naturally I wanted to implement such a feed also for thepid.de. I mean how hard can that be?
Basically it involves two steps
- Implementing a function, which builds the feed
- Serving the feed as raw xml
The first step was straightforward as soon as I stumbled upon the Atomex
library. I just had to copy the example from the docs and make some adoptions regarding my schema.
alias Atomex.Entry
alias Atomex.Feed
def build_feed(posts) do
"https://thepid.de"
|> Feed.new(DateTime.utc_now(), "ThePid Feed")
|> Feed.author("THE", email: "thepid@mailbox.org")
|> Feed.link("https://thepid.de/feed", rel: "self")
|> Feed.entries(Enum.map(posts, &get_entry/1))
|> Feed.build()
|> Atomex.generate_document()
end
defp get_entry(post) do
inserted_at = DateTime.from_naive!(post.inserted_at, "Europe/Berlin", Tz.TimeZoneDatabase)
updated_at = DateTime.from_naive!(post.updated_at, "Europe/Berlin", Tz.TimeZoneDatabase)
content = Earmark.as_html!(post.content, %Earmark.Options{code_class_prefix: "language-", smartypants: false})
"https://thepid.de/blog/#{post.id}"
|> Entry.new(updated_at, "#{post.title}")
|> Entry.content(content, type: "html")
|> Entry.published(inserted_at)
|> Entry.build()
end
The build_feed
function builds the feed with entries, created through the get_entry
function.
I decided to include the whole article as html in the feed, so you can read everything through your reader application.
Unfortunately this is not possible with some feeds out there.
Now we have to serve the generated document at the /feed route. Therefor just add this line to your router.ex
scope "/", ThePidWeb do
pipe_through :browser
get "/feed", FeedController, :index
end
The router will try to hit the feed controller with an index function.
defmodule ThePidWeb.FeedController do
use ThePidWeb, :controller
plug :put_layout, false
plug :put_root_layout, false
def index(conn, _assigns) do
conn
|> put_resp_content_type("text/xml")
|> render(:feed)
end
end
Here I specified the response type as text/xml and removed all layouts.
Finally the render functions expects a view with a feed function.
This is were the build_feed
function is finally called.
defmodule ThePidWeb.FeedHTML do
use ThePidWeb, :html
alias ThePid.Blog
def feed(_assigns) do
Blog.get_all_posts()
|> Blog.build_feed()
|> Phoenix.HTML.raw()
end
end
That's it. Easy peasy. Subscribe now.
While developing a certain part of thepid.de I needed to input datetime into a form.
Luckily html got you covered with datetime-local
as type attribute for an input field, which works well.
However I was pretty annoyed that the format of the datetime input in my browser was the American AM/PM format.
My computer language is set to English, but locale for Date, Currency, etc.. is set to German.
This is done by setting the correspondingLC_
variables. Turns out firefox does not care about that.
After some kagiing I found a solution: Go to about:config and switch intl.regional_prefs.use_os_locales
to true.
Thanks Zibi Braniecki.
Now it looks so good.
I want to recommend the shop of my friend Jones, who has recently become a craftsman. He has acquired a decent CNC for woodworking and creates now some beautiful earrings.
I firsthand know his customers are very pleased and can affirm the superb quality of the artwork with my own hands.
Hi there. My name is Tobi and this is my freshly created homepage. Here I want to write some interesting things which I come across in my life. Also I want to improve my coding skills and play with Phoenix and Elixir.