fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.8K
active users

#worklog

1 post1 participant0 posts today
continue<p>Вот есть проект <a class="mention u-url" href="https://www.sqlalchemy.org/" rel="nofollow noopener" target="_blank">sqlalchemy</a>. Люди стараются, пишут абстракции, что бы работать с SQL, как с объектами. Со стороны выглядит красиво.</p> <p>Но начинаешь использовать банальные варианты: <code>sqlite</code> для локальных тестов, <code>postgresql</code> для реального сервера. Казалось бы: весь код написан на абстрактных объектах и мы просто поменяет URI базы данных и... нет, оказывается это так не работает:</p> <ul><li>работа с датой/временем - разные функции</li><li>хочешь <code>ON CONFLICT</code> при вставке - разные реализации в разных диалектах</li><li>хочешь <i>нормальное</i> <code>JSON</code> поле - не забудь сделать код, который использует тип <code>JSONB</code> для <code>postgresql</code></li></ul><p>И так далее. Думаешь: ОК, наверное я просто что-то не понимаю в современной библиотеке...<br>Ага, вот как раз под руку попалась реализация хранилища объектов в БД на основе <code>sqlalchemy</code> в <a class="mention u-url" href="https://github.com/google/adk-python/blob/main/src/google/adk/sessions/database_session_service.py" rel="nofollow noopener" target="_blank">библиотеке adk от гугла</a>. И весь тот же самый <i>закат солнца вручную</i>:</p> <pre><code>$ grep dialect google/adk/sessions/database_session_service.py | grep '"' if dialect.name == "postgresql": if dialect.name == "mysql": if dialect.name == "postgresql": if dialect.name == "postgresql": if dialect.name == "mysql": if self._dialect_name == "sqlite":</code></pre><p></p>
continue<p><a class="mention u-url" href="https://openai.github.io/openai-agents-python/#hello-world-example" rel="nofollow noopener" target="_blank">OpenAI Agents SDK: Hello world example</a></p> <p></p> <pre><code>from agents import Agent, Runner agent = Agent(name="Assistant", instructions="You are a helpful assistant") result = Runner.run_sync(agent, "Write a haiku about recursion in programming.") print(result.final_output)</code></pre><p></p> <blockquote>Code within the code,<br>Functions calling themselves,<br>Infinite loop's dance.</blockquote><p></p>
continue<p>Спасибо <a class="mention u-url" href="https://github.com/tealeg/xlsx2csv" rel="nofollow noopener" target="_blank">xlsx2csv</a> за то, что я снова избежал необходимости ставить офисный пакет на машину.</p> <p></p> <blockquote>Simple script for converting xlsx files to csv files commandline.</blockquote><p></p>
continue<p></p> <blockquote>"На интеграцию с другой стороны выделили трех людей: один джун, второй руководитель, а третий пока в отпуске."</blockquote><p>Звучит, как начало анекдота, но это рабочая реальность.</p>
KungFuDiscoMonkey<p>For today’s <a href="https://social.tsun.co/tags/MokuMokuKai" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MokuMokuKai</span></a> continued working on my experimental <a href="https://social.tsun.co/tags/git" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>git</span></a> client. Experimented getting a quick file picker working, and stubs to show commit status. Good stopping point for tonight, since I may need to dig into the lower level library next time. <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a></p>
KungFuDiscoMonkey<p>Spent some more time with <a href="https://social.tsun.co/tags/traefik" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>traefik</span></a> today and got it working in my local dev environment. Future task will be to test with with my hosted stuff. Main reason for me to change off of nginx is to automate some of the toil of configuring <a href="https://social.tsun.co/tags/letsencrypt" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>letsencrypt</span></a> but will have to see if it actually improves things or not 🤔<br><a href="https://social.tsun.co/tags/caddyserver" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>caddyserver</span></a> is another one for me to try out to see if that would work too. <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a></p>
KungFuDiscoMonkey<p>Today's <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a> is updating some Grafana -&gt; Django API bits. I was using a json plugin [1] but a version update a while back changed quite a bit of the API. Today was updating the Django side of things. Part of me would like to have a Grafana data source plugin under my control, but some of the Grafana ecosystem looks scary to build for 😅</p><p>1: <a href="https://github.com/simPod/GrafanaJsonDatasource/releases/tag/v0.6.0" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/simPod/GrafanaJsonD</span><span class="invisible">atasource/releases/tag/v0.6.0</span></a></p>
KungFuDiscoMonkey<p>Continued working on my small prototype. Still don't know why <a href="https://social.tsun.co/tags/SwiftUI" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>SwiftUI</span></a> is drawing my `Select Vault` menu twice, but I did get a quick <a href="https://social.tsun.co/tags/markdown" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>markdown</span></a> widget in for testing. <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a> <a href="https://social.tsun.co/tags/projects" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>projects</span></a></p>
continue<p>А что бы снять логи даже с успешного запуска <code>pytest</code> можно перенаправить копию содержимого в файл.<br>Например:</p> <pre><code>pytest --log-level=debug --log-file /tmp/pytest.log</code></pre><p></p>
KungFuDiscoMonkey<p>Reading up on `firewalld` and `iptables` and `nft list ruleset` to better understand how firewalls on <a href="https://social.tsun.co/tags/linux" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>linux</span></a> work. Might be a terrible idea, but I'm prototyping some nginx/systemd log filtering to pull out suspicious requests into a <a href="https://social.tsun.co/tags/kafka" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>kafka</span></a> topic, and then want to automatically create some firewall blocks from that 🤔</p><p>`nginx/systemd -&gt; fluent-bit -&gt; kafka -&gt; faust-streaming -&gt; firewall blocks`</p><p><a href="https://faust-streaming.github.io/faust/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">faust-streaming.github.io/faus</span><span class="invisible">t/</span></a></p><p><a href="https://social.tsun.co/tags/projects" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>projects</span></a> <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a></p>
Karl Dubost<p>Reminder: In case you need to monitor your own activity for your work on <a href="https://mastodon.cloud/tags/GitHub" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>GitHub</span></a>, there is a feed for the user activity.</p><p>`<a href="https://github.com/github_username.atom`" rel="nofollow noopener" target="_blank"><span class="invisible">https://</span><span class="ellipsis">github.com/github_username.ato</span><span class="invisible">m`</span></a></p><p>Practical to automatically create a <a href="https://mastodon.cloud/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a>.</p>
continue<p>Управлять уровнем логирования при запуске <code>pytest</code> можно аргументом командной строки <code>--log-level</code>, например:</p> <pre><code>pytest --log-level=debug</code></pre><p><a class="mention u-url" href="https://honk.any-key.press/o/python" rel="nofollow noopener" target="_blank">#Python</a> <a class="mention u-url" href="https://honk.any-key.press/o/worklog" rel="nofollow noopener" target="_blank">#WorkLog</a></p>
continue<p>Недавно коллега поделился со мной, что у него в профессиональной сфере (программирование) есть проблема начать новый проект "с чистого листа".</p> <p>Обсуждение велось в рамках полезности GitHub Copilot. То есть для него это инструмент, который в настоящее время делает ту работу, которую, например, в IDE делали шаблоны: набросок проекта с заглушками.</p> <p>Я, честно говоря, никогда не задумывался над такой проблемой. Я в какой-то момент перестал пользоваться IDE и не чувствую в ней больше потребности. И мне даже нравится начинать всё с нуля. Я наоборот предпочту создать новый проект и перетащить туда кусками нужный код, вместо того, что бы переписывать куски в старом проекте.</p> <p>Обсуждали не <a class="mention u-url" href="https://honk.any-key.press/o/%D1%81%D0%B5%D0%B3%D0%BE%D0%B4%D0%BD%D1%8F" rel="nofollow noopener" target="_blank">#сегодня</a>, но почему-то в голове мысль "маринуется". <a class="mention u-url" href="https://honk.any-key.press/o/worklog" rel="nofollow noopener" target="_blank">#WorkLog</a></p>
KungFuDiscoMonkey<p>Tonight's project is getting distracted and hacking together an <a href="https://social.tsun.co/tags/alfred" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>alfred</span></a> workflow for <a href="https://social.tsun.co/tags/forgejo" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>forgejo</span></a> <br>Mostly hard coded and a prototype, but I'll see if I end up doing anything with it later.<br><a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a></p>
continue<p>Например: может ли конструктор быть асинхронным? Нет, потому что он не может вернуть <code>coroutine</code>.</p> <pre><code>$ python3 -m asyncio asyncio REPL 3.11.5 (main, Aug 25 2023, 13:19:53) [GCC 9.4.0] on linux Use "await" directly instead of "asyncio.run()". Type "help", "copyright", "credits" or "license" for more information. &gt;&gt;&gt; import asyncio &gt;&gt;&gt; class X: ... async def __init__(self): ... pass ... &gt;&gt;&gt; X() &lt;console&gt;:1: RuntimeWarning: coroutine 'X.__init__' was never awaited RuntimeWarning: Enable tracemalloc to get the object allocation traceback Traceback (most recent call last): File "/usr/lib/python3.11/concurrent/futures/_base.py", line 456, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/usr/lib/python3.11/asyncio/__main__.py", line 34, in callback coro = func() ^^^^^^ File "&lt;console&gt;", line 1, in &lt;module&gt; TypeError: __init__() should return None, not 'coroutine'</code></pre><p>То есть для получения каких-то данных асинхронным вызовом мне придётся городить отдельную асинхронную фабрику, которая произведёт эти асинхронные вызовы и передаст результаты аргументами в конструктор.</p> <p><a class="mention u-url" href="https://honk.any-key.press/o/worklog" rel="nofollow noopener" target="_blank">#WorkLog</a> <a class="mention u-url" href="https://honk.any-key.press/o/python" rel="nofollow noopener" target="_blank">#Python</a></p>
continue<p>Пропустил, что в <a class="mention u-url" href="https://honk.any-key.press/o/python" rel="nofollow noopener" target="_blank">#Python</a> 3.9 <a class="mention u-url" href="https://docs.python.org/3/library/hashlib.html#hash-algorithms" rel="nofollow noopener" target="_blank">в конструктор вычислителей хэшей добавили аргумент usedforsecurity</a>:</p> <p></p> <blockquote><i>Changed in version 3.9</i>: All hashlib constructors take a keyword-only argument <i>usedforsecurity</i> with default value <code>True</code>. A false value allows the use of insecure and blocked hashing algorithms in restricted environments. <code>False</code> indicates that the hashing algorithm is not used in a security context, e.g. as a non-cryptographic one-way compression function.</blockquote><p>По идее <code>usedforsecurity=False</code> дает возможность использовать более быструю реализацию, но подверженную атакам по времени, например.</p> <p><a class="mention u-url" href="https://honk.any-key.press/o/worklog" rel="nofollow noopener" target="_blank">#WorkLog</a></p>
KungFuDiscoMonkey<p>Spent today successfully avoiding Satisfactory (game) and did a little bit of experimenting with some <a href="https://social.tsun.co/tags/caldav" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>caldav</span></a> stuff around a simple grocery list <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a></p>
James Valleroy<p>I&#39;ve been working on:<br />Implementing an option to enable or disable daily run of diagnostics in FreedomBox.</p><p><a href="https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2439" target="_blank" rel="nofollow noopener" translate="no"><span class="invisible">https://</span><span class="ellipsis">salsa.debian.org/freedombox-te</span><span class="invisible">am/freedombox/-/merge_requests/2439</span></a></p><p><a href="https://fosstodon.org/tags/FreedomBoxDev" class="mention hashtag" rel="tag">#<span>FreedomBoxDev</span></a> <a href="https://fosstodon.org/tags/WorkLog" class="mention hashtag" rel="tag">#<span>WorkLog</span></a></p>
KungFuDiscoMonkey<p>Spent the evening playing with some <a href="https://social.tsun.co/tags/rust" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>rust</span></a> CLI parsing, trying to get a skeleton working for a small home cloud server prototype. <a href="https://social.tsun.co/tags/worklog" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>worklog</span></a> <a href="https://social.tsun.co/tags/MokuMokuKai" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>MokuMokuKai</span></a></p>
continue<p>Практика показала, что <a class="mention u-url" href="https://docs.python.org/3/library/sqlite3.html#sqlite3.sqlite_version" rel="nofollow noopener" target="_blank">sqlite3</a> не вкомлиливает в себя <a class="mention u-url" href="https://honk.any-key.press/o/sqlite" rel="nofollow noopener" target="_blank">#SQLite</a>, а использует установленный в системе.</p> <p>Стенд 1 (Ubuntu 20.04.6):</p> <pre><code>$ sqlite3 --version 3.31.1 2020-01-27 19:55:54 $ python Python 3.11.5 (main, Aug 25 2023, 13:19:53) [GCC 9.4.0] on linux &gt;&gt;&gt; import sqlite3 &gt;&gt;&gt; sqlite3.sqlite_version '3.31.1'</code></pre><p>Стенд 2 (Alpine 3.19):</p> <pre><code>$ sqlite3 --version 3.44.2 2023-11-24 11:41:44 $ python3 Python 3.11.6 (main, Oct 13 2023, 15:52:55) [GCC 13.1.1 20230722] on linux &gt;&gt;&gt; import sqlite3 &gt;&gt;&gt; sqlite3.sqlite_version '3.44.2'</code></pre><p>Стенд 3 (OpenBSD 7.4)</p> <pre><code>$ sqlite3 --version 3.42.0 2023-05-16 12:36:15 $ python3 Python 3.10.13 (main, Oct 5 2023, 16:21:31) [Clang 13.0.0 ] on openbsd7 &gt;&gt;&gt; import sqlite3 &gt;&gt;&gt; sqlite3.sqlite_version '3.42.0'</code></pre><p>То есть версия <a class="mention u-url" href="https://honk.any-key.press/o/sqlite" rel="nofollow noopener" target="_blank">#SQLite</a> зависит не от свежести <a class="mention u-url" href="https://honk.any-key.press/o/python" rel="nofollow noopener" target="_blank">#Python</a>, а от свежести самой системы.<br><a class="mention u-url" href="https://honk.any-key.press/o/worklog" rel="nofollow noopener" target="_blank">#WorkLog</a></p>