FediScanner

#python

← Back

Day 24/75 Python DSA: merge intervals.

My booking tool reported Room 4 occupied for 150 minutes when it was 120. Summing each booking's length double-counts overlap: the 9:00-10:00 and 9:30-11:00 reservations share a half hour I counted twice.

Fix: merge overlapping bookings before measuring. The unlock is sorting by start time. Once starts are non-decreasing, any overlap is with the most recent block, so one sweep does it: if start <= last.end, extend, else open a new block.

#Python #DSA

Show Original PostReport

Day 24/90: the service that base64'd its secrets.

Handoff doc said "API secrets encrypted at rest." The Stripe key was base64. One b64decode and the live key was in my REPL. Encoding is not encryption.

Fix for the secrets: Fernet from the cryptography library. It pins authenticated AES-128-CBC plus a random IV, and the key lives in an env var.

Passwords were unsalted MD5. Fast hashes lose because speed helps the attacker. Swapped to argon2 via passlib, upgraded at login.

#Python #InfoSec

Show Original PostReport

長時間かかるスクリプトの完了や、定期実行のエラーを、手元で確認しに行く手間を減らしたい方に向けて書きました。Discord Webhookを使い、Pythonから通知を送る方法を、実際に動かせるコード例とあわせて整理しています。通知用のBotを作るほど大がかりにはしたくない、という場面にも向いた内容です。最近公開した記事です。
code-rebuild.com/python/discor

Show Original PostReport

Editando!

Esta semana nuevo video en el canal de #youtbube de #juncotic!

Esta vez, a pedido ve algunos seguidores y alumnos, vamos a profundizar en el #oomkiller del kernel #Linux, y por qué puede que algunos procesos de servicio mueran sin razón aparente...

... todo para que el kernel pueda seguir gestionando recursos 🙂

Y para probarlo, nada mejor que saturar la memoria del sistema con #python 😅

Suscribanse para enterarse! 🔔👇

https://www.youtube.com/juncotic?sub_confirmation=1

Los/as espero!🚀

#gnu #linux #oomkiller #sysadmin #devops
Reenviado desde JuncoTIC - juncotic.com por experienciainterdimensional

Show Original PostReport

Editando!

Esta semana nuevo video en el canal de #youtbube de #juncotic!

Esta vez, a pedido ve algunos seguidores y alumnos, vamos a profundizar en el #oomkiller del kernel #Linux, y por qué puede que algunos procesos de servicio mueran sin razón aparente...

... todo para que el kernel pueda seguir gestionando recursos 🙂

Y para probarlo, nada mejor que saturar la memoria del sistema con #python 😅

Suscribanse para enterarse! 🔔👇

youtube.com/juncotic?sub_confi

#linux #oomkiller #sysadmin #devops

Show Original PostReport

Looking for #coding advice, specifically editor advice.. I code as a hobby, mostly my own small projects in #Rust #RustLang #Python. Like many people I use #VScode, but each "new" version seems to have more and more #AI features -- features I have zero interest in. I opt out but would rather see this at all.

Any suggestions for an alternative editor that will work on my #ARM #aarch64 #Fedora #Asahi remix system?

Show Original PostReport

Most Python web applications are developed over plain HTTP and deployed behind HTTPS, so Secure cookies, HTTP/2 and generated URLs only get properly exercised once deployed. Testing that locally usually means a proxy and a certificate to set up, which few people bother with.

With a Muru development run you add --https and it generates the certificate for you. If you use mkcert your browser already trusts it, and there is no proxy to configure.

grahamdumpleton.me/posts/2026/

Show Original PostReport