Feeds
FSF Events: Free Software Directory meeting on IRC: Friday, September 13, starting at 12:00 EDT (16:00 UTC)
ListenData: How to Integrate Gemini API with Python
In this tutorial, you will learn how to use Google's Gemini AI model through its API in Python.
Steps to Access Gemini APIFollow the steps below to access the Gemini API and then use it in python.
- Visit Google AI Studio website.
- Sign in using your Google account.
- Create an API key.
- Install the Google AI Python library for the Gemini API using the command below :
pip install google-generativeai.
Real Python: When to Use .__repr__() vs .__str__() in Python
One of the most common tasks that a computer program performs is to display data. The program often displays this information to the program’s user. However, a program also needs to show information to the programmer developing and maintaining it. The information a programmer needs about an object differs from how the program should display the same object for the user, and that’s where .__repr__() vs .__str__() comes in.
A Python object has several special methods that provide specific behavior. There are two similar special methods that describe the object using a string representation. These methods are .__repr__() and .__str__(). The .__repr__() method returns a detailed description for a programmer who needs to maintain and debug the code. The .__str__() method returns a simpler description with information for the user of the program.
The .__repr__() and .__str__() methods are two of the special methods that you can define for any class. They allow you to control how a program displays an object in several common forms of output, such as what you get from the print() function, formatted strings, and interactive environments.
In this video course, you’ll learn how to differentiate .__repr__() vs .__str__() and how to use these special methods in the classes you define. Defining these methods effectively makes the classes that you write more readable and easier to debug and maintain. So, when should you choose Python’s .__repr__() vs .__str__?
[ 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 ]
Python Circle: Removing PDF pages using Python and PyPDF2
Jordan Maris joins OSI
Helen Keller said, âAlone we can do so little; together we can do so much.” Although she wouldnât have understood this 2024 expression, we know âshe nailed it.â It takes many of us working together to truly accomplish great things. Thatâs why the OSI staff is so excited to welcome Jordan Maris to our team.
As OSIâs European Policy Analyst, Jordan will work to build a bridge between European Union legislators, the OSI and the wider Open Source community. He will monitor upcoming EU policies and flag issues and opportunities, educate and inform EU lawmakers about Open Source and its benefits, represent the OSI at EU-level events and conferences, and provide analysis and support to the OSI’s board and members on EU policy issues. He will also work closely with other Open Source foundations and organizations to make sure the voice of the Open Source community is heard at an EU level.
Jordan comes well-equipped with the experience he needs to excel in this role. He worked for three years with members of the European Parliament. In his previous position as a senior parliamentary policy advisor, he fought for the Open Source community on laws such as the AI Act, European Digital Identity, Data Act, Product Liability Directive, and Cyber-Resilience Act. He is a strong advocate for the Public MoneyâPublic Code principle and a long-time user of and occasional contributor to Open Source software. He speaks English, French and German.
When asked about his vision for the future of Open Source, Jordan replied, âA world where Open Source is the rule â not the exception, and where developers and communities are consistently supported, listened to and valued.â
Jordan says, âIâm looking forward to being able to devote more time to raising awareness about Open Source among lawmakers and to bringing together the Open Source community and EU lawmakers so that new laws better reflect the needs of the Open Source community.â
Please join me in welcoming Jordan to the team.
joshics.in: Can Contact Forms Be Replaced by AI Chatbots on Drupal Websites?
Contact forms have been a staple on websites for years.
But, are they becoming outdated?
Say hello to AI chatbots.
Hereâs why an AI chatbot might just be the better choice.
Real-time Engagement- Contact forms often mean waiting. Users type out their message, hit send, and then wait for a response. With AI chatbots, the response is instant, providing immediate support and answers.
- Example: A user needs information about your services. Instead of waiting hours (or days) for an email reply, the chatbot instantly provides the details they need.
- Chatbots can guide users through their queries, step-by-step. This ensures visitors aren't left guessing, navigating through multiple pages to find answers.
- Example: Someone asks about your pricing. The chatbot not only shares the info but can also offer links to relevant pages, FAQs, and even schedule a meeting with a sales rep.
- Unlike human staff, chatbots never sleep. They're available around the clock, ensuring your site visitors always get the support they need, no matter the time zone.
- Example: A potential client from another continent visits your site at 3 AM. The chatbot assists them in real-time rather than making them wait until your business hours.
- Modern AI chatbots can personalise interactions based on user data. This means more relevant responses and recommendations tailored to each visitor.
- Example: The chatbot recognises a returning user and picks up the conversation where it left off, making the interaction feel continuous and personal.
But is it all sunshine and rainbows? Not quite.
There are challenges.
Some users may prefer human touch over automation. And, implementing a sophisticated AI chatbot can be resource-intensive.
So, should you replace your contact form with a chatbot?
Maybe not completely. A hybrid approach might work best. Let the chatbot handle routine inquiries and simple tasks, while the contact form can serve for more detailed and specific requests.
What do you think? Can AI chatbots replace traditional contact forms on Drupal websites?
Drupal Drupal 10 AI Drupal Planet Add new commentThe Drop Times: Noahâs Page Builder Simplifies Front-End Design: Julian Chabrillon
1xINTERNET blog: Bridging the gap: unlocking non-code contributions
Non-code contributions in open source communities attract considerable interest. Join a panel discussion with diverse experts who are actively involved in non-code contributions within the Drupal community to bridge a gap between experienced contributors and those considering their first step!
1xINTERNET blog: Hidden Diamonds - The best lesser known Drupal modules you want to add to your website
Discover together with Norman Kaemper-Leymann and Yannick Leyendecker a selection of Drupal contrib modules tailored to specific use cases, including Config Patch GitLab API, Content Templates, Frontend Editing, and more!
1xINTERNET blog: Unlocking AI potential in Drupal: from possibilities to practical applications
AI tools like OpenAI's ChatGPT integrate well with Drupal, but identifying the right use cases can be challenging. Explore together with Christoph Breidert the opportunities and limitations of LLMs and learn how to create impactful AI solutions!
1xINTERNET blog: Elevating content editor experience with realtime inline editing
Learn together with Artem and Bruno how to simplify content management using the Drupal modules âContent Templatesâ and âFrontend Editing.â Discover best practices for managing content at scale and improving the editor experience!
1xINTERNET blog: Transforming digital strategy at scale: a case study of Schwabe Group's journey with Drupal
Explore the digital transformation of one of Europeâs oldest pharmaceutical companies together with Baddy Breidert, CEO of 1xINTERNET, and Alexander Reisenauer, Director of Global Digital Marketing at Schwabe Group. Discover how strategic decisions led to Drupal becoming a key component of Schwabe's digital ecosystem!
Python Anywhere: Issues after system maintenance on 2024-09-05
On Thursday 5 September 2024 we performed some system maintenance. It appeared to have gone well, and was completed at the scheduled time (06:20 UTC), but unfortunately there were unexpected knock-on effects that caused issues later on in the day, and further problems on Saturday 7 September. This post gives the details of why we needed to perform the maintenance, what happened, and what we will do to prevent a recurrence.
The Drop Times: Correction Notice: Important Update in Our Recent Newsletter
Steinar H. Gunderson: GS1900-10HP web session hijack
While fiddling around, I found a (fairly serious) vulnerability in Zyxel's GS1900-10HP and related switches; today Zyxel released an advisory with updated firmware, so I can publish my side of it as well. (Unfortunately there's no Zyxel bounty program, but Zyxel PSIRT has been forthcoming all along, which I guess is all you can hope for.)
The CVE (CVE-2024-38270) is sparse on details, so I'll simply paste my original message to Zyxel below:
Hi, GS1900-10HP (probably also many other switches in the same series), firmware V2.80(AAZI.0) (also older ones) generate web authentication tokens in an unsafe way. This makes it possible for an attacker to guess them and hijack the session. web_util_randStr_generate() contains code that is functionally the same as this: char token[17]; struct timeval now; gettimeofday(&now, NULL); srandom(now.tv_sec + now.tv_usec); for (int i = 0; i < 16; ++i) { long r = random() % 62; char c; if (r < 10) { c = r + '0'; // 0..9 } else if (r < 36) { c = r + ('A' - 10); // A..Z } else { c = r + ('a' - 36); // a..z } token[i] = c; } token[16] = 0; (random() comes from uclibc, but it has the same generator as glibc, so the code runs just as well on desktop Linux) This token is generated on initial login, and stored in a cookie on the client. This has multiple problems: First, the clock is a known quantity; even if the switch is not on SNTP, it is trivial to get its idea of time-of-day by just doing a HTTP request and looking at the Date header. This means that if an attacker knows precisely when the administrator logged in (for instance, by observing a HTTPS login on the network), they will have a very limited range of possible tokens to check. Second, tv_sec and tv_usec are combined in an improper way, canceling out much of the intended entropy. As long as one assumes that the administrator logged in less than a day ago, the entire range of possible seeds it contained within the range [now - 86400, now + 999999], i.e. only about 1.1M possible cookies, which can simply be tried serially even if one did not observe the original login. There is no brute-force protection on the web interface. I have verified that this attack is practical, by simply generating all the tokens and asking for the status page repeatedly (it is trivial to see whether it returns an authentication success or failure). The switch can sustain about one try every 96 ms on average against an attacker on a local LAN (there is no keepalive or multithreading, so the most trivial code is seemingly also the best one), which means that an attack will succeed on average after about 15 hours; my test run succeeded after a bit under three hours. If there are multiple administrator sessions active, the expected time to success is of course lower, although the tries are also somewhat slower because the switch has to deal with the keepalive traffic from the admins. This is a straightforward case of CWE-330 (Use of Insufficiently Random Values), with subcategories CWE-331, CWE-334, CWE-335, CWE-337, CWE-339, CWE-340, CWE-341 and probably others. The suggested fix is simple: Read entropy from /dev/urandom or another good source, instead of using random(). (Make sure that you don't get bias issues due to the use of modulo; you can use e.g. rejection sampling.) Session timeout does help against this attack (by default, it is 3 minutes), but only as long as the administrator has not kept a tab open. If the tab is left open, that keeps on making background requests that refreshes the token every five seconds, guaranteeing a 100% success rate if given a day or two. There is also _tons_ of outdated software on the switch (kernel from 2008, OpenSSH from 2013, netkit-telnetd which is no longer maintained, a fork of a very old NET-SNMP, etc.), but I did not check whether there are any relevant security holes or whether you have actually backported patches.I haven't verified what their fix looks like, but it's probably somewhere there in the GPL dump. :-)
Specbee: Upgrading from Drupal 10 to the all-new Drupal 11 (and whatâs new)
Ben Hutchings: FOSS activity in August 2024
- For the Debian firmware-nonfree package:
- I opened the MR:
- I reviewed the MRs:
- I responded to a query about backporting.
- For the Debian linux package:
- I opened or updated the MRs:
- I reviewed the MRs:
- !964: tools/arch/x86/intel_sdsi: Add sdsi package for Intel SDSi provisioning tool (merged)
- !1136: Compile with gcc-14 on all architectures (merged)
- !1148: [arm64] drivers/phy/marvell: Enable PHY_MVEBU_CP110_UTMI as module (merged)
- !1149: [arm64] Include modules for Lenovo Yoga C630 and Lenovo Miix 630 (merged)
- !1150: Draft: debian/lib/python/debian_linux/debian.py: allow more liberal revision suffixes than just \+b\d+
- !1155: [ia64] Purge ia64 from installer (merged)
- !1156: [x86] enable mfd components for BXT pmic (merged)
- !1157: [x86] Enable IPU6 and related camera options (merged)
- !1163: riscv64 kernel config update for 6.11 (merged)
- !1173: Update to 6.11-rc5 (merged)
- !1165: [amd64] Enable DRM_ACCEL_HABANALABS and DRM_ACCEL_IVPU (merged)
- !1176: [riscv64] fix conflict between kernel-image and mtd-core-modules (merged)
- I merged my own MRs:
- !1161: Fix and clean up Build-Depends
- !1164: d/config: Fix broken configs that were being resolved differently by kconfig
- !1175: Fix perf build failure on many architectures
- I uploaded:
- linux version 6.11~rc4-1~exp1 to experimental.
- linux version 6.11~rc5-1~exp1 to experimental.
- linux version 6.10.6-1~bpo12+1 to bookworm-backports.
- Upstream, I commented on additional backports required to address CVE-2024-26621 and CVE-2024-42258.
- I responded to bug reports:
- Upstream, I submitted the patch aacraid: Fix double-free on probe failure which should fix part of bug #1075855.
- Upstream, I pointed out that the fix in !1175 is needed in Linux 6.11.
- I updated the bullseye-security branch to upstream version 5.10.224, but didnât make a new upload.
- I updated the bullseye-security-6.1 branch, merging changes from version 6.1.106-3.
- For initramfs-tools:
- I opened and later merged the MRs:
- I reviewed the MRs:
- I uploaded:
- version 0.144 to Debian unstable.
- version 0.145 to Debian unstable.
- version 0.142+deb12u1 to Debian bookworm.
- I responded to Debian bug reports:
- For the Debian iproute package, I reverted the recent removal of the /usr/sbin/ip symlink and uploaded version 6.10.0-2.
- For kernel-wedge:
- I fixed a bug in duplicate detection that linux !1176 had revealed.
- I added support for packages installing modules under /usr/lib/modules, and a test case for this.
- I uploaded version 2.106 to Debian unstable, including the above and some other bug fixes.
- For the Debian sgt-puzzles package, I responded to and wrote a patch for bug #1079717: sgt-puzzles: [Mozaic] crashes when copying the game.
Oliver Davies' daily list: Beyond Blocks passes 1,000 downloads
Today, Beyond Blocks - the podcast I started last year and has 20 published episodes - passed 1,000 total downloads.
I've had some great guests on the show and discussed some interesting topics so far and I have others recorded and guests lined up for future episodes.
This week's episode will be with Eirik Morland again - the first returning guest - where we discuss the improvements and changes that have been made to Violinist.io since we spoke in January.
The first episode with Erik is here if you want to listen to it beforehand.
Thanks to all the guests and listeners of the podcast, and if you'd like to be a guest or suggest a topic, reply and let me know.
Freexian Collaborators: Debian Contributions: Python 3 patches, OpenSSH GSS-API split, rebootstrap, salsa CI, etc. (by Anupa Ann Joseph)
Contributing to Debian is part of Freexianâs mission. This article covers the latest achievements of Freexian and their collaborators. All of this is made possible by organizations subscribing to our Long Term Support contracts and consulting services.
Debian Python 3 patch review, by Stefano RiveraLast month, at DebConf, Stefano reviewed the current patch set of Debianâs cPython packages with Matthias Klose, the primary maintainer until now. As a result of that review, Stefano re-reviewed the patchset, updating descriptions, etc. A few patches were able to be dropped, and a few others were forwarded upstream.
One finds all sorts of skeletons doing reviews like this. One of the patches had been inactive (fortunately, because it was buggy) since the day it was applied, 13 years ago. One is a cleanup that probably only fixes a bug on HPUX, and is a result of copying code from xfree86 into Python 25 years ago. It was fixed in xfree86 a year later. Others support just Debian-specific functionality and probably never seemed worth forwarding. Or good cleanup that only really applies to Debian.
A trivial new patch would allow Debian to multiarch co-install Python stable ABI dynamic extensions (like we can with regular dynamic extensions). Performance concerns are stalling it in review, at the moment.
DebConf 24 Organization, by Stefano RiveraStefano helped organize DebConf 24, which concluded in early August. The event is run by a large entirely volunteer team. The work involved in making this happen is far too varied to describe here. While Freexian provides funding for 20% of collaborator time to spend on Debian-related work, it only covers a small fraction of contributions to time-intensive tasks like this.
Since the end of the event, Stefano has been doing some work on the conference finances, and initiated the reimbursement process for travel bursaries.
Archive rebuilds on Debusine, by Stefano RiveraThe recent setuptools 73 upload to Debian unstable removed the test subcommand, breaking many packages that were using python3 setup.py test in their Debian packaging. Stefano did a partial archive-rebuild using debusine.debian.net to find the regressions and file bugs.
Debusine will be a powerful tool to do QA work like this for Debian in the future, but it doesnât have all the features needed to coordinate rebuild-testing, yet. They are planned to be fleshed out in the next year. In the meantime, Debusine has the building blocks to work through a queue of package building tasks and store the results, it just needs to be driven from outside the system.
So, Stefano started working on a set of tools using the Debusine client API to perform archive rebuilds, found and tagged existing bugs, and filed many more.
OpenSSH GSS-API split, by Colin WatsonColin landed the first stage of the planned split of GSS-API authentication and key exchange support in Debianâs OpenSSH packaging. In order to allow for smooth upgrades, the second stage will have to wait until after the Debian 13 (trixie) release; but once thatâs done, as upstream puts it, âthis substantially reduces the amount of pre-authentication attack surface exposed on your usersâ sshd by defaultâ.
OpenSSL vs. cryptography, by Colin WatsonColin facilitated a discussion between Debianâs OpenSSL team and the upstream maintainers of Python cryptography about a new incompatibility between Debianâs OpenSSL packaging and cryptographyâs handling of OpenSSLâs legacy provider, which was causing a number of build and test failures. While the issue remains open, the Debian OpenSSL maintainers have effectively reverted the change now, so itâs no longer a pressing problem.
/usr-move, by Helmut GrohneThere are less than 40 source packages left to move files to /usr, so what weâre left with is the long tail of the transition. Rather than fix all of them, Helmut started a discussion on removing packages from unstable and filed a first batch. As libvirt is being restructured in experimental, weâre handling the fallout in collaboration with its maintainer Andrea Bolognani. Since base-files validates the aliasing symlinks before upgrading, it was discovered that systemd has its own ideas with no solution as of yet. Helmut also proposed that dash checks for ineffective diversions of /bin/sh and that lintian warns about aliased files.
rebootstrap by Helmut GrohneBootstrapping Debian for a new or existing CPU architecture still is a quite manual process. The rebootstrap project attempts to automate part of the early stage, but it still is very sensitive to changes in unstable. We had a number of fairly intrusive changes this year already. August included a little more fallout from the earlier gcc-for-host work where the C++ include search path would end up being wrong in the generated cross toolchain. A number of packages such as util-linux (twice), libxml2, libcap-ng or systemd had their stage profiles broken. e2fsprogs gained a cycle with libarchive-dev due to having gained support for creating an ext4 filesystem from a tar archive. The restructuring of glib2.0 remains an unsolved problem for now, but libxt and cdebconf should be buildable without glib2.0.
Salsa CI, by Santiago Ruano RincĂłnSantiago completed the initial RISC-V support (!523) in the Salsa CIâs pipeline. The main work started in July, but it was required to take into account some comments in the review (thanks to Ahmed!) and some final details in [!534]. riscv64 is the most recently supported port in Debian, which will be part of trixie. As its name suggests, the new build-riscv64 job makes it possible to test that a package successfully builds in the riscv64 architecture. The RISC-V runner (salsaci riscv64 runner 01) runs in a couple of machines generously provided by lab.rvperf.org. Debian Developers interested in running this job in their projects should enable the runner (salsaci riscv64 runner 01) in Settings / CI / Runners, and follow the instructions available at https://salsa.debian.org/salsa-ci-team/pipeline/#build-job-on-risc-v.
Santiago also took part in discussions about how to optimize the build jobs and reviewed !537 to make the build-source job to only satisfy the Build-Depends and Build-Conflicts fields by Andrea Pappacoda. Thanks a lot to him!
Miscellaneous contributions- Stefano submitted patches for BeautifulSoup to support the latest soupsieve and lxml.
- Stefano uploaded pypy3 7.3.17, upgrading the cPython compatibility from 3.9 to 3.10. Then ran into a GCC-14-related regression, which had to be ignored for now as itâs proving hard to fix.
- Colin released libpipeline 1.5.8 and man-db 2.13.0; the latter included foundations allowing adding an autopkgtest for man-db.
- Colin upgraded 19 Python packages to new upstream versions (fixing 5 CVEs), fixed several other build failures, fixed a Python 3.12 compatibility issue in zope.security, and made python-nacl build reproducibly.
- Colin tracked down test failures in python-asyncssh and Ruby resulting from certain odd /etc/hosts configurations.
- Carles upgraded the packages python-ring-doorbell and simplemonitor to new upstream versions.
- Carles started discussions and implementation of a tool (still in early days) named âpo-debconf-managerâ: a way for translators and reviewers to collaborate using git as a backend instead of mailing list; and submit the translations using salsa MR. More information next month.
- Carles (dog-fooding âpo-debconf-managerâ) reviewed debconf templates translated by a collaborator.
- Carles reviewed and submitted the translation of âaptâ.
- Helmut sent 19 patches for improving cross building.
- Helmut implemented the cross-exe-wrapper proposed by Simon McVittie for use with glib2.0.
- Helmut detailed what it takes to make Perlâs ExtUtils::PkgConfig suitable for cross building.
- Helmut made the deletion of the root password work in debvm in all situations and implemented a test case using expect.
- Anupa attended Debian Publicity team meeting and is moderating and posting on Debian Administrators LinkedIn group.
- Thorsten uploaded package gutenprint to fix a FTBFS with gcc14 and package ipp-usb to fix a /usr-merge issue.
- Santiago updated bzip2 to fix a long-standing bug that requested to include a pkg-config file. An important impact of this change is that it makes it possible to use Rust bindings for libbz2 by Sequoia, an implementation of OpenPGP.
KDE Plasma 6.1.5, Bugfix Release for September
Tuesday, 10 September 2024. Today KDE releases a bugfix update to KDE Plasma 6, versioned 6.1.5.
Plasma 6.1 was released in June 2024 with many feature refinements and new modules to complete the desktop experience.
This release adds a month's worth of new translations and fixes from KDE's contributors. The bugfixes are typically small but important and include:
- Screenedge: allow activating clients in drag and drop. Commit. Fixes bug #450579
- Applets/kickoff: Fix keyboard navigation getting stuck inside gridviews. Commit. Fixes bug #489867
- Klipper: fix copying cells when images are ignored. Commit. Fixes bug #491488