<?xml version="1.0" encoding="utf-8" standalone="yes"?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">

  <channel>

    <title>Home on sebsch.dev</title>

    <link>https://sebsch.dev/</link>

    <description>Recent content in Home on sebsch.dev</description>

    <generator>Hugo -- gohugo.io</generator>

    <language>en-us</language>

    <lastBuildDate>Wed, 03 Jan 2024 00:00:00 +0000</lastBuildDate>

    

	<atom:link href="https://sebsch.dev/index.xml" rel="self" type="application/rss+xml" />

    

    

    <item>

      <title>Howto Encapsulate Serializing/Deserializing into FromStr and Display</title>

      <link>https://sebsch.dev/posts/2024-encapsulating-serde-into-string-operations/</link>

      <pubDate>Wed, 03 Jan 2024 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2024-encapsulating-serde-into-string-operations/</guid>

      <description>#[derive(Deserialize, Serialize, Debug)] struct Data { label: String, value: i32, description: String, } Problem Often when working with structural data and JSON you end up with a lot of boilerplate code like:
let my_data: Data = serde_json::from_str(json_string).unwrap(); let response = serde_json__to_string(&amp;amp;my_responsedata).unwrap(); Don&amp;rsquo;t get me wrong. The interface from serde is as good as it gets, but deserializing is not our problem here, actually we&amp;rsquo;re making Data objects from String representations and vice versa.</description>

    </item>

    

    <item>

      <title>Arduino Uno control the RGB LED in Rust</title>

      <link>https://sebsch.dev/posts/2023-rust-arduino-led-and-magic-with-traits/</link>

      <pubDate>Sun, 10 Sep 2023 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2023-rust-arduino-led-and-magic-with-traits/</guid>

      <description>Lately I got myself a Arduino Uno compatible device. Since I do not really like to do my stuff in C and to avoid having all the very cool tutorial snippets just for free, I decided to start implement a beginners project in rust.
The final implementation can be found here
Project goal I am using one of the most simple tutorials and bring it a bit further by implementing a slow color changing effect on a LED using the PWM Pins 6(Red), 5(Green), 3(Blue).</description>

    </item>

    

    <item>

      <title>Plug Websockets into Djangos ASGI-Consumers</title>

      <link>https://sebsch.dev/posts/2022-django-channels-websockets/</link>

      <pubDate>Sun, 23 Jan 2022 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2022-django-channels-websockets/</guid>

      <description>This is a recap of an POC how to plug websockets into a django backend and allow communication between the consumer instances using channels. There will not a lot of documentation found here, please go to the Django docs if you&amp;rsquo;re interested into details
Installation Assumptions:
 (Django &amp;gt;= 3) is installed and a project is created. channels is installed. For testing websocket connections node-ws is installed (apt install node-ws)  Note: For the sake of simplicity no app is created, everything just lives in the project-app.</description>

    </item>

    

    <item>

      <title>Watching Linux Processes in rust/tokio async</title>

      <link>https://sebsch.dev/posts/2021-watch-linux-processes-tokio/</link>

      <pubDate>Sat, 17 Apr 2021 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2021-watch-linux-processes-tokio/</guid>

      <description>preface As playing around with rust on linux, I decided to transfer the [async python process reader]https://sebsch.dev/posts/2021-watch-linux-processes-async/ into a rust / tokio codebase. I changed the architecture a bit, to clarify the pattern.
differences to the previous architecture no pub/sub sync channel Although it is often a good idea to decouple elements of the code, the producer/consumer on the former example did not make too much sense. Since we just consume the massages and immediately dispatch the futures via fire-and-forget it just brings a lot of complexity including a sync-channel.</description>

    </item>

    

    <item>

      <title>Watching Linux Processes in python async</title>

      <link>https://sebsch.dev/posts/2021-watch-linux-processes-async/</link>

      <pubDate>Sun, 28 Mar 2021 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2021-watch-linux-processes-async/</guid>

      <description>preface In the last time I&amp;rsquo;m tinkering a bit with asyncio and Linux processes. During this I tried to combine these by writing a prgramm to watch all processes of the current user and log all process outputs into one shell.
Note: There will be a lot of file openings and saving of logs in memory. I didn&amp;rsquo;t optimize the code a lot, so keep an eye on your memory if you decide to run the examples!</description>

    </item>

    

    <item>

      <title>Watchdog timer</title>

      <link>https://sebsch.dev/posts/2021-watchdog-timer/</link>

      <pubDate>Mon, 08 Feb 2021 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2021-watchdog-timer/</guid>

      <description>Sometimes it can be really important to see if something is called in a periodic manner. You could think about a webservice in a quite messy environment. One of its clients dies sometimes without any error, and the only way to fix the problem is to reset the connection.
This is a situation when a watchdog timer, or a dead men&amp;rsquo;s switch becomes handy.
To show the functionality here is a small example.</description>

    </item>

    

    <item>

      <title>About sebsch</title>

      <link>https://sebsch.dev/about/</link>

      <pubDate>Sun, 10 May 2020 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/about/</guid>

      <description>I&amp;rsquo;m a software engikneer from Berlin Germany.
With a strong profession to opensource software and linux I love to write good and sustainable backend code in python, go and rust. Also working on fully automated infrastructure projects, including kubernetes, ansible and docker, via quality ensuring CI/CD environments is also a big part of my toolset.
If you have any questions, just write me via e-mail.</description>

    </item>

    

    <item>

      <title>Scrape Kita-Navigator into Excel</title>

      <link>https://sebsch.dev/posts/2020-kitas-berlin/</link>

      <pubDate>Thu, 30 Apr 2020 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2020-kitas-berlin/</guid>

      <description>Berlin has this gorgeous tool to find Kitas: The Kita Navigator. However as far as I know, there is no way to extract the data in any format like excel or csv.
Since I am not the guy having a lot of fun, klicking through Web-GUIs I wrote a little script to extract all of the needed data. The page is unfortunately one of these webpages you can&amp;rsquo;t read without activated JS , so I had to use Selenium to scrape all the information out of the pages.</description>

    </item>

    

    <item>

      <title>Builder pattern in rust</title>

      <link>https://sebsch.dev/posts/2020-rust-builder-pattern/</link>

      <pubDate>Sun, 26 Apr 2020 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2020-rust-builder-pattern/</guid>

      <description>This is a short scratch of the builder pattern implemented in rust. In this example we are building a url with different query parameters.
use std::collections::HashMap; struct UrlBuilder { queries: HashMap&amp;lt;String, String&amp;gt;, base_url: String } impl UrlBuilder { pub fn new(base_url: &amp;amp;str) -&amp;gt; Self{ Self {base_url: String::from(base_url), queries: HashMap::new()} } pub fn as_string(&amp;amp;self) -&amp;gt; String { let mut query_string = String::new(); for (k, v) in &amp;amp;self.queries { query_string = match query_string.</description>

    </item>

    

    <item>

      <title>Git clone and delete after using</title>

      <link>https://sebsch.dev/posts/2018-context_managers/</link>

      <pubDate>Sun, 19 Aug 2018 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2018-context_managers/</guid>

      <description>Automatic changes in a git-repository can cause merge-conflicts. Therefore it can be handy to temporary clone the remote, do your changes and delete the repo after the changes are pushed. The following code does this with the help of a context-manager.
from git import Repo from shutil import rmtree class GitRepositoryContextManager(object): def __init__(self, remote, file_path, branch=&amp;#39;master&amp;#39;): self.file_path = file_path self.repo = Repo.clone_from(remote, self.file_path, branch=branch) def __enter__(self): return self.repo def __exit__(self, exc_type, exc_val, exc_tb): rmtree(self.</description>

    </item>

    

    <item>

      <title>Timeout decorator</title>

      <link>https://sebsch.dev/posts/2018-decorators/</link>

      <pubDate>Sat, 18 Aug 2018 00:00:00 +0000</pubDate>

      

      <guid>https://sebsch.dev/posts/2018-decorators/</guid>

      <description>Sometimes it makes sense to end a method when a defined point in time is exceeded. The following code shows a decorator that will end any decorated function after the defined time.
import signal TASK_TIMEOUT = 4 class Timeout(Exception): pass def timed_task(method): def _handle_timeout(signum, frame): raise Timeout(&amp;#34;Task TIMEOUT! [{} Seconds]&amp;#34;.format(TASK_TIMEOUT)) def timed(*args, **kw): signal.signal(signal.SIGALRM, _handle_timeout) signal.alarm(TASK_TIMEOUT) try: result = method(*args, **kw) finally: signal.alarm(0) return result return timed To use this we have just decorate a function and whait til the exception is thrown.</description>

    </item>

    

  </channel>

</rss>
