<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Bernard Ališauskas on Medium]]></title>
        <description><![CDATA[Stories by Bernard Ališauskas on Medium]]></description>
        <link>https://medium.com/@wraptile?source=rss-7f9a1e5bba4a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*R_T1ewcUqaUcOafGBV3SKA.jpeg</url>
            <title>Stories by Bernard Ališauskas on Medium</title>
            <link>https://medium.com/@wraptile?source=rss-7f9a1e5bba4a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 13:19:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@wraptile/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Short Story: The Hum]]></title>
            <link>https://medium.com/@wraptile/the-hum-6ba8828540b8?source=rss-7f9a1e5bba4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ba8828540b8</guid>
            <category><![CDATA[short-fiction]]></category>
            <category><![CDATA[short-story]]></category>
            <category><![CDATA[science-fiction]]></category>
            <category><![CDATA[fiction]]></category>
            <dc:creator><![CDATA[Bernard Ališauskas]]></dc:creator>
            <pubDate>Sun, 04 Oct 2026 08:42:53 GMT</pubDate>
            <atom:updated>2026-10-04T14:59:36.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bF31dSU6o6wW8KWJUqfVsg.png" /></figure><p>It’s started with a faint hum.</p><p>Nobody noticed it at first but the most sensitive earthquake detection machines — a faint hum come from inside the earth. It moved the needle of each device in the region at the same, constant pace. A background noise?</p><p>As scientists gathered and started to ponder upon the cause and meaning of the hum it was mostly dismissed and attributed to gasses and similar boring underground activities.</p><p>The news broke quickly, and the internet started to have its way with it. Eventually people have started to claim to hear the hum and claim its effects on them. It was not possible, the hum was not detectible by human ears.</p><p>Around 100 days after the hum was discovered it became louder. A human ear could hear it now.</p><p>The hum was everywhere, a background noise vibrating from earth crust itself. At first, people got hyped and scared. Wrote songs and made memes, started conspiracy theories. Until, human ear adapted to hum and after 2 years started to completely ignore it.</p><p>For science, the hum was not ignored so easily. Geologists took the spotlight trying to explain it: global warming causing the underground liquid and gas to vibrate at constant matter was the leading theory. Some managed to emulate the hum in lab conditions.</p><p>For 5 more years the hum did not change. Then it got louder again.</p><p>People paid attention again. This time with more fear. Surely this sudden increase meant something? The last hum happened at the same time as ice peaks melted and ocean currents shifted. Global warming, now much scarier than ever and hum is to tell.</p><p>New funding raised for sciences starts several hum programs. As scientists toll on new devices to detect the origins of the hum people grow frustrated. The hum is very audible now.</p><p>With public pressure and haste new drills are deployed to drill deep into the earth’s crust to understand the hum better. Within 100 days from 5 year mark the drills are operational.</p><p>The drill progress is followed all over the world. What is it? What is the hum? Each day of drilling is counted, and each day is full of online discussions. “28th drill day review”, “US drill leads Chinese drills”, “China finds insights in 32nd day of drilling leaping US”, “Japanese drill stops due to fears of causing an earthquake”, “EU holds meetings to begin first drills, returns abroad geologists”…</p><p>As the drills reached hundreds days the drilling slowed. It was hard to drill to such depths and no new information was being received. The hum kept on but interest in it died down as the world had other problems still. The ice caps were still melting. The wars were still fought, and the hum still hummed in the background.</p><p>A breakthrough, finally. The hum changed again. Now it’s a pattern. The stations in US, China, Russia — all around the world receive the same pattern. The hum now speaks? It’s 3 distinct sounds in a repeating patter of 3:</p><blockquote>— .-</blockquote><p>Everyone hears the hum, it gives rhythm to the world.</p><p>More discussions are raised: “the hum is getting worse”, “the hum is getting better”, “the hum is mother earth communicating with us”, “the hum is the voice of Jesus Christ”, “the hum is a groove to dance to”.</p><p>Time goes and the 3-rythm breaks and becomes unpredictable pattern of the same 3 noises:</p><blockquote>— .. — - — — .. — ­</blockquote><p>The scientists continue to send new sensors and machines down the drill holes to figure out the hum. The leading theories of gas and liquid flows beneath the deep surface.</p><p>The world rhythm is now broken. Satisfying 3 tone hum is now broken into random madness. People are upset. “It’s this annoying constant noise”. Does not exactly drown but cover the songs of birds, chirps of grasshoppers and surfs of ocean waves.</p><p>Just 3 days into random hum patterns everything changed. It might not be a random pattern anymore? First computer algorithms decipher a message — it feels like a greeting?</p><p>The biggest AI labs rush into decoding and translating it with various takes from “hello, this is earth my children” to “we are an alien race here to destroy you”. Everyone listens and seemingly everyone has a translation.</p><p>More translations pour with entire live events and horoscope reads: “What does the hum say about today for Scorpios?”, “Hum says today is a good day to invest into stocks”, “The hum commemorates the death of a famous singer by performing their song”.</p><p>Increasingly the hum is part of everything.</p><p>As time goes anything and everything can be found in the hum. It’s a pattern that seemingly contains all questions and answers. The hum becomes part of human society, a fabric underneath it influencing every decision made.</p><p>“It’s completely random noise” is the de facto science take “it’s just noise”.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ba8828540b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Scaling with Chancy — my favorite postgres based task queue for Python]]></title>
            <link>https://medium.com/@wraptile/scaling-with-chancy-my-favorite-postgres-based-task-queue-for-python-c23b5b88fd32?source=rss-7f9a1e5bba4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c23b5b88fd32</guid>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Bernard Ališauskas]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 11:33:49 GMT</pubDate>
            <atom:updated>2026-08-11T11:33:49.247Z</atom:updated>
            <content:encoded><![CDATA[<h3>Scaling with Chancy — my favorite postgres based task queue for Python</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*11ln36rbxuPTDUi0HKjS4w.png" /></figure><p>If you ever scalled anything you’re probably familiar with tasks queues like celery, rabbitmq, redis streams etc. where some producers create tasks and horizontally scaled N workers consume them to complete work.</p><p>There are a lot of great task queue frameworks out there, but I want to show you Chancy — a postgres db based task queue that focuses on simplicity and transparency which is <strong>so powerful in LLM-powered development</strong> right now.</p><p>I’ve been using chancy for almost a year now, and I really love it, let me sell you on this free and open source framework.</p><p><a href="https://github.com/TkTech/chancy">GitHub - TkTech/chancy: A postgres-backed task queue for Python.</a></p><p><em>For example code I’ve made a small demo skeleton on github:</em></p><p><a href="https://github.com/Granitosaurus/chancy-demo">GitHub - Granitosaurus/chancy-demo: demo skeleton for chancy powered task queue</a></p><p>Chancy <strong>stores everything in PostgreSQL tables</strong>. For example chancy_jobs is the main task queue table:</p><pre>Name        |Row #1                              |<br>------------+------------------------------------+<br>id          |03f778c5-97f4-2bf7-a871-f22b3983d111|<br>queue       |scrape                              |<br>func        |jobs.scrape_google                  |<br>kwargs      |{&quot;query&quot;: &quot;my query&quot;}               |<br>limits      |[]                                  |<br>meta        |{}                                  |<br>state       |pending                             |<br>priority    |0                                   |<br>attempts    |0                                   |<br>max_attempts|1                                   |<br>taken_by    |                                    |<br>created_at  |2026-08-11 15:27:01.341 +0700       |<br>started_at  |                                    |<br>completed_at|                                    |<br>scheduled_at|2026-08-11 15:27:01.328 +0700       |<br>unique_key  |                                    |<br>errors      |[]                                  |</pre><p>Each row is a job and each job is fully transparent. At any point you can SQL your jobs row and inspect the state of your task queue.</p><p>All these pre-defined columns already give you a lot of insight into your work state — you can find running jobs, retrying ones, group them by queue, errors or even keyword arguments.</p><p>In addition, the <strong>meta</strong> column is <em>your playground</em> where you can store any data in native JSONB column type which can be SQL queried. This is a great tool for jobs that contain important nuance like data processing reports or soft fail conditions.</p><p>You’d think that maintaining an SQL table would really hinder your task throughput, but that’s really not the case. Postgres is very good at iterating through tables and chancy takes advantage of Postgres’ locks, signal features and indexes.</p><p>As long as you don’t need thousands of jobs per second you’ll never bump into these limitations but what you get in exchange is the most transparent task queue system out there.</p><h3>Transparency is just so good</h3><p>It’s hard to really explain the value of having full transparency into your task queue that is fully SQL queryable, but one good contemporary selling point is that LLM agents mount on this system beautifully because postgres SQL is just so well understood by LLMs and the tables are so transparent.</p><p>Especially if you take advantage of the meta column to populate your job state details you can task an LLM agent to investigate variety of issues.</p><p>Here’s a concrete example. Let’s say we have this job:</p><pre>@job(queue=&quot;scrape&quot;)<br>async def scrape_google(query: str, job_context: QueuedJob):<br>    results, skipped = await my_api.scrape_google(query)<br>    job_context.meta[&#39;results_found&#39;] = len(results)<br>    job_context.meta[&#39;results_skipped&#39;] = skipped</pre><p>Which completes in row entry like:</p><pre>... | state     | meta                   |<br>----+-----------+------------------------|<br>    | succeeded | {                      |<br>    |           |  &quot;results_found&quot;: 10,  |<br>    |           |  &quot;results_skipped&quot;: 0  |<br>    |           | }                      |</pre><p>Now we have full transparency into our job execution (which are all the chancy_jobs columns) AND custom job performance which is our meta column.</p><p>We can quickly put together dashboards and inspection queries to see how many results are found for what queries and what search platforms:</p><pre>-- find all soft-failed scrape_google job queries<br>SELECT<br>    kwargs -&gt;&gt; &#39;query&#39; AS query,<br>FROM chancy_jobs<br>WHERE func = &#39;myjobs.scrape_google&#39;<br>  AND (meta -&gt;&gt; &#39;results_found&#39;)::int = 0<br>  AND (meta -&gt;&gt; &#39;results_skipped&#39;)::int = 0<br>  AND state = &#39;succeeded&#39;<br>ORDER BY completed_at DESC;</pre><p>This is incredibly powerful. With how easy it is to put together front-end dashboards with LLMs these days you can illustrate and track almost any scenario or state of your job queue with very little effort and complexity. You never feel blind.</p><h3>What about workers?</h3><p>As each worker is really just a Python process you get everything you expect including several types of executors that can be applied to different queues, for example:</p><ul><li>convert_videos queue — CPU intensive, for this we can use Subprocess type executor where each task will receive their own python process giving full CPU thread utilization</li><li>scrape_search queue — IO intensive for which Asyncio type queue can be used which just puts all tasks under the same asyncio loop and one process.</li></ul><p>Chancy workers can work any type of python jobs though this simplicity does come with an unavoidable cost of having to tune your workers queue subscriptions.</p><ul><li>Have worker subscribe to too many asyncio jobs concurrently → you’ll end up blocking your asyncio loop to the point where your jobs might cascade into timeouts.</li><li>Have everything under subprocess queue → now you’re introducing a massive overhead spawning a new python interpreter for each job.</li></ul><p>This is not really a solved problem in any task queue framework in Python AFAIK so it’s hard to complain here, but good orchestration design can still lead to mostly an efficient hands-off experience.</p><p>Just like jobs, chancy workers report everything to postgres tables as well.</p><p>For example, queues are configured in chancy_queues table:</p><pre>name   |state |concurrency|tags          |executor        |...<br>-------+------+-----------+--------------+----------------+---<br>scrape |active|         20|{kind=scrape} |AsyncExecutor   |...<br>reports|active|          4|{kind=reports}|ProcessExecutor |...<br>emails |active|          8|{kind=emails} |ThreadedExecutor|...<br>default|active|           |{.*}          |ProcessExecutor |...</pre><p>And in chancy_workers table each chancy worker reports itself so you can maintain workers with a health checker on your server and your dashboards. Chancy workers even elect a leader which performs all house chores gracefully avoiding duplication traps.</p><h3>Plugins</h3><p>While chancy is quite minimalistic it does ship a full plugin support which accommodates all advanced features you’d expect from a task queue framework with a good set of default plugins.</p><p>One thing that is very popular in other task frameworks like celery is being able to chain tasks (with chord or similar) to add task callbacks etc. For this chancy ships a <strong>Workflows plugin </strong>which allows you to define a DAG of jobs for your worker and as expected chancy store workflow state in a chancy_workflows table.</p><p>There’s also a <strong>Cron plugin</strong> that can be used to create job schedules and an auto <strong>Pruner plugin</strong> that keep your job queues tidy, <strong>Recovery plugin</strong> that recovers abandoned jobs in case your workers crash and <strong>Retry plugin</strong> that adds support for more complex retry strategies.</p><p>All this riding of very strong SQL-powered base. I wrote several plugins myself of varying complexity with ease. It’s a good system.</p><h3>Where to start?</h3><p>I host a small demo skeleton on github which illustrates a basic setup 👇</p><p><a href="https://github.com/Granitosaurus/chancy-demo">https://github.com/Granitosaurus/chancy-demo</a></p><p>pair it with the official docs: <a href="https://tkte.ch/chancy/">https://tkte.ch/chancy/</a></p><h3>When not to use Chancy?</h3><p>There’s a lot of intent required when working with chancy. There’s no global state for stuff like job.delay() of celery so you can’t really be hands-off lazy so protyping and small project might come together slower.</p><p>Chancy isn’t all that mature yet (v0.25.1 as of writing) and does require you to at least somewhat understand postgres, particularly the quirks with high load tables, but it’s something you can learn very quickly.</p><p>Then, the throughput of an SQL table obviously can’t really match something like rabbitmq but you really need to ask yourself whether you’ll ever reach anything of the sort in your application.</p><p>Finally executing complex task chains with callbacks and many forks/conditions is quite difficult even with the Workflows plugin.</p><p><strong>It’s all for the better though</strong>. These limitations actually stop you from pursuing bad task orchestration designs. You almost never want complex task execution chains, global states or massive throughput spikes. The few Chancy’s limitations actually ground you to good designs.</p><p>Chancy is free, made by Tyler Kennedy and imo is production ready at <a href="https://github.com/TkTech/chancy">https://github.com/TkTech/chancy</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c23b5b88fd32" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Quick Intro to Manual Espresso]]></title>
            <link>https://medium.com/@wraptile/quick-intro-to-manual-espresso-2732fd50a447?source=rss-7f9a1e5bba4a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2732fd50a447</guid>
            <category><![CDATA[coffee]]></category>
            <category><![CDATA[espresso]]></category>
            <category><![CDATA[lifestyle]]></category>
            <category><![CDATA[guides-and-tutorials]]></category>
            <dc:creator><![CDATA[Bernard Ališauskas]]></dc:creator>
            <pubDate>Sat, 01 Jun 2024 07:58:18 GMT</pubDate>
            <atom:updated>2024-06-01T07:58:18.636Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve had Flair Neo manual press for 4 years now and it has been producing perfect espressos for me every morning and it’s the best way to get your morning coffee.</p><p>Manual espresso machines have some great advantages:</p><ul><li>Very cheap — as low as 100$.</li><li>Low maintenance.</li><li>No warmup and quick setup.</li><li>Produce magnificent results that you have full control over.</li></ul><p>All you need is to spend couple of hours to understand the process and this guide should be a good start.</p><p>There are generally 2 types of presses available but it’s mostly the same thing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TI6eEzRHHCx42NK2doBFaw.png" /></figure><p>In essence, manual press replaces all of the complex parts of an espresso machine with human muscles and a single device called the brew head:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V1na7RzC0elj4oH6q_vl-Q.png" /></figure><p>A lever mechanism is used to press the piston down onto hot water which passes ground coffee and creates delicious espresso. Pretty simple! Here’s how to get into it.</p><h3>Get the beans</h3><p>Don’t bother with pre-ground coffee. We need whole roasted beans.</p><p>Start with medium or Vienna (mid-dark) roast as these much easier to work with. Make sure the roast is fresh. Week old roast is peak quality.</p><p>Coffee beans oxidize so it’s freshness is not only important for flavor but for the whole espresso process 👇</p><h3>Press the beans</h3><p>This is where everything comes together and before we grind our beans we need to understand the press mechanics.</p><p>The key feature of Espresso is pressure which makes the hot water much more chemically reactive. This water goes through the bean particles and extracts the tasty out of them very effectively with extra features like crema.</p><p>The challenge here is managing of pressure and it’s delivery method. There are 3 parts that control pressure:</p><ol><li>The basket itself — it has space and holes int it and we can’t change anything about it.</li><li>The grind level — smaller particles compress harder creating more pressure.</li><li>The particle volume — more particles take longer to get through creating more pressure.</li></ol><p>So, for perfect espresso we need to <strong>nail the grind level and volume</strong>.</p><p>Too coarse grind or too little volume will not create enough resistance and result in <em>watery</em> espresso. It’ll just plop out quickly without pulling the taste out our beans. <br>The opposite will create <em>stuffy</em> espresso resulting in sweat, swearing and eventual loss of precious coffee beans as you get defeated by the immovable lever.</p><p>Here’s a quick illustration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryrLD9d7d0YVuuoCPCQ8NQ.png" /></figure><p>It’s a balancing game.</p><h3>The Dial-in</h3><p>Finding the perfect balance is called a “dial in”. As each bean bag is slightly different we need to adjust our grind level and volume for a perfect dial in.</p><p>Good news is you only need to dial in once per bag as long as you don’t leave beans to oxidize for too long.</p><p>Dark roast beans break easier and produce more uniform, smaller particles. So the darker roast is always stuffier and easier to work with.</p><p>With bean grounds in hand, start with a desired volume like 16 grams (known as double shot) and keep reducing the grind level until the press is no longer watery but not too stuffy either.</p><p>So if 16G press is coming out too watery, reduce the grind size or raise to 18G. Rinse and repeat.</p><p>It’s hard to explain the sweet spot but you’ll definitely feel it. Pressing a perfect dial-in manually feels very satisfying, you can’t miss it.</p><h3>Tips on setting up gear</h3><p>There are 2 critical gear parts that impact this whole process — basket tamping and water head temperature.</p><p>First, the ground coffee particles need to be distributed evenly in the basket. For that a swish-swoosh tool is used like a paperclip (professionally called WDT) to swish freshly ground clump of bean stuff around to give them an even distribution of space.</p><p>Then, a tamper is used to press it snug together. Press hard and aim for horizontal level.</p><p>Then, the cylinder is metal which will cool down freshly boiled water rapidly by stealing it’s heat. This means in reality you’re pressing coffee with 80C water instead of desired 95+C. So, just preheat the basket.</p><p>I drop it into the water kettle and pull it out with a pair of tongs before each press 👇</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I2y9jVzx13uesC31WYI_RQ.png" /></figure><h3>To reiterate:</h3><p>1. Get freshly roasted medium-dark beans.<br>2. Decide on volume e.g. 16G.<br>3. Preheat the components.<br>4. Grind multiple grind sizes.<br>5. Test each grind level until output is not _watery_ nor _stuffy_ .<br>6. Write down your settings for easy repetition.</p><h3>Troubleshoot</h3><p>Dial-in is too watery all of a sudden:</p><ul><li>Your beans are no longer fresh. Increase volume or grind.</li><li>Tamper is uneven or incorrect.</li><li>Grinder is producing uneven grind.</li></ul><p>Dial-in is too stuffy:</p><ul><li>Dial-in is probably incorrect. Redial.</li><li>Grind <em>can</em> be too fine and clog portafilter holes. Reduce grind and increase volume.</li></ul><p>Can’t dial in.</p><ul><li>Each basket has ideal volume range try to change the volume.</li><li>Grinder is unreliable. Clean the burs to get rid of coffee oils and try again. If it persists consider investing into a grinder with better burs.</li></ul><h3>Wrap up and other improvements</h3><p>With all that you can continue to improve espresso flavor through less critical aspects that can impact the flavor.</p><p>Measure water throughput as certain ratios like 1g of beans to 2ml of water result in the best flavors. For this, put a scale under your cup and press until your cup weights twice the amount of beans you’re using, i.e. 32gs for 16g of beans.</p><p>Pull over a cold object. Pouring fresh espresso over cold metal piece is a relatively new technique to extract more flavors.</p><p>Happy pressing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2732fd50a447" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>