FLOSS Project Planets

Enrico Zini: New laptop setup

Planet Debian - Sat, 2024-11-30 15:13

My new laptop Framework (Framework Laptop 13 DIY Edition (AMD Ryzen™ 7040 Series)) arrived, all the hardware works out of the box on Debian Stable, and I'm very happy indeed.

This post has the notes of all the provisioning steps, so that I can replicate them again if needed.

Installing Debian 12

Debian 12's installer just worked, with Secure Boot enabled no less, which was nice.

The only glitch is an argument with the guided partitioner, which was uncooperative: I have been hit before by a /boot partition too small, and I wanted 1G of EFI and 1G of boot, while the partitioner decided that 512Mb were good enough. Frustratingly, there was no way of changing that, nor I found how to get more than 1G of swap, as I wanted enough swap to fit RAM for hybernation.

I let it install the way it pleased, then I booted into grml for a round of gparted.

The tricky part of that was resizing the root btrfs filesystem, which is in an LV, which is in a VG, which is in a PV, which is in LUKS. Here's a cheatsheet.

Shrink partitions:

  • mount the root filesystem in /mnt
  • btrfs filesystem resize 6G /mnt
  • umount the root filesystem
  • lvresize -L 7G vgname/lvname
  • pvresize --setphysicalvolumesize /dev/mapper/pvname 8G
  • cryptsetup resize --device-size 9G name

note that I used an increasing size because I don't trust that each tool has a way of representing sizes that aligns to the byte. I'd be happy to find out that they do, but didn't want to find out the hard way that they didn't.

Resize with gparted:

Move and resize partitions at will. Shrinking first means it all takes a reasonable time, and you won't have to wait almost an hour for a terabyte-sized empty partition to be carefully moved around. Don't ask me why I know.

Regrow partitions:

  • cryptsetup resize name
  • pvresize /dev/mapper/pvname
  • lvresize -L 100% vgname/lvname
  • mount the root filesystem in /mnt
  • btrfs filesystem resize max /mnt
  • umount the root filesystem
Setup gnome

When I get a new laptop I have a tradition of trying to make it work with Gnome and Wayland, which normally ended up in frustration and a swift move to X11 and Xfce: I have a lot of long-time muscle memory involved in how I use a computer, and it needs to fit like prosthetics. I can learn to do a thing or two in a different way, but any papercut that makes me break flow and I cannot fix will soon become a dealbreaker.

This applies to Gnome as present in Debian Stable.

General Gnome settings tips

I can list all available settings with:

gsettings list-recursively

which is handy for grepping things like hotkeys.

I can manually set a value with:

gsettings set <schema> <key> <value>

and I can reset it to its default with:

gsettings reset <schema> <key>

Some applications like Gnome Terminal use "relocatable schemas", and in those cases you also need to specify a path, which can be discovered using dconf-editor:

gsettings set <schema>:<path> <key> <value> Install appindicators

First thing first: app install gnome-shell-extension-appindicator, log out and in again: the Gnome Extension manager won't see the extension as available until you restart the whole session.

I have no idea why that is so, and I have no idea why a notification area is not present in Gnome by default, but at least now I can get one.

Fix font sizes across monitors

My laptop screen and monitor have significantly different DPIs, so:

gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

And in Settings/Displays, set a reasonable scaling factor for each display.

Disable Alt/Super as hotkey for the Overlay

Seeing all my screen reorganize and reshuffle every time I accidentally press Alt leaves me disoriented and seasick:

gsettings set org.gnome.mutter overlay-key '' Focus-follows-mouse and Raise-or-lower

My desktop is like my desktop: messy and cluttered. I have lots of overlapping window and I switch between them by moving the focus with the mouse, and when the visible part is not enough I have a handy hotkey mapped to raise-or-lower to bring forward what I need and send back what I don't need anymore.

Thankfully Gnome can be configured that way, with some work:

  • In gnome-shell settings, keyboard, shortcuts, windows, set "Raise window if covered, otherwise lower it" to "Super+Escape"
  • In gnome-tweak-tool, Windows, set "Focus on Hover"

This almost worked, but sometimes it didn't do what I wanted, like I expected to find a window to the front but another window disappeared instead. I eventually figured that by default Gnome delays focus changes by a perceivable amount, which is evidently too slow for the way I move around windows.

The amount cannot be shortened, but it can be removed with:

gsettings set org.gnome.shell.overrides focus-change-on-pointer-rest false Mouse and keyboard shortcuts

Gnome has lots of preconfigured sounds, shortcuts, animations and other distractions that I do not need. They also either interfere with key combinations I want to use in terminals, or cause accidental window moves or resizes that make me break flow, or otherwise provide sensory overstimulation that really does not work for me.

It was a lot of work, and these are the steps I used to get rid of most of them.

Disable Super+N combinations that accidentally launch a questionable choice of programs:

for i in `seq 1 9`; do gsettings set org.gnome.shell.keybindings switch-to-application-$i '[]'; done

Gnome-Shell settings:

  • Multitasking:
    • disable hot corner
    • disable active edges
    • set a fixed number of workspaces
    • workspaces on all displays
    • switching includes apps from current workspace only
  • Sound:
    • disable system sounds
  • Keyboard
    • Compose Key set to Caps Lock
    • View and Customize Shortcuts:
      • Launchers
        • launch help browser: remove
      • Navigation
        • move to workspace on the left: Super+Left
        • move to workspace on the right: Super+Right
        • move window one monitor …: remove
        • move window one workspace to the left: Shift+Super+Left
        • move window one workspace to the right: Shift+Super+Right
        • move window to …: remove
        • switch system …: remove
        • switch to …: remove
        • switch windows …: disabled
      • Screenshots
        • Record a screenshot interactively: Super+Print
        • Take a screenshot interactively: Print
        • Disable everything else
      • System
        • Focus the active notification: remove
        • Open the applcation menu: remove
        • Restore the keyboard shortctus: remove
        • Show all applications: remove
        • Show the notification list: remove
        • Show the overvire: remove
        • Show the run command prompt: remove (the default Gnome launcher is not for me) Super+F2 (or remove to leave it to the terminal)
      • Windows
        • Close window: remove
        • Hide window: remove
        • Maximize window: remove
        • Move window: remove
        • Raise window if covered, otherwise lower it: Super+Escape
        • Resize window: remove
        • Restore window: remove
        • Toggle maximization state: remove
    • Custom shortcuts
      • xfrun4, launching xfrun4, bound to Super+F2
  • Accessibility:
    • disable "Enable animations"

gnome-tweak-tool settings:

  • Keyboard & Mouse
    • Overview shortcut: Right Super. This cannot be disabled, but since my keyboard doesn't have a Right Super button, that's good enough for me. Oddly, I cannot find this in gsettings.
  • Window titlebars
    • Double-Click: Toggle-Maximize
    • Middle-Click: Lower
    • Secondary-Click: Menu
  • Windows
    • Resize with secondary click

Gnome Terminal settings:

Thankfully 10 years ago I took notes on how to customize Gnome Terminal, and they're still mostly valid:

  • Shortcuts

    • New tab: Super+T
    • New window: Super+N
    • Close tab: disabled
    • Close window: disabled
    • Copy: Super+C
    • Paste: Super+V
    • Search: all disabled
    • Previous tab: Super+Page Up
    • Next tab: Super+Page Down
    • Move tab…: Disabled
    • Switch to tab N: Super+Fn (only available after disabling overview)
    • Switch to tab N with Alt+Fn cannot be configured in the UI: Alt+Fn is detected as simply Fn. It can however be set with gsettings:

      sh for i in `seq 1 12`; do gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ switch-to-tab-$i "<Alt>F$i"; done

  • Profile

    • Text
      • Sound: disable terminal bell

Other hotkeys that got in my way and had to disable the hard way:

for n in `seq 1 12`; do gsettings set org.gnome.mutter.wayland.keybindings switch-to-session-$n '[]'; done gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-down '[]' gsettings set org.gnome.desktop.wm.keybindings move-to-workspace-up '[]' gsettings set org.gnome.desktop.wm.keybindings panel-main-menu '[]' gsettings set org.gnome.desktop.interface menubar-accel '[]'

Note that even after removing F10 from being bound to menubar-accel, and after having to gsetting binding to F10 as is:

$ gsettings list-recursively|grep F10 org.gnome.Terminal.Legacy.Keybindings switch-to-tab-10 '<Alt>F10'

I still cannot quit Midnight Commander using F10 in a terminal, as that moves the focus in the window title bar. This looks like a Gnome bug, and a very frustrating one for me.

Appearance

Gnome-Shell settings:

  • Appearance:
    • dark mode

gnome-tweak-tool settings:

  • Fonts
    • Antialiasing: Subpixel
  • Top Bar
    • Clock/Weekday: enable (why is this not a default?)

Gnome Terminal settings:

  • General
    • Theme variant: Dark (somehow it wasn't picked by up from the system settings)
  • Profile
    • Colors
      • Background: #000
Other decluttering and tweaks

Gnome Shell Settings:

  • Search
    • disable application search
  • Removable media
    • set everything to "ask what to do"
  • Default applications
    • Web: Chromium
    • Mail: mutt
    • Calendar: khal is not sadly an option
    • Video: mpv
    • Photos: Geequie

Set a delay between screen blank and lock: when the screen goes blank, it is important for me to be able to say "nope, don't blank yet!", and maybe switch on caffeine mode during a presentation without needing to type my password in front of cameras. No UI for this, but at least gsettings has it:

gsettings set org.gnome.desktop.screensaver lock-delay 30 Extensions

I enabled the Applications Menu extension, since it's impossible to find less famous applications in the Overview without knowing in advance how they're named in the desktop. This stole a precious hotkey, which I had to disable in gsettings:

gsettings set org.gnome.shell.extensions.apps-menu apps-menu-toggle-menu '[]'

I also enabled:

  • Removable Drive Menu: why is this not on by default?
  • Workspace Indicator
  • Ubuntu Appindicators (apt install gnome-shell-extension-appindicator and restart Gnome)

I didn't go and look for Gnome Shell extentions outside what is packaged in Debian, as I'm very wary about running JavaScript code randomly downloaded from the internet with full access over my data and desktop interaction.

I also took care of checking that the Gnome Shell Extensions web page complains about the lacking "GNOME Shell integration" browser extension, because the web browser shouldn't be allowed to download random JavaScript from the internet and run it with full local access.

Yuck.

Run program dialog

The default run program dialog is almost, but not quite, totally useless to me, as it does not provide completion, not even just for executable names in path, and so it ends up being faster to open a new terminal window and type in there.

It's possible, in Gnome Shell settings, to bind a custom command to a key. The resulting keybinding will now show up in gsettings, though it can be located in a more circuitous way by grepping first, and then looking up the resulting path in dconf-editor:

gsettings list-recursively|grep custom-key org.gnome.settings-daemon.plugins.media-keys custom-keybindings ['/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/']

I tried out several run dialogs present in Debian, with sad results, possibly due to most of them not being tested on wayland:

  • fuzzel does not start
  • gmrun is gtk2, last updated in 2016, but works fine
  • kupfer segfaults as I type
  • rofi shows, but can't get keboard input
  • shellex shows a white bar at top of the screen and lots of errors on stderr
  • superkb wants to grab the screen for hotkeys
  • synapse searched news on the internet as I typed, which is a big no for me
  • trabucco crashes on startup
  • wofi works but looks like very much an acquired taste, though it has some completion that makes it more useful than Gnome's run dialog
  • xfrun4 (package xfce4-appfinder) struggles on wayland, being unable to center its window and with the pulldown appearing elsewhere in the screen, but it otherwise works

Both gmrun and xfrun4 seem like workable options, with xfrun4 being customizable with convenient shortcut prefixes, so xfrun4 it is.

TODO
  • Figure out what is still binding F10 to menu, and what I can do about it
  • Figure out how to reduce the size of window titlebars, which to my taste should be unobtrusive and not take 2.7% of vertical screen size each. There's a minwaita theme which isn't packaged in Debian. There's a User Theme extension, and then the whole theming can of worms to open. For another day.
  • Figure out if Gnome can be convinced to resize popup windows? Take the Gnome Terminal shortcut preferences for example: it takes ⅓ of the vertical screen and can only display ¼ of all available shortcuts, and I cannot find a valid reason why I shouldn't be allowed to enlarge it vertically.
  • Figure out if I can place shortcut launcher icons in the top panel, and how

I'll try to update these notes as I investigate.

Conclusion so far

I now have something that seems to work for me. A few papercuts to figure out still, but they seem manageable.

It all feels a lot harder than it should be: for something intended to be minimal, Gnome defaults feel horribly cluttered and noisy to me, continuosly getting in the way of getting things done until tamed into being out of the way unless called for. It felt like a device that boots into flashy demo mode, which needs to be switched off before actual use.

Thankfully it can be switched off, and now I have notes to do it again if needed.

gsettings oddly feels to me like a better UI than the interactive settings managers: it's more comprehensive, more discoverable, more scriptable, and more stable across releases. Most of the Q&A I found on the internet with guidance given on the UI was obsolete, while when given with gsettings command lines it kept being relevant. I also have the feeling that these notes would be easier to understand and follow if given as gsettings invocations instead of descriptions of UI navigation paths.

At some point I'll upgrade to Trixie and reevaluate things, and these notes will be a useful checklist for that.

Fingers crossed that this time I'll manage to stay on Wayland. If not, I know that Xfce is still there for me, and I can trust it to be both helpful and good at not getting in the way of my work.

Categories: FLOSS Project Planets

Kirigami Addons 1.6.0

Planet KDE - Sat, 2024-11-30 09:30

Kirigami Addons is a collection of additional components for Kirigami applications. This release brings mostly improvements to the FormCard module.

AboutPage

The about page provided by Kirigami Addons received many improvements. Joshua added icons to all the buttons.

I worked on the component section, which now contains more information about the default components as well as the underlying platform and now has a button to copy all this information to the clipboard. This is super helpful, when writing a bug report. There were also some small bug fixes with, for example, the license dialog being correctly sized.

RadioSelector

A new component is the RadioSelector, which is a simple component that allows one to choose an option between two or more choices in a horizontal layout. This is not a new component as it has already been used in Itinerary and Marknote for a long time.

There is also a FormCard version of this, called FormRadioSelectorDelegate.

FormPlaceholderMessageDelegate

Another new component is FormPlaceholderMessageDelegate, which is basically a Kirigami.PlaceholderMessage, but instead of putting it in a ListView, this one is to be put inside a FormCard.

FormPlaceholderMessageDelegate for the health certificate

Other

Volker fixed the Android integration of the date picker. He also added support for static builds (required for iOS and probably hopeful for other platforms).

Claudio fixed various issues with the DatePicker.

Joshua made the caption used in AlbumMaximizeComponent selectable with the mouse. He also fixed the separator for the IndicatorItemDelegate which only appeared after the first item.

I added icon support to FormSwitchDelegate, which is similar to what we already have in FormRadioDelegate and FormCheckDelegate.

Packager Section

Kirigami Addons 1.6.0 was tagged but the tarball are not yet available. I will update this post once it is available.

Categories: FLOSS Project Planets

OptiImage 1.0.0 is out!

Planet KDE - Sat, 2024-11-30 09:30

The first release of OptiImage is finally out! OptiImage is a useful image compressor that supports PNG, JPEG, WebP and SVG file types. It doesn’t do the compression itself but uses various tools like oxipng to do the compression.

OptiImage compressing screenshots

OptiImage’s settings page

Thanks to Mathis Brüchert for his work on the icon and to Soumyadeep Ghosh for a bunch of bug fixes and pushing me to do the release.

Packager Section

OptiImage 1.0.0 was tagged but the tarball are not yet available. I will update this post once it is available.

Categories: FLOSS Project Planets

Real Python: Python's F-String for String Interpolation and Formatting

Planet Python - Sat, 2024-11-30 09:00

Python f-strings offer a concise and efficient way to interpolate variables, objects, and expressions directly into strings. By prefixing a string with f or F, you can embed expressions within curly braces ({}), which are evaluated at runtime.

This makes f-strings faster and more readable compared to older approaches like the modulo (%) operator or the string .format() method. Additionally, f-strings support advanced string formatting using Python’s string format mini-language.

By the end of this tutorial, you’ll understand that:

  • An f-string in Python is a string literal prefixed with f or F, allowing for the embedding of expressions within curly braces {}.
  • To include dynamic content in an f-string, place your expression or variable inside the braces to interpolate its value into the string.
  • An f-string error in Python often occurs due to syntax issues, such as unmatched braces or invalid expressions within the string.
  • F-string calculation in Python involves writing expressions within the curly braces of an f-string, which Python evaluates at runtime.
  • Python 3.12 improved f-strings by allowing nested expressions and the use of backslashes.

This tutorial will guide you through the features and advantages of f-strings, including interpolation and formatting. By familiarizing yourself with these features, you’ll be able to effectively use f-strings in your Python projects.

Get Your Code: Click here to download the free sample code that shows you how to do string interpolation and formatting with Python’s f-strings.

Take the Quiz: Test your knowledge with our interactive “Python F-Strings” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Python F-Strings

In this quiz, you'll test your knowledge of Python f-strings. With this knowledge, you'll be able to include all sorts of Python expressions inside your strings.

Interpolating and Formatting Strings Before Python 3.6

Before Python 3.6, you had two main tools for interpolating values, variables, and expressions inside string literals:

  1. The string interpolation operator (%), or modulo operator
  2. The str.format() method

You’ll get a refresher on these two string interpolation tools in the following sections. You’ll also learn about the string formatting capabilities that these tools offer in Python.

The Modulo Operator (%)

The modulo operator (%) was the first tool for string interpolation and formatting in Python and has been in the language since the beginning. Here’s what using this operator looks like in practice:

Python >>> name = "Jane" >>> "Hello, %s!" % name 'Hello, Jane!' Copied!

In this quick example, you use the % operator to interpolate the value of your name variable into a string literal. The interpolation operator takes two operands:

  • A string literal containing one or more conversion specifiers
  • The object or objects that you’re interpolating into the string literal

The conversion specifiers work as replacement fields. In the above example, you use the %s combination of characters as a conversion specifier. The % symbol marks the start of the specifier, while the s letter is the conversion type and tells the operator that you want to convert the input object into a string.

If you want to insert more than one object into your target string, then you can use a tuple. Note that the number of objects in the tuple must match the number of format specifiers in the string:

Python >>> name = "Jane" >>> age = 25 >>> "Hello, %s! You're %s years old." % (name, age) 'Hello, Jane! You're 25 years old.' Copied!

In this example, you use a tuple of values as the right-hand operand to %. Note that you’ve used a string and an integer. Because you use the %s specifier, Python converts both objects to strings.

You can also use dictionaries as the right-hand operand in your interpolation expressions. To do this, you need to create conversion specifiers that enclose key names in parentheses:

Python >>> "Hello, %(name)s! You're %(age)s years old." % {"name": "Jane", "age": 25} "Hello, Jane! You're 25 years old." Copied!

This syntax provides a readable approach to string interpolation with the % operator. You can use descriptive key names instead of relying on the positional order of values.

When you use the % operator for string interpolation, you can use conversion specifiers. They provide some string formatting capabilities that take advantage of conversion types, conversion flags, and some characters like the period (.) and the asterisk (*). Consider the following example:

Python >>> "Balance: $%.2f" % 5425.9292 'Balance: $5425.93' >>> print("Name: %s\nAge: %5s" % ("John", 35)) Name: John Age: 35 Copied! Read the full article at https://realpython.com/python-f-strings/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Real Python: What Does if __name__ == "__main__" Do in Python?

Planet Python - Sat, 2024-11-30 09:00

The if __name__ == "__main__" idiom is a Python construct that helps control code execution in scripts. It’s a conditional statement that allows you to define code that runs only when the file is executed as a script, not when it’s imported as a module.

When you run a Python script, the interpreter assigns the value "__main__" to the __name__ variable. If Python imports the code as a module, then it sets __name__ to the module’s name instead. By encapsulating code within if __name__ == "__main__", you can ensure that it only runs in the intended context.

By the end of this tutorial, you’ll understand that:

  • Python’s if __name__ == "__main__" idiom allows code to run only when the script is executed, not when it’s imported.
  • The idiom checks if the __name__ variable equals "__main__", confirming that the script is the top-level module.
  • Using this idiom helps prevent unintended code execution during module imports.
  • It’s useful for adding script-specific logic, such as user input or test cases, without affecting module imports.
  • Best practices suggest using this idiom minimally and placing it at the bottom of the script for clarity.

You’ve likely encountered Python’s if __name__ == "__main__" idiom when reading other people’s code. No wonder—it’s widespread! Understanding Python’s if __name__ == "__main__" idiom will help you to manage script execution and module imports effectively. In this tutorial you’ll explore its mechanics, appropriate usage, and best practices.

Take the Quiz: Test your knowledge with our interactive “Python Name-Main Idiom” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Python Name-Main Idiom

Test your knowledge of Python's if __name__ == "__main__" idiom by answering a series of questions! You've probably encountered the name-main idiom and might have even used it in your own scripts. But did you use it correctly?

Get Your Code: Click here to download the free sample code that you’ll use to learn about the name-main idiom.

In Short: It Allows You to Execute Code When the File Runs as a Script, but Not When It’s Imported as a Module

For most practical purposes, you can think of the conditional block that you open with if __name__ == "__main__" as a way to store code that should only run when your file is executed as a script.

You’ll see what that means in a moment. For now, say you have the following file:

Python echo.py 1def echo(text: str, repetitions: int = 3) -> str: 2 """Imitate a real-world echo.""" 3 echoes = [text[-i:].lower() for i in range(repetitions, 0, -1)] 4 return "\n".join(echoes + ["."]) 5 6if __name__ == "__main__": 7 text = input("Yell something at a mountain: ") 8 print(echo(text)) Copied!

In this example, you define a function, echo(), that mimics a real-world echo by gradually printing fewer and fewer of the final letters of the input text.

Below that, in lines 6 to 8, you use the if __name__ == "__main__" idiom. This code starts with the conditional statement if __name__ == "__main__" in line 6. In the indented lines, 7 and 8, you then collect user input and call echo() with that input. These two lines will execute when you run echo.py as a script from your command line:

Shell $ python echo.py Yell something at a mountain: HELLOOOO ECHOOOOOOOOOO ooo oo o . Copied!

When you run the file as a script by passing the file object to your Python interpreter, the expression __name__ == "__main__" returns True. The code block under if then runs, so Python collects user input and calls echo().

Try it out yourself! You can download all the code files that you’ll use in this tutorial from the link below:

Get Your Code: Click here to download the free sample code that you’ll use to learn about the name-main idiom.

At the same time, if you import echo() in another module or a console session, then the nested code won’t run:

Python >>> from echo import echo >>> print(echo("Please help me I'm stuck on a mountain")) ain in n . Copied!

In this case, you want to use echo() in the context of another script or interpreter session, so you won’t need to collect user input. Running input() would mess with your code by producing a side effect when importing echo.

When you nest the code that’s specific to the script usage of your file under the if __name__ == "__main__" idiom, then you avoid running code that’s irrelevant for imported modules.

Nesting code under if __name__ == "__main__" allows you to cater to different use cases:

  • Script: When run as a script, your code prompts the user for input, calls echo(), and prints the result.
  • Module: When you import echo as a module, then echo() gets defined, but no code executes. You provide echo() to the main code session without any side effects.

By implementing the if __name__ == "__main__" idiom in your code, you set up an additional entry point that allows you to use echo() right from the command line.

There you go! You’ve now covered the most important information about this topic. Still, there’s more to find out, and there are some subtleties that can help you build a deeper understanding of this code specifically and Python more generally.

Read the full article at https://realpython.com/if-name-main-python/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Real Python: Logging in Python

Planet Python - Sat, 2024-11-30 09:00

Logging in Python lets you record important information about your program’s execution. You use the built-in logging module to capture logs, which provide insights into application flow, errors, and usage patterns. With Python logging, you can create and configure loggers, set log levels, and format log messages without installing additional packages. You can also generate log files to store records for later analysis.

Using a logging library instead of print() calls gives you better control over log management, formatting, and output destinations. The logging module also allows you to set severity levels, simplifying the management and filtering of log data.

By the end of this tutorial, you’ll understand that:

  • Logging in a computer involves recording program execution information for analysis.
  • You can use logging for debugging, performance analysis, and monitoring usage patterns.
  • No installation is needed for Python logging as the logging module is part of Python’s standard library.
  • Logging in Python works by configuring loggers and setting log levels.
  • Using a logging library provides structured logging and control over log output.
  • You should prefer logging over print() because it decreases the maintainance burden and allows you to manage log levels.
  • You can generate a log file in Python by setting filename and encoding through basicConfig().

You’ll do the coding for this tutorial in the Python standard REPL. If you prefer Python files, then you’ll find a full logging example as a script in the materials of this tutorial. You can download this script by clicking the link below:

Get Your Code: Click here to download the free sample code that you’ll use to learn about logging in Python.

Take the Quiz: Test your knowledge with our interactive “Logging in Python” quiz. You’ll receive a score upon completion to help you track your learning progress:

Interactive Quiz

Logging in Python

In this quiz, you'll test your understanding of Python's logging module. With this knowledge, you'll be able to add logging to your applications, which can help you debug errors and analyze performance.

If you commonly use Python’s print() function to get information about the flow of your programs, then logging is the natural next step for you. This tutorial will guide you through creating your first logs and show you how to make logging grow with your projects.

Starting With Python’s Logging Module

The logging module in Python’s standard library is a ready-to-use, powerful module that’s designed to meet the needs of beginners as well as enterprise teams.

Note: Since logs offer a variety of insights, the logging module is often used by other third-party Python libraries, too. Once you’re more advanced in the practice of logging, you can integrate your log messages with the ones from those libraries to produce a homogeneous log for your application.

To leverage this versatility, it’s a good idea to get a better understanding of how the logging module works under the hood. For example, you could take a stroll through the logging module’s source code

The main component of the logging module is something called the logger. You can think of the logger as a reporter in your code that decides what to record, at what level of detail, and where to store or send these records.

Exploring the Root Logger

To get a first impression of how the logging module and a logger work, open the Python standard REPL and enter the code below:

Python >>> import logging >>> logging.warning("Remain calm!") WARNING:root:Remain calm! Copied!

The output shows the severity level before each message along with root, which is the name the logging module gives to its default logger. This output shows the default format that can be configured to include things like a timestamp or other details.

In the example above, you’re sending a message on the root logger. The log level of the message is WARNING. Log levels are an important aspect of logging. By default, there are five standard levels indicating the severity of events. Each has a corresponding function that can be used to log events at that level of severity.

Note: There’s also a NOTSET log level, which you’ll encounter later in this tutorial when you learn about custom logging handlers.

Here are the five default log levels, in order of increasing severity:

Log Level Function Description DEBUG logging.debug() Provides detailed information that’s valuable to you as a developer. INFO logging.info() Provides general information about what’s going on with your program. WARNING logging.warning() Indicates that there’s something you should look into. ERROR logging.error() Alerts you to an unexpected problem that’s occured in your program. CRITICAL logging.critical() Tells you that a serious error has occurred and may have crashed your app.

The logging module provides you with a default logger that allows you to get started with logging without needing to do much configuration. However, the logging functions listed in the table above reveal a quirk that you may not expect:

Python >>> logging.debug("This is a debug message") >>> logging.info("This is an info message") >>> logging.warning("This is a warning message") WARNING:root:This is a warning message >>> logging.error("This is an error message") ERROR:root:This is an error message >>> logging.critical("This is a critical message") CRITICAL:root:This is a critical message Copied!

Notice that the debug() and info() messages didn’t get logged. This is because, by default, the logging module logs the messages with a severity level of WARNING or above. You can change that by configuring the logging module to log events of all levels.

Adjusting the Log Level

To set up your basic logging configuration and adjust the log level, the logging module comes with a basicConfig() function. As a Python developer, this camel-cased function name may look unusual to you as it doesn’t follow the PEP 8 naming conventions:

Read the full article at https://realpython.com/python-logging/ »

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

EuroPython: EuroPython Society 2024 fellows

Planet Python - Sat, 2024-11-30 05:42

Hi everyone! A warm welcome to the newly elected EuroPython Society Fellows in the year 2024.

    • Laís Carvalho
    • Cyril Bitterich

EuroPython Society Fellows

EuroPython Society Fellows have contributed significantly towards our mission, the EuroPython conference and the Society as an organisation. They are eligible for a lifetime free attendance of the EuroPython conference and will be listed on our EuroPython Society Fellow Grant page in recognition of their work.‌

Laís has been volunteering with the EPS since 2020 and is currently serving as a board member for 2023–2024. Theofanis wrote in nominating her for the EuroPython Society fellowship.

Lais is the "superhero" of this year&aposs EuroPython Organization. She&aposs constantly trying to improve our processes, our way of operating, to push for diversity and inclusion, and to make things happen. Apart from that, she&aposs always passionate about the EuroPython Society Mission, actioning on community outreach, expanding EPS communication channels and helping, in action, EPS to support the local python communities. I have no doubt that with her key contribution, 2024 will be one of the most impactful years for the mission of EPS.

Cyril started volunteering for EuroPython since 2022, He started helping with Ops and Programme teams initially and his firefighting skills proved invaluable as he supported other teams and the general organisation, making him a de facto member of the 2024 core organisers team. Theofanis Petkos put it best in his email, nominating Cyril for the EuroPython Society fellowship

Cyril is one of the most dedicated volunteers I&aposve ever met. You&aposll argue with him, he&aposll care, you&aposll ask for his help. He will have input, he will review everything on time. Constantly trying to help, to include more people and always passionate about documenting all of our processes. Cyril is one of the people I&aposm very proud I have worked with and I&aposm sure with his contribution EPS will make a lot of steps forward.

The EuroPython Society Board would like to congratulate and thank all the above new Fellows for their tireless work towards our mission! If you want to send in your nomination, check out our Fellowship page and get in touch!

Many thanks,
EuroPython Society
https://www.europython-society.org/

Categories: FLOSS Project Planets

Aurelien Jarno: UEFI Unified Kernel Image for Debian Installer on riscv64

Planet Debian - Sat, 2024-11-30 04:41

On the riscv64 port, the default boot method is UEFI, with U-Boot typically used as the firmware. This approach aligns more closely with other architectures, which avoid developping riscv64 specific code. For advanced users, booting using U-Boot and extlinux is possible, thanks to the kernel being built with CONFIG_EFI_STUB=y.

The same applies to the Debian Installer, which is provided as ISO images in various sizes and formats like on other architectures. These images can be put on a USB drive or an SD-card and booted directly from U-Boot in UEFI mode. Some users prefer to use the netboot "image", which in practice consists of a Linux kernel, an initrd, plus a set of Device Tree Blob (DTB) files.

However, booting this in UEFI mode is not straightforward, unless you use a TFTP server, which is also not trivial. Less known to users, there is also a corresponding mini.iso image, which contains all the above plus a bootloader. This offers a simpler alternative for installation, but depending on your (vendor) U-Boot version this still requires to go through a media.

Systemd version 257-rc2 comes with a great new feature, the ability to include multiple DTB files in a single UKI (Unified Kernel Image) file, with systemd-stub automatically loading the appropriate one for the current hardware. A UKI file combines a UEFI boot stub program, a Linux kernel image, an optional initrd, and further resources in a single UEFI PE file. This finally solves the DTB problem in the UEFI world for distributions, as a single image can work on multiple boards.

Building upon this, debian-installer on riscv64 now also creates a UEFI UKI mini.efi image, which contains systemd-stub, a Linux kernel, an initrd, plus a set of Device Tree Blob (DTB) files. Using this image also ensures that the system is booted in UEFI mode. Booting it with debian-installer is as simple as:

load mmc 0:1 mini.efo $kernel_addr_r # (can also be done using tftpboot, wget, etc.) bootefi $kernel_addr_r

Additional parameters can be passed to the image using the U-Boot bootargs environment variable. For instance, to boot in rescue mode:

setenv bootargs "rescue/enable=true"
Categories: FLOSS Project Planets

October/November in KDE Itinerary

Planet KDE - Sat, 2024-11-30 03:00

In the two month since the previous summary KDE Itinerary got a new trip map view, per-trip statistics and better Android integration, and we have been preparing for Transious’ move to MOTIS v2, to just name a few things.

New Features Trip map

The move to a per-trip timeline view described in the previous issue enables a bunch of new per-trip features.

The first of those is a map view for all activities and locations related to a trip.

Trip map view in Itinerary.

Locations and intermediate stops are interactive and show additional information when clicked.

Trip statistics

Itinerary now also shows a summary of the traveled distance, the estimated CO₂ emission and the total cost for each trip. The cost is based on information extracted from travel documents or manual editing of individual entries, and is automatically converted into your home currency if currency conversions are enabled in the settings.

Trip statistics in Itinerary. Pre-defined locations for journey searches

All locations involved in the current trip are now added to the location search history for train or bus journey searches. They appear similarly to entries from past searches (but unlike those cannot be deleted).

This avoids having to enter locations again that you’ll likely need in public transport search during a trip.

New timeline layout

There’s ongoing work for an updated timeline layout, in particular for public transport journeys, making the effects of delays and disruptions easier to see. It’s not yet finished and integrated at the time of writing (but might very well be by the time of publishing this post), so this will be covered next time. In the meantime you’ll probably get to see pictures of it in one of the next “This Week in KDE Apps” posts on Planet KDE.

Infrastructure Work MOTIS v2

Transitous, the community-run free and open public transport routing services used by Itinerary, is preparing to move to the next major version of the routing engine MOTIS.

This meant implementing support for the new MOTIS API in KPublicTransport. The new API provides more control over access and egress modes and transfer times and returns more detailed information for foot paths (more details here).

Transfer foot path shown on a map.

MOTIS v2 brings considerable performance improvements for OSM-based routing which should make it viable for Transitous to deploy door-to-door routing rather than just the current stop-to-stop routing. That is also the prerequisite for enabling support for shared vehicle routing eventually.

Android platform integration

There have also been a number of improvements on Android platform integration, most of which not just benefit Itinerary but all KDE Android apps.

  • Fixed the translation lookup order when non-US English is used as one of multiple languages in the system settings.
  • Fixed deploying and loading of Qt’s own translation catalogs.
  • Implemented support for the 24h time format platform settings in locales that usually use a 12h format (CR 600295, available in Qt 6.8.1).
  • Enabled support for app-specific language selection in Android 13 or higher.
  • Foundational work on changing the application language at runtime in Qt and KDE Frameworks. For complete support this is still missing reevaluating locale API related expressions in QML (CR 599626).

There’s some more details in a dedicated post about this.

Matrix session verification

While trip synchronization over Matrix unfortunately didn’t get done after all in time for 24.12, there’s nevertheless progress here.

Most notable is support for Matrix session verification, which is a prerequisite for end-to-end encrypted (E2EE) communication.

Emoji-based Matrix session verification.

After a fix in libQuotient the trip syncing code can now also handle attached documents, using Matrix’ built-in E2EE file sharing.

Lobbying & Politics

Last week I attended a networking event hosted by DELFI together with a couple of others representing various FOSS and Open Data projects and communities. DELFI is the entity producing Germany’s national aggregate public transport datasets. Those are used by Transitous and thus indirectly by Itinerary, and getting in direct contact with the people working on this is obviously useful.

  • Most of what I heart was sensible and aligns with what we’d like to see as well, e.g. around quality gates for the datasets. One major exception was Deutsche Bahn’s refusal to allow DELFI to publish their realtime data. Coincidentally a new law mandating exactly that just had its first reading in the second chamber of the German parliament that day, so fortunately the pressure to publish this just keeps increasing.
  • Lacking a better “official” channel some of the DELFI teams actually use the community-provided Github issue repositories as feedback channels for data issues. That works, any channel to get fixes upstream is good.
  • The current realtime feed is supposed to cover about 70% of the static data and contain up to 22k concurrent trips according to DELFI, which is very far from what we actually see in Transitous currently. Where exactly that difference comes from isn’t fully understood yet though, but knowing the expectation and having people to talk to should help with resolving that.

This is the first time DELFI ran such an event also open to externals. Good to see some things slowly turning into the right direction after years of pushing by the community. There’s still much more to wish for of course, such as a deeper collaboration/integration between the stop registry and OSM.

Fixes & Improvements Travel document extractor
  • New or improved extractors for Agoda, Booking.com, Eurostar/Thalys, Flixbus, lu.ma, NH Hotels, NS, planway.com, Renfe, SBB, Thai state railway, Trenitalia and VietJet Air.
  • Support for automatic price extraction from Apple Wallet files that use the currencyCode field.

All of this has been made possible thanks to your travel document donations!

Public transport data
  • Unfortunately Navitia ended their service, so the corresponding backend has been removed. For most affected areas there are fortunately alternatives meanwhile, such as Transitous.
  • Added support for the NS onboard API.
  • Translated backend information are reloaded correctly now when the system language changes.
  • Implausible turns in railway paths found in German GTFS shapes or Hafas responses are now filtered out.
  • The journey query API now has support for indicating a required bike transport, for specifying direct transportation preferences and for returning rental vehicle booking deep links.
  • More Wikidata logo properties are considered for line logos now.
Itinerary app
  • Favorite locations used in a trip are now also part of a trip export.
  • Transfers can now be added in more cases.
  • Statistics also include transfers and live data where available, which should yield more accurate results.
  • Incremental import of multi-traveler reservations has been fixed.
  • The weather forecast on the entire day of departure and day of arrival is now included in the trip timeline.
  • Checking for updates and downloading map data are now per-trip rather than global actions.
  • Added a safety question before clearing the stop search history.
  • Enabled importing GIF images on Android.
  • Fixed importing DB return tickets via the online import.
  • Fixed barcode scanning when using Itinerary as a Flatpak.
  • Fixed display of canceled journeys.
  • Fixed initial Matrix account setup working without needing a restart of the app.
  • A fix for QtLocation map updates sometimes getting stuck until an application restart is still stuck in review (affects not just Itinerary).
How you can help

Feedback and travel document samples are very much welcome, as are all other forms of contributions. Feel free to join us in the KDE Itinerary Matrix channel.

Categories: FLOSS Project Planets

This Week in Plasma: Disable-able KWin Rules

Planet KDE - Fri, 2024-11-29 23:00

This week there was a flurry of UI polishing work and a nice new feature to go along with the usual background level of bug-fixing. Some of the changes are quite consequential, being minor pain points for years. So hopefully this should be a crowd-pleasing week! If that's the case, consider directing your pleased-ness at KDE's year-end fundraiser! As of the time of writing, we're at 98% of our goal, and it would be amazing to get to 100% by the end of November!

Notable New Features

It's now possible to temporarily disable KWin window rules rather than fully deleting them. (Ismael Asensio, 6.3.0. Link)

Notable UI Improvements

Discover no longer shows you a bunch of irrelevant information about Flatpak runtime packages. (Nate Graham, 6.2.4. Link)

The User Switcher widget now has a more sensible default height, fitting its content better. (Blazer Silving, 6.2.4. Link)

When you've disabled window thumbnails in the Task Manager widget, it now shows normal tooltips for open windows, rather than nothing at all. (Nate Graham, 6.3.0. Link)

Wireless headphones that expose battery information properly (as opposed to headsets, which include a microphone) now get a better icon in the Power and Battery widget and low battery notifications (Kai Uwe Broulik, 6.3.0. Link 1 and link 2)

KWin's Slide Back effect now has a duration that better matches the duration of other effects and animations, and responds more predictably and consistently to non-default global animation speed settings. (Blazer Silving, 6.3.0. Link)

On Ubuntu-based distros, the icon that appears in the System Tray alerting you to a major update available is now symbolic when using the Breeze icon theme, matching other such icons. (Nate Graham, Frameworks 6.9. Link)

Resizing windows for Qt-Quick-based apps should now look significantly better and smoother. (David Edmundson, Qt 6.9.0. Link)

Qt is now capable of displaying color emojis interspersed with black-and-white text when using the default font settings in Plasma. (Eskil Abrahamsen Blomfeldt, Qt 6.9.0. Link)

Notable Bug Fixes

Fixed a case where Plasma could crash when you dismiss a notification about network changes. (Nicolas Fella, 6.2.4. Link)

Fixed a case where KWin could crash after running out of file descriptors when using certain non-Intel GPU drivers. (Xaver Hugl, 6.2.5. Link)

System Settings no longer crashes when you plug in a mouse while viewing the Mouse page. (Nicolas Fella, 6.2.5. Link)

Fixed a strange issue that would cause notifications to be mis-positioned after the first time you dragged any widgets that were on the desktop. This turned out to have been caused by the Plasma config file having old crusty System Tray widgets in it left over from prior Plasma customizations, which were competing for control over the positions of notifications. Now they're cleaned up properly, which also reduces memory usage, removes a ton of cruft in the config file, and may resolve other mysterious and random-seeming issues with notifications being positioned incorrectly. (Marco Martin, 6.2.5. Link 1 and link 2)

Fixed a bug that could make panels in "Fit Content" mode sometimes be too small when Plasma loads. (Niccolò Venerandi, 6.3.0. Link)

Fixed one of the last remaining known bugs relating to desktop icons shifting around: this time due to always-visible panels loading after the desktop and sometimes pushing the icons away. Now that doesn't happen anymore! (Akseli Lahtinen, 6.3.0. Link)

Fixed a regression caused by a change elsewhere in the stack that interacted poorly with some questionable code on our side that caused the highlight effect on the tab bar in the expanded view for the active network in the Networks widget to be invisible. (Harald Sitter, 6.3.0. Link)

Fixed a regression introduced with Frameworks 6.7 that caused many pieces of selected text in Plasma and QtQuick-based apps to become inappropriately de-selected after right-clicking on them. (Akseli Lahtinen, Frameworks 6.9. Link)

Other bug information of note:

Notable in Performance & Technical

Made KWin more robust against apps that send faulty HDR metadata so that it is less likely to crash when encountering this condition. (Xaver Hugl, 6.2.5. Link)

Made Plasma more robust against faulty widgets; now it is more likely to communicate a comprehensible error message rather than crashing. (Nicolas Fella, 6.2.5. Link)

Made Plasma more robust against malformed .desktop files; now it similarly robust against more types of broken files. (Alexander Lohnau, 6.2.4. Link)

How You Can Help

KDE has become important in the world, and your time and contributions have helped us get there. As we grow, we need your support to keep KDE sustainable.

You can help KDE by becoming an active community member and getting involved somehow. Each contributor makes a huge difference in KDE — you are not a number or a cog in a machine!

You don’t have to be a programmer, either. Many other opportunities exist:

You can also help us by donating to our yearly fundraiser! Any monetary contribution — however small — will help us cover operational costs, salaries, travel expenses for contributors, and in general just keep KDE bringing Free Software to the world.

To get a new Plasma feature or a bugfix mentioned here, feel free to push a commit to the relevant merge request on invent.kde.org.

Categories: FLOSS Project Planets

Russell Coker: Links November 2024

Planet Debian - Fri, 2024-11-29 21:52

Interesting news about NVidia using RISC-V CPUs in all their GPUs [1]. Hopefully they will develop some fast RISC-V cores.

Interesting blog post about using an 8K TV as a monitor, I’m very tempted to do this [2].

Interesting post about how the Windows kernel development work can’t compete with Linux kernel development [3].

Paul T wrote an insightful article about the ideal of reducing complexity of computer systems and the question of from who’s perspective complexity will be reduced [4].

Interesting lecture at the seL4 symposium about the PANCAKE language for verified systems programming [5]. The idea that “if you are verifying your code types don’t help much” is interesting.

Interesting lecture from the seL4 summit about real world security, starts with the big picture and ends with seL4 specifics [6].

Interesting lecture from the seL4 summit about Cog’s work building a commercial virtualised phome [7]. He talks about not building a “brick of a smartphone that’s obsolete 6 months after release”, is he referring to the Librem5?

Informative document about how Qualcom prevents OSs from accessing EL2 on Snapdragon devices with a link to a work-around for devices shipped with Windows (not Android), this means that only Windows can use the hypervisor features of those CPUs [8].

Linus tech tips did a walk through of an Intel fab, I learned a few things about CPU manufacture [9].

Interesting information on the amount of engineering that can go into a single component. There’s lots of parts that are grossly overpriced (Dell and HP have plenty of examples in their catalogues) but generally aerospace doesn’t have much overpricing [10].

Interesting lecture about TEE on RISC-V with the seL4 kernel [11].

Ian Jackson wrote an informative blog post about the repeating issue of software licenses that aren’t free enough with Rust being the current iteration of this issue [12].

The quackery of Master Bates to allegedly remove the need for glasses is still going around [13].

Related posts:

  1. Links October 2024 Dacid Brin wrote an interesting article about AI ecosystems and...
  2. Links August 2024 Bruce Schneier and Kim Córdova wrote an insightful article about...
  3. Links September 2024 CNA Insider has an insightful documentary series about Chinese illegal...
Categories: FLOSS Project Planets

FSF Blogs: FSD meeting recap 2024-11-29

GNU Planet! - Fri, 2024-11-29 15:43
Check out the important work our volunteers accomplished at today's Free Software Directory (FSD) IRC meeting.
Categories: FLOSS Project Planets

FSD meeting recap 2024-11-29

FSF Blogs - Fri, 2024-11-29 15:43
Check out the important work our volunteers accomplished at today's Free Software Directory (FSD) IRC meeting.
Categories: FLOSS Project Planets

Dirk Eddelbuettel: RcppAPT 0.0.10: Maintenance

Planet Debian - Fri, 2024-11-29 15:19

A new version of the RcppAPT package arrived on CRAN earlier today. RcppAPT connects R to the C++ library behind the awesome apt, apt-get, apt-cache, … commands (and their cache) which powering Debian, Ubuntu and other derivative distributions.

RcppAPT allows you to query the (Debian or Ubuntu) package dependency graph at will, with build-dependencies (if you have deb-src entries), reverse dependencies, and all other goodies. See the vignette and examples for illustrations.

This release moves the C++ compilation standard from C++11 to C++17. I had removed the setting for C++11 last year as compilation ‘by compiler default’ worked well enough. But the version at CRAN still carried, which started to lead to build failures on Debian unstable so it was time for an update. And rather than implicitly relying on C++17 as selected by the last two R releases, we made it explicit. Otherwise a few of the regular package and repository updates have been made, but no new code or features were added The NEWS entries follow.

Changes in version 0.0.10 (2024-11-29)
  • Package maintenance updating continuous integration script versions as well as coverage link from README, and switching to Authors@R

  • C++ compilation standards updated to C++17 to comply with libapt-pkg

Courtesy of my CRANberries, there is also a diffstat report for this release. A bit more information about the package is available here as well as at the GitHub repo. If you like this or other open-source work I do, you can now sponsor me at GitHub.

This post by Dirk Eddelbuettel originated on his Thinking inside the box blog. Please report excessive re-aggregation in third-party for-profit settings.

Categories: FLOSS Project Planets

Anwesha Das: Keynote at PyLadiesCon!

Planet Python - Fri, 2024-11-29 12:35

Since the very inception of my journey in Python and PyLadies, I have always thought of having a PyLadies Conference, a celebration of PyLadies. There were conversations here and there, but nothing was fruitful then. In 2023, Mariatta, Cheuk, Maria Jose, and many more PyLadies volunteers around the globe made this dream come true, and we had our first ever PyLadiesCon.
I submitted a talk for the first-ever PyLadiesCon (how come I didn&apost?), and it was rejected. In 2024, I missed the CFP deadline. I was sad. Will I never be able to participate in PyLadiesCon?

On October 10th, 2024, I had my talk at PyCon NL. I woke up early to practice. I saw an email from PyLadiesCon, titled "Invitation to be a Keynote Speaker at PyLadiesCon". The panic call went to Kushal Das. "Check if there is any attack in the Python server? I got a spamming email about PyLadiesCon and the address is correct. "No, nothing.", replied Kushal after checking. Wait then "WHAT???". PyLadiesCon wants me to give the keynote. THE KEYNOTE in PyLadiesCon.

Thank you Audrey for conceptualizing and creating PyLadies, our home.

And here I am now. I will give the keynote on 7 December 2024 at PyLadiesCon on how PyLadies gave me purpose. See you all there.

Dreams do come true.

Categories: FLOSS Project Planets

The Drop Times: The Beginning and Growth of Splash Awards with Bert Boerland

Planet Drupal - Fri, 2024-11-29 09:03
The Splash Awards 2024 marks a decade of celebrating innovation and excellence in Drupal, putting the spotlight on agencies and users who push boundaries in the field. Bert Boerland, Chairman of the Drupal Netherlands Foundation, reflects on the journey from a bold idea in 2014 to a prestigious event that now inspires entries from around the globe. From overcoming challenges in jury selection to dreaming of a pan-European “Euro Splash Awards,” Bert shares insights and memorable moments from the awards’ evolution. Interview by Esmeralda Braad-Tijhoff.
Categories: FLOSS Project Planets

Real Python: The Real Python Podcast – Episode #230: marimo: Reactive Notebooks and Deployable Web Apps in Python

Planet Python - Fri, 2024-11-29 07:00

What are common issues with using notebooks for Python development? How do you know the current state, share reproducible results, or create interactive applications? This week on the show, we speak with Akshay Agrawal about the open-source reactive marimo notebook for Python.

[ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Categories: FLOSS Project Planets

Web Review, Week 2024-48

Planet KDE - Fri, 2024-11-29 06:49

Let’s go for my web review for the week 2024-48.

Are Overemployed ‘Ghost Engineers’ Making Six Figures to Do Nothing?

Tags: tech, algorithm, productivity, business

Can you see this kind of models getting abused quickly? Clearly it says something about the tech industry wanting to reduce costs.

https://www.404media.co/are-overemployed-ghost-engineers-making-six-figures-to-do-nothing/


the tech utopia fantasy is over

Tags: tech, politics

Technology isn’t neutral. It’s impossible to ignore the ideologies of the moguls funding or leading big tech companies. We can’t afford to trust their promises.

https://blog.avas.space/tech-utopia-fantasy/


X’s Objection to the Onion Buying InfoWars Is a Reminder You Do Not Own Your Social Media Accounts

Tags: tech, social-media, twitter, law

Everything is in the title… if you thought you owned anything on those platforms, think twice.

https://www.404media.co/xs-objection-to-the-onion-buying-infowars-is-a-reminder-you-do-not-own-your-social-media-accounts/


OpenAI blamed NYT for tech problem erasing evidence of copyright abuse

Tags: tech, ai, machine-learning, gpt, law, copyright

More shady practices to try to save themselves. Let’s hope it won’t work.

https://arstechnica.com/tech-policy/2024/11/tech-problems-plague-openai-court-battles-judge-rejects-a-key-fair-use-defense/


‘Thirsty’ ChatGPT uses four times more water than previously thought

Tags: tech, ai, machine-learning, gpt, ecology, water

The water problem is obviously hard to ignore. This piece does a good job illustrating how large the impact is.

https://www.thetimes.com/uk/technology-uk/article/thirsty-chatgpt-uses-four-times-more-water-than-previously-thought-bc0pqswdr


Self-Hosting Isn’t a Solution; It’s A Patch

Tags: tech, self-hosting, privacy, gdpr, law, politics, decentralized

Definitely this. Sure we should seek for decentralization, but this is not going to happen or be effective without regulation. Ensuring privacy is a legislative and political problem as much as a technical one.

https://matduggan.com/self-hosting-isnt-a-solution-its-a-patch/


How decentralized is Bluesky really?

Tags: tech, social-media, fediverse, decentralized, bluesky

A long and comprehensive analysis of Bluesky. Also brings interesting critiques about both Bluesky and the Fediverse. Clearly Bluesky as of today is not effectively decentralized and shouldn’t be considered as such.

https://dustycloud.org/blog/how-decentralized-is-bluesky/


Reply on Bluesky and Decentralization

Tags: tech, social-media, bluesky, fediverse, decentralized

The debate about how BlueSky and decentralisation or federation continues. It’s nice to see how civilized the people involved are. This is how we can make progress.

https://whtwnd.com/bnewbold.net/3lbvbtqrg5t2t


So you want to write a KMail plugin?

Tags: tech, kde, documentation

Since the documentation is severely lacking in this area, this ends up being a nice how to. I wish we’d have more like this in the official documentation.

https://datagirl.xyz/posts/kontact_plugin_writing.html


The two factions of C++

Tags: tech, c++, safety, community

It’s clear that a split is forming in the C++ community on how to evolve the language. Could it lead to a full fledged divorce?

https://herecomesthemoon.net/2024/11/two-factions-of-cpp/#fnref:4


if constexpr requires requires { requires }

Tags: tech, c++, metaprogramming, type-systems

Are you confused with the use of requires in C++20? This post might help.

https://www.think-cell.com/en/career/devblog/if-constexpr-requires-requires-requires


Unsafe for work

Tags: tech, rust, safety

Good explanation of what Rust’s unsafe really does.

https://oida.dev/unsafe-for-work/


Mark–Scavenge: Waiting for Trash to Take Itself Out – Inside.java

Tags: tech, java, memory, garbage-collector

Looks like there is a new venue to improve garbage collectors performance. This should be interesting down the line.

https://inside.java/2024/11/22/mark-scavenge-gc/


SLAX: an alternative syntax for XSLT which is tailored for readability and familiarity

Tags: tech, xslt

Tempted to do some XSLT? Did you notice it’s almost 2025? So yeah, just don’t. At least there’s a proper alternative if you still need to process that XML input.

https://github.com/Juniper/libslax/wiki


Petnames: A humane approach to secure, decentralized naming

Tags: tech, security, dns

Interesting approach to have secure and decentralized naming while keeping it human readable.

https://files.spritely.institute/papers/petnames.html


Naming things

Tags: tech, programming, design, craftsmanship

This is a good point. Idiosyncrasies are not necessarily a bad thing for naming things. Natural languages are fickle friends, you might need to rely to specific metaphors in order to disambiguate.

https://wiki.dpk.land/Naming_things


Codin’ Dirty

Tags: tech, programming, complexity, design, tests

Another rebuttal of Clean Code. Most of it makes sense if not overdone. There’s the usual confusion around the “unit tests” term though, so take that section with a pinch of salt.

https://htmx.org/essays/codin-dirty/


Bye for now!

Categories: FLOSS Project Planets

Raju Devidas: Finding all sub domains of a main domain

Planet Debian - Fri, 2024-11-29 05:31

Problem: Need to know all the sub domains of a main domain, e.g. example.com has a sub domain dev.example.com , I also want to know other sub domains.

Solution:

Install the package called sublist3r, written by Ahmed Aboul-Ela

$ sudo apt install sublist3r

run the command

$ sublist3r -d example.com -o subdomains-example.com.txt ____ _ _ _ _ _____ / ___| _ _| |__ | (_)___| |_|___ / _ __ \___ \| | | | &apos_ \| | / __| __| |_ \| &apos__| ___) | |_| | |_) | | \__ \ |_ ___) | | |____/ \__,_|_.__/|_|_|___/\__|____/|_| # Coded By Ahmed Aboul-Ela - @aboul3la [-] Enumerating subdomains now for example.com [-] Searching now in Baidu.. [-] Searching now in Yahoo.. [-] Searching now in Google.. [-] Searching now in Bing.. [-] Searching now in Ask.. [-] Searching now in Netcraft.. [-] Searching now in DNSdumpster.. [-] Searching now in Virustotal.. [-] Searching now in ThreatCrowd.. [-] Searching now in SSL Certificates.. [-] Searching now in PassiveDNS.. Process DNSdumpster-8: Traceback (most recent call last): File "/usr/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/usr/lib/python3/dist-packages/sublist3r.py", line 269, in run domain_list = self.enumerate() ^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/sublist3r.py", line 649, in enumerate token = self.get_csrftoken(resp) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/sublist3r.py", line 644, in get_csrftoken token = csrf_regex.findall(resp)[0] ~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range [!] Error: Google probably now is blocking our requests [~] Finished now the Google Enumeration ... [!] Error: Virustotal probably now is blocking our requests [-] Saving results to file: subdomains-example.com.txt [-] Total Unique Subdomains Found: 7 AS207960 Test Intermediate - example.com www.example.com dev.example.com m.example.com products.example.com support.example.com m.testexample.com

We can see the subdomains listed at the end of the command output.

enjoy, have fun, drink water!

Categories: FLOSS Project Planets

mark.ie: Introducing the New ChatGPT-Powered Drupal Answers Portal

Planet Drupal - Fri, 2024-11-29 05:07

Your Go-To Source for Drupal Answers, direct from trusted sources only.

Categories: FLOSS Project Planets

Pages