FLOSS Project Planets

The Drop Times: Crafting the Future of Web Development: A Conversation with Adrian Ababei

Planet Drupal - Fri, 2024-04-05 16:09
Discover the journey of Adrian Ababei, Senior Drupal Architect and CEO of OPTASY, as he shares insights into web development and Drupal architecture, alongside an overview of OPTASY's mission and services.
Categories: FLOSS Project Planets

Bits from Debian: apt install dpl-candidate: Sruthi Chandran

Planet Debian - Fri, 2024-04-05 14:36

The Debian Project Developers will shortly vote for a new Debian Project Leader known as the DPL.

The DPL is the official representative of representative of The Debian Project tasked with managing the overall project, its vision, direction, and finances.

The DPL is also responsible for the selection of Delegates, defining areas of responsibility within the project, the coordination of Developers, and making decisions required for the project.

Our outgoing and present DPL Jonathan Carter served 4 terms, from 2020 through 2024. Jonathan shared his last Bits from the DPL post to Debian recently and his hopes for the future of Debian.

Recently, we sat with the two present candidates for the DPL position asking questions to find out who they really are in a series of interviews about their platforms, visions for Debian, lives, and even their favorite text editors. The interviews were conducted by disaster2life (Yashraj Moghe) and made available from video and audio transcriptions:

  • Andreas Tille [Interview]
  • Sruthi Chandran [this document]

Voting for the position starts on April 6, 2024.

Editors' note: This is our official return to Debian interviews, readers should stay tuned for more upcoming interviews with Developers and other important figures in Debian as part of our "Meet your Debian Developer" series. We used the following tools and services: Turboscribe.ai for the transcription from the audio and video files, IRC: Oftc.net for communication, Jitsi meet for interviews, and Open Broadcaster Software (OBS) for editing and video. While we encountered many technical difficulties in the return to this process, we are still able and proud to present the transcripts of the interviews edited only in a few areas for readability.

2024 Debian Project Leader Candidate: Sruthi Chandran

Sruthi's interview

Hi Sruthi, so for the first question, who are you and could you tell us a little bit about yourself?

[Sruthi]:

I usually talk about me whenever I am talking about answering the question who am I, I usually say like I am a librarian turned free software enthusiast and a bin developer. So I had no technical background and I learned, I was introduced to free software through my husband and then I learned Debian packaging, and eventually I became a Debian developer. So I always give my example to people who say I am not technically inclined, I don't have technical background so I can't contribute to free software.

So yeah, that's what I refer to myself.

For the next question, could you tell me what do you do in Debian, and could you mention your story up until here today?

[Sruthi]:

Okay, so let me start from my initial days in Debian. I started contributing to Debian, my first contribution was a Tibetan font. We went to a Tibetan place and they were saying they didn't have a font in Linux.

So that's how I started contributing. Then I moved on to Ruby packages, then I have some JavaScript and Go packages, all dependencies of GitLab. So I was involved with maintaining GitLab for some time, now I'm not very active there.

But yeah, so GitLab was the main package I was contributing to since I contributed since 2016 to maybe like 2020 or something. Later I have come [over to] packaging. Now I am part of some of the teams, delegated teams, like community team and outreach team, as well as the Debconf committee. And the biggest, I think, my activity in Debian, I would say is organizing Debconf 2023. So it was a great experience and yeah, so that's my story in Debian.

So what are three key terms about you and your candidacy?

[Sruthi]:

Okay, let me first think about it. For candidacy, I can start with diversity is one point I started expressing from the first time I contested for DPL. But to be honest, that's the main point I want to bring.

[Yashraj]:

So for diversity, if you could break down your thoughts on diversity and make them, [about] your three points including diversity.

[Sruthi]:

So in addition to, eventually when starting it was just diversity. Now I have like a bit more ideas, like community, like I want to be a leader for the Debian community. More than, I don't know, maybe people may not agree, but I would say I want to be a leader of Debian community rather than a Debian operating system.

I connect to community more and third point I would say.

The term of a DPL lasts for an year. So what do you think during, what would you try to do during that, that you can't do from your position now?

[Sruthi]:

Okay. So I, like, I am very happy with the structure of Debian and how things work in Debian. Like you can do almost a lot of things, like almost all things without being a DPL.

Whatever change you want to bring about or whatever you want to do, you can do without being a DPL. Anyone, like every DD has the same rights. Only things I feel [the] DPL has hold on are mainly the budget or the funding part, which like, that's where they do the decision making part.

And then comes like, and one advantage of DPL driving some idea is that somehow people tend to listen to that with more, like, tend to give more attention to what DPL is saying rather than a normal DD. So I wanted to, like, I have answered some of the questions on how to, how I plan to do the financial budgeting part, how I want to handle, like, and the other thing is using the extra attention that I get as a DPL, I would like to obviously start with the diversity aspect in Debian. And yeah, like, I, what I want to do is not, like, be a leader and say, like, take Debian to one direction where I want to go, but I would rather take suggestions and inputs from the whole community and go about with that.

So yes, that's what I would say.

And taking a less serious question now, what is your preferred text editor?

[Sruthi]:

Vim.

[Yashraj]:

Vim, wholeheartedly team Vim?

[Sruthi]:

Yes.

[Yashraj]:

Great. Well, this was made in Vim, all the text for this.

[Sruthi]:

So, like, since you mentioned extra data, I'll give my example, like, it's just a fun note, when I started contributing to Debian, as I mentioned, I didn't have any knowledge about free software, like Debian, and I was not used to even using Linux. So, and I didn't have experience with these text editors. So, when I started contributing, I used to do the editing part using gedit.

So, that's how I started. Eventually, I moved to Nano, and once I reached Vim, I didn't move on.

Team Vim. Next question. What, what do you think is the importance of the Debian project in the world today? And where would you like to see it in 10 years, like 10 years into the future?

[Sruthi]:

Okay. So, Debian, as we all know, is referred to as the universal operating system without, like, it is said for a reason. We have hundreds and hundreds of operating systems, like Linux, distributions based on Debian.

So, I believe Debian, like even now, Debian has good influence on the, at least on the Linux or Linux ecosystem. So, what we implement in Debian has, like, is going to affect quite a lot of, like, a very good percentage of people using Linux. So, yes.

So, I think Debian is one of the leading Linux distributions. And I think in 10 years, we should be able to reach a position, like, where we are not, like, even now, like, even these many years after having Linux, we face a lot of problems in newer and newer hardware coming up and installing on them is a big problem. Like, firmwares and all those things are getting more and more complicated.

Like, it should be getting simpler, but it's getting more and more complicated. So, I, one thing I would imagine, like, I don't know if we will ever reach there, but I would imagine that eventually with the Debian, we should be able to have some, at least a few of the hardware developers or hardware producers have Debian pre-installed and those kind of things. Like, not, like, become, I'm not saying it's all, it's also available right now.

What I'm saying is that it becomes prominent enough to be opted as, like, default distro.

What part of Debian has made you And what part of the project has kept you going all through these years?

[Sruthi]:

Okay. So, I started to contribute in 2016, and I was part of the team doing GitLab packaging, and we did have a lot of training workshops and those kind of things within India. And I was, like, I had interacted with some of the Indian DDs, but I never got, like, even through chat or mail.

I didn't have a lot of interaction with the rest of the world, DDs. And the 2019 Debconf changed my whole perspective about Debian. Before that, I wasn't, like, even, I was interested in free software.

I was doing the technical stuff and all. But after DebConf, my whole idea has been, like, my focus changed to the community. Debian community is a very welcoming, very interesting community to be with.

And so, I believe that, like, 2019 DebConf was a for me. And that kept, from 2019, my focus has been to how to support, like, how, I moved to the community part of Debian from there. Then in 2020 I became part of the community team, and, like, I started being part of other teams.

So, these, I would say, the Debian community is the one, like, aspect of Debian that keeps me whole, keeps me held on to the Debian ecosystem as a whole.

Continuing to speak about Debian, what do you think, what is the first thing that comes to your mind when you think of Debian, like, the word, the community, what's the first thing?

[Sruthi]:

I think I may sound like a broken record or something.

[Yashraj]:

No, no.

[Sruthi]:

Again, I would say the Debian community, like, it's the people who makes Debian, that makes Debian special.

Like, apart from that, if I say, I would say I'm very, like, one part of Debian that makes me very happy is the, how the governing system of Debian works, the Debian constitution and all those things, like, it's a very unique thing for Debian. And, and it's like, when people say you can't work without a proper, like, establishment or even somebody deciding everything for you, it's difficult. When people say, like, we have been, Debian has been proving it for quite a long time now, that it's possible.

So, so that's one thing I believe, like, that's one unique point. And I am very proud about that.

What areas do you think Debian is failing in, how can it (that standing) be improved?

[Sruthi]:

So, I think where Debian is failing now is getting new people into Debian. Like, I don't remember, like, exactly the answer. But I remember hearing someone mention, like, the average age of a Debian developer is, like, above 40 or 45 or something, like, exact age, I don't remember.

But it's like, Debian is getting old. Like, the people in Debian are getting old and we are not getting enough of new people into Debian. And that's very important to have people, like, new people coming up.

Otherwise, eventually, like, after a few years, nobody, like, we won't have enough people to take the project forward. So, yeah, I believe that is where we need to work on. We are doing some efforts, like, being part of GSOC or outreachy and having maybe other events, like, local events. Like, we used to have a lot of Debian packaging workshops in India. And those kind of, I think, in Brazil and all, they all have, like, local communities are doing. But we are not very successful in retaining the people who maybe come and try out things.

But we are not very good at retaining the people, like, retaining people who come. So, we need to work on those things. Right now, I don't have a solid answer for that.

But one thing, like, I was thinking about is, like, having a Debian specific outreach project, wherein the focus will be about the Debian, like, starting will be more on, like, usually what happens in GSOC and outreach is that people come, have the, do the contributions, and they go back. Like, they don't have that connection with the Debian, like, Debian community or Debian project. So, what I envision with these, the Debian outreach, the Debian specific outreach is that we have some part of the internship, like, even before starting the internship, we have some sessions and, like, with the people in Debian having, like, getting them introduced to the Debian philosophy and Debian community and Debian, how Debian works.

And those things, we focus on that. And then we move on to the technical internship parts. So, I believe this could do some good in having, like, when you have people you can connect to, you tend to stay back in a project mode.

When you feel something more than, like, right now, we have so many technical stuff to do, like, the choice for a college student is endless. So, if they want, if they stay back for something, like, maybe for Debian, I would say, we need to have them connected to the Debian project before we go into technical parts. Like, technical parts, like, there are other things as well, where they can go and do the technical part, but, like, they can come here, like, yeah.

So, that's what I was saying. Focused outreach projects is one thing. That's just one.

That's not enough. We need more of, like, more ideas to have more new people come up. And I'm very happy with, like, the DebConf thing. We tend to get more and more people from the places where we have a DebConf. Brazil is an example. After the Debconf, they have quite a good improvement on Debian contributors.

And I think in India also, it did give a good result. Like, we have more people contributing and staying back and those things. So, yeah.

So, these were the things I would say, like, we can do to improve.

For the final question, what field in free software do you, what field in free software generally do you think requires the most work to be put into it? What do you think is Debian's part in that field?

[Sruthi]:

Okay. Like, right now, what comes to my mind is the free software licenses parts. Like, we have a lot of free software licenses, and there are non-free software licenses.

But currently, I feel free software is having a big problem in enforcing these licenses. Like, there are, there may be big corporations or like some people who take up the whole, the code and may not follow the whole, for example, the GPL licenses. Like, we don't know how much of those, how much of the free softwares are used in the bigger things.

Yeah, I agree. There are a lot of corporations who are afraid to touch free software. But there would be good amount of free software, free work that converts into property, things violating the free software licenses and those things.

And we do not have the kind of like, we have SFLC, SFC, etc. But still, we do not have the ability to go behind and trace and implement the licenses. So, enforce those licenses and bring people who are violating the licenses forward and those kind of things is challenging because one thing is it takes time, like, and most importantly, money is required for the legal stuff.

And not always people who like people who make small software, or maybe big, but they may not have the kind of time and money to have these things enforced. So, that's a big challenge free software is facing, especially in our current scenario. I feel we are having those, like, we need to find ways how we can get it sorted.

I don't have an answer right now what to do. But this is a challenge I felt like and Debian's part in that. Yeah, as I said, I don't have a solution for that.

But the Debian, so DFSG and Debian sticking on to the free software licenses is a good support, I think.

So, that was the final question, Do you have anything else you want to mention for anyone watching this?

[Sruthi]:

Not really, like, I am happy, like, I think I was able to answer the questions. And yeah, I would say who is watching. I won't say like, I'm the best DPL candidate, you can't have a better one or something.

I stand for a reason. And if you believe in that, or the Debian community and Debian diversity, and those kinds of things, if you believe it, I hope you would be interested, like, you would want to vote for me. That's it.

Like, I'm not, I'll make it very clear. I'm not doing a technical leadership part here. So, those, I can't convince people who want technical leadership to vote for me.

But I would say people who connect with me, I hope they vote for me.

Categories: FLOSS Project Planets

Bits from Debian: apt install dpl-candidate: Andreas Tille

Planet Debian - Fri, 2024-04-05 14:36

The Debian Project Developers will shortly vote for a new Debian Project Leader known as the DPL.

The Project Leader is the official representative of The Debian Project tasked with managing the overall project, its vision, direction, and finances.

The DPL is also responsible for the selection of Delegates, defining areas of responsibility within the project, the coordination of Developers, and making decisions required for the project.

Our outgoing and present DPL Jonathan Carter served 4 terms, from 2020 through 2024. Jonathan shared his last Bits from the DPL post to Debian recently and his hopes for the future of Debian.

Recently, we sat with the two present candidates for the DPL position asking questions to find out who they really are in a series of interviews about their platforms, visions for Debian, lives, and even their favorite text editors. The interviews were conducted by disaster2life (Yashraj Moghe) and made available from video and audio transcriptions:

  • Andreas Tille [this document]
  • Sruthi Chandran [Interview]

Voting for the position starts on April 6, 2024.

Editors' note: This is our official return to Debian interviews, readers should stay tuned for more upcoming interviews with Developers and other important figures in Debian as part of our "Meet your Debian Developer" series. We used the following tools and services: Turboscribe.ai for the transcription from the audio and video files, IRC: Oftc.net for communication, Jitsi meet for interviews, and Open Broadcaster Software (OBS) for editing and video. While we encountered many technical difficulties in the return to this process, we are still able and proud to present the transcripts of the interviews edited only in a few areas for readability.

2024 Debian Project Leader Candidate: Andrea Tille

Andreas' Interview

Who are you? Tell us a little about yourself.

[Andreas]:

How am I? Well, I'm, as I wrote in my platform, I'm a proud grandfather doing a lot of free software stuff, doing a lot of sports, have some goals in mind which I like to do and hopefully for the best of Debian.

And How are you today?

[Andreas]:

How I'm doing today? Well, actually I have some headaches but it's fine for the interview.

So, usually I feel very good. Spring was coming here and today it's raining and I plan to do a bicycle tour tomorrow and hope that I do not get really sick but yeah, for the interview it's fine.

What do you do in Debian? Could you mention your story here?

[Andreas]:

Yeah, well, I started with Debian kind of an accident because I wanted to have some package salvaged which is called WordNet. It's a monolingual dictionary and I did not really plan to do more than maybe 10 packages or so. I had some kind of training with xTeddy which is totally unimportant, a cute teddy you can put on your desktop.

So, and then well, more or less I thought how can I make Debian attractive for my employer which is a medical institute and so on. It could make sense to package bioinformatics and medicine software and it somehow evolved in a direction I did neither expect it nor wanted to do, that I'm currently the most busy uploader in Debian, created several teams around it.

DebianMate is very well known from me. I created the Blends team to create teams and techniques around what we are doing which was Debian TIS, Debian Edu, Debian Science and so on and I also created the packaging team for R, for the statistics package R which is technically based and not topic based. All these blends are covering a certain topic and R is just needed by lots of these blends.

So, yeah, and to cope with all this I have written a script which is routing an update to manage all these uploads more or less automatically. So, I think I had one day where I uploaded 21 new packages but it's just automatically generated, right? So, it's on one day more than I ever planned to do.

What is the first thing you think of when you think of Debian?

Editors' note: The question was misunderstood as the “worst thing you think of when you think of Debian”

[Andreas]:

The worst thing I think about Debian, it's complicated. I think today on Debian board I was asked about the technical progress I want to make and in my opinion we need to standardize things inside Debian. For instance, bringing all the packages to salsa, follow some common standards, some common workflow which is extremely helpful.

As I said, if I'm that productive with my own packages we can adopt this in general, at least in most cases I think. I made a lot of good experience by the support of well-formed teams. Well-formed teams are those teams where people support each other, help each other.

For instance, how to say, I'm a physicist by profession so I'm not an IT expert. I can tell apart what works and what not but I'm not an expert in those packages. I do and the amount of packages is so high that I do not even understand all the techniques they are covering like Go, Rust and something like this.

And I also don't speak Java and I had a problem once in the middle of the night and I've sent the email to the list and was a Java problem and I woke up in the morning and it was solved. This is what I call a team. I don't call a team some common repository that is used by random people for different packages also but it's working together, don't hesitate to solve other people's problems and permit people to get active.

This is what I call a team and this is also something I observed in, it's hard to give a percentage, in a lot of other teams but we have other people who do not even understand the concept of the team. Why is working together make some advantage and this is also a tough thing. I [would] like to tackle in my term if I get elected to form solid teams using the common workflow. This is one thing.

The other thing is that we have a lot of good people in our infrastructure like FTP masters, DSA and so on. I have the feeling they have a lot of work and are working more or less on their limits, and I like to talk to them [to ask] what kind of change we could do to move that limits or move their personal health to the better side.

The DPL term lasts for a year, What would you do during that you couldn't do now?

[Andreas]:

Yeah, well this is basically what I said are my main issues. I need to admit I have no really clear imagination what kind of tasks will come to me as a DPL because all these financial issues and law issues possible and issues [that] people who are not really friendly to Debian might create. I'm afraid these things might occupy a lot of time and I can't say much about this because I simply don't know.

What are three key terms about you and your candidacy?

[Andreas]:

As I said, I like to work on standards, I’d like to make Debian try [to get it right so] that people don't get overworked, this third key point is be inviting to newcomers, to everybody who wants to come. Yeah, I also mentioned in my term this diversity issue, geographical and from gender point of view. This may be the three points I consider most important.

Preferred text editor?

[Andreas]:

Yeah, my preferred one? Ah, well, I have no preferred text editor. I'm using the Midnight Commander very frequently which has an internal editor which is convenient for small text. For other things, I usually use VI but I also use Emacs from time to time. So, no, I have not preferred text editor. Whatever works nicely for me.

What is the importance of the community in the Debian Project? How would like to see it evolving over the next few years?

[Andreas]:

Yeah, I think the community is extremely important. So, I was on a lot of DebConfs. I think it's not really 20 but 17 or 18 DebCons and I really enjoyed these events every year because I met so many friends and met so many interesting people that it's really enriching my life and those who I never met in person but have read interesting things and yeah, Debian community makes really a part of my life.

And how do you think it should evolve specifically?

[Andreas]:

Yeah, for instance, last year in Kochi, it became even clearer to me that the geographical diversity is a really strong point. Just discussing with some women from India who is afraid about not coming next year to Busan because there's a problem with Shanghai and so on. I'm not really sure how we can solve this but I think this is a problem at least I wish to tackle and yeah, this is an interesting point, the geographical diversity and I'm running the so-called mentoring of the month.

This is a small project to attract newcomers for the Debian Med team which has the focus on medical packages and I learned that we had always men applying for this and so I said, okay, I dropped the constraint of medical packages.

Any topic is fine, I teach you packaging but it must be someone who does not consider himself a man. I got only two applicants, no, actually, I got one applicant and one response which was kind of strange if I'm hunting for women or so.

I did not understand but I got one response and interestingly, it was for me one of the least expected counters. It was from Iran and I met a very nice woman, very open, very skilled and gifted and did a good job or have even lose contact today and maybe we need more actively approach groups that are underrepresented. I don't know if what's a good means which I did but at least I tried and so I try to think about these kind of things.

What part of Debian has made you smile? What part of the project has kept you going all through the years?

[Andreas]:

Well, the card game which is called Mao on the DebConf made me smile all the time. I admit I joined only two or three times even if I really love this kind of games but I was occupied by other stuff so this made me really smile. I also think the first online DebConf in 2020 made me smile because we had this kind of short video sequences and I tried to make a funny video sequence about every DebConf I attended before. This is really funny moments but yeah, it's not only smile but yeah.

One thing maybe it's totally unconnected to Debian but I learned personally something in Debian that we have a do-ocracy and you can do things which you think that are right if not going in between someone else, right? So respect everybody else but otherwise you can do so.

And in 2020 I also started to take trees which are growing widely in my garden and plant them into the woods because in our woods a lot of trees are dying and so I just do something because I can. I have the resource to do something, take the small tree and bring it into the woods because it does not harm anybody. I asked the forester if it is okay, yes, yes, okay. So everybody can do so but I think the idea to do something like this came also because of the free software idea. You have the resources, you have the computer, you can do something and you do something productive, right? And when thinking about this I think it was also my Debian work.

Meanwhile I have planted more than 3,000 trees so it's not a small number but yeah, I enjoy this.

What part of Debian would you have some criticisms for?

[Andreas]:

Yeah, it's basically the same as I said before. We need more standards to work together. I do not want to repeat this but this is what I think, yeah.

What field in Free Software generally do you think requires the most work to be put into it? What do you think is Debian's part in the field?

[Andreas]:

It's also in general, the thing is the fact that I'm maintaining packages which are usually as modern software is maintained in Git, which is fine but we have some software which is at Sourceport, we have software laying around somewhere, we have software where Debian somehow became Upstream because nobody is caring anymore and free software is very different in several things, ways and well, I in principle like freedom of choice which is the basic of all our work.

Sometimes this freedom goes in the way of productivity because everybody is free to re-implement. You asked me for the most favorite editor. In principle one really good working editor would be great to have and would work and we have maybe 500 in Debian or so, I don't know.

I could imagine if people would concentrate and say five instead of 500 editors, we could get more productive, right? But I know this will not happen, right? But I think this is one thing which goes in the way of making things smooth and productive and we could have more manpower to replace one person who's [having] children, doing some other stuff and can't continue working on something and maybe this is a problem I will not solve, definitely not, but which I see.

What do you think is Debian's part in the field?

[Andreas]:

Yeah, well, okay, we can bring together different Upstreams, so we are building some packages and have some general overview about similar things and can say, oh, you are doing this and some other person is doing more or less the same, do you want to join each other or so, but this is kind of a channel we have to our Upstreams which is probably not very successful.

It starts with code copies of some libraries which are changed a little bit, which is fine license-wise, but not so helpful for different things and so I've tried to convince those Upstreams to forward their patches to the original one, but for this and I think we could do some kind of, yeah, [find] someone who brings Upstream together or to make them stop their forking stuff, but it costs a lot of energy and we probably don't have this and it's also not realistic that we can really help with this problem.

Do you have any questions for me?

[Andreas]:

I enjoyed the interview, I enjoyed seeing you again after half a year or so. Yeah, actually I've seen you in the eating room or cheese and wine party or so, I do not remember we had to really talk together, but yeah, people around, yeah, for sure. Yeah.

Categories: FLOSS Project Planets

PyBites: Python F-String Codes I Use Every Day

Planet Python - Fri, 2024-04-05 12:15

A few examples that will save the day probably* 95% of time.

*I don’t have the actual data but seriously, I bet you’ll find those tips useful more often than not!

Introduction

This article was originally posted on Medium.

I use f-strings every day. The irony is I also every day end up searching the Web to find the correct format to use. Until one day I thought a better use of my time would be to create a cheat sheet of the most common formatting cases — AKA this article. It covers the following:

  • integers, floats, numbers and scientific notation
  • percentages %
  • dates
  • padding
  • adding +/- sign in front of a number

It’s important to note that the f-strings were first introduced in Python 3.6 (PEP 498 if you REALLY must know) so make sure to check the Python version first, if things don’t work for you.

The format

The most basic f-string format goes like this:

You can use this format to print numbers, texts, or even evaluate expressions.

author = "pawjast" year = 2022 print(f"Example 1: {author}") # string print(f"Example 2: {year}") # number print(f"Example 3: {2 + 2}") # expression

The output:

Example 1: pawjast Example 2: 2022 Example 3: 4

You might have noticed that the 2+2 expression in Example 3 got evaluated and 4 was printed.

You’ll get both, the name and the value if you add = sign to a variable.

text = "Data Science Blog" print(f"{text=}")

The output:

text='Data Science Blog'

Template below generalizes how you can add a specific format to a variable:

Next paragraphs shows examples of how to use it.

Recap on numbers

Last stop before going any further. I’ll be using different ways of writing numbers later in the article so let’s review the most common ones.

int_1 = 1 int_with_separator = 1_000 # `int` with 1,000 separator float_1 = 1.125 float_2 = 3.50 scientific_1 = 1.23e2 # 1.23 * 10^2 print(f"Example 1 - int: {int_1}") print(f"Example 2 - int with _ as thousands separator: {int_with_separator}") print(f"Example 3 - float: {float_1}") print(f"Example 4 - float with trailing zero: {float_2}") print(f"Example 5 - float in scientific notation: {scientific_1}")

The output:

Example 1 - int: 1 Example 2 - int with _ as thousands separator: 1000 Example 3 - float: 1.125 Example 4 - float with trailing zero: 3.5 Example 5 - float in scientific notation: 123.0

You can observe that:

  • floats had the trailing zeros truncated (Example 4)
  • scientific notation was printed as a regular float
  • the rest of the variables were printed “as is”
Floats

The float type is enforced by using code f. What you want to control in floats is the number of decimal places.

pi_val = 3.141592 print(f"Example 1: {pi_val:f}") print(f"Example 2: {pi_val:.0f}") print(f"Example 3: {pi_val:.1f}") print(f"Example 4: {pi_val:.3f}")

The output:

Example 1: 3.141592 Example 2: 3 Example 3: 3.1 Example 4: 3.142

Side note: f-strings are flexible enough to allow nesting.

float_val = 1.5 precision = 3 print(f"{float_val:.{precision}f}")

The output:

1.500 Percentage

Use code % to enforce percentage type. Percentage is still a float so you can still use .<whole_number> to control the precision.

val = 0.5 print(f"Example 1: {val:%}") print(f"Example 2: {val:.0%}")

The output:

Example 1: 50.000000% Example 2: 50%

More examples of controlling precision in %:

val = 1.255 print(f"Example 1: {val:.0%}") print(f"Example 2: {val:.1%}")

The output:

Example 1: 125% Example 2: 125.5% Scientific notation

If you want scientific notation to be printed as such (and not as a regular float) it can be enforced with e or E code.

val = 1.23e3 # 1.23 * 10^3 print(f"Example 1: {val:e}") print(f"Example 2: {val:E}")

The output:

1: 1.230000e+03 2: 1.230000E+03

No surprise the precision can be controlled in this case too.

val = 1.2345e3 print(f"{val:.2e}")

The output:

1.23e+03

You can even print a regular number in scientific notation.

val = 2022 print(f"{val:.3e}")

The output:

2.022e+03 Integers

Integers are enforced using code d.

val = 1 print(f"{val:d}")

The output:

1

Adding , to the code will print the thousands separator.

int_1 = 1000 int_2 = 1000_000_000 print(f"{int_1:,d}") print(f"{int_2:,d}")

The output:

1,000 1,000,000,000 Numbers

If the aim is to just print a number, you can use generic code — n.

val_int = 1 val_float = 1.234 val_scient = 4.567e2 print(f"{val_int =: n}") print(f"{val_float =: n}") print(f"{val_scient =: n}")

The output:

val_int = 1 val_float = 1.234 val_scient = 456.7

You can still use .<whole_number> format to control the precision.

Side note: in this case whole_number determines the total number of digits printed, not the number of decimal points! On top of that, n code will decide the best output format for a number.

val_float_1 = 1.234 val_float_2 = 20.234 val_float_3 = 123.456 print(f"{val_float_1 =: .2n}") # prints as truncated float print(f"{val_float_2 =: .2n}") # prints as int print(f"{val_float_3 =: .2n}") # prints as scientific notation

The output:

val_float_1 = 1.2 val_float_2 = 20 val_float_3 = 1.2e+02 Dates from datetime import date, datetime

Printing a date “as is” works exactly like printing any other variable.

day = date( year=2022, month=9, day=1 ) print(f"{day}")

The output:

2022-09-01

To recreate the format you will use the following codes:

  • %Y for year
  • %m for month
  • %d for day

With those codes you can e.g. create a new date format.

print(f"{day:%Y-%m-%d}") # default appearance print(f"{day:%Y/%m/%d}") # use `/` as separator

The output:

2022-09-01 2022/09/01

It’s also possible to print a month as a text:

  • %b — short version
  • %B — long version
print(f"{day:%Y %b %d}") print(f"{day:%Y %B %d}")

The output:

2022 Sep 01 2022 September 01

The same variable can be printed multiple times.

print(f"{day:%b or %B}?") print(f"{day:%Y %Y %Y}"

The output:

Sep or September? 2022 2022 2022

Reusing the same variable can be useful e.g. when you want to print the date and provide the day of the week as text (using code %A ).

print(f"{day:%Y %b %d (%A)}")

The outcome:

2022 Sep 01 (Thursday)

Last but not least, you can swap %Y for %y to get short version of the year.

print(f"{day:%y.%m.%d}")

The output:

22.09.01 Datetime

Let’s specify two datetime variables.

day_and_time = datetime( year=2022, month=9, day=1, hour=17, minute=30, second=45 ) now = datetime.now() print(f"{day_and_time}") print(f"{now}") # with mircoseconds

The output:

2022-09-01 17:30:45 2022-12-08 15:49:37.810347

Time format requires the following codes:

  • %H — hour
  • %M — minute
  • %S — second
  • %f — millisecond (1s = 1000 milliseconds)

Therefore, the default format would look like below.

print(f"{now:%Y-%m-%d %H:%M:%S.%f}")

The outcome:

2022-12-08 15:49:37.810347

f-string obviously creates a string (try this code to confirm it: type(f”now:%Y-%m-%d %H:%M%S.%f}”)). Therefore, if e.g. you are not happy with the number of decimal points for milliseconds, you can easily truncate them.

print(f"{now:%Y-%m-%d %H:%M:%S.%f}"[:22])

The output:

2022-12-08 15:49:37.81

In order to change the 24hr format to 12hr format, you will need to:

  • swap hour code from %H to %I
  • Optionally add %p at the end if you want to add AM/PM to the time
print(f"24hr: {day_and_time:%Y-%m-%d %H:%M:%S}") print(f"12hr: {day_and_time:%Y-%m-%d %I:%M:%S}") print(f"12hr with AM/PM: {day_and_time:%Y-%m-%d %I:%M:%S %p}")

The output:

24hr: 2022-09-01 17:30:45 12hr: 2022-09-01 05:30:45 12hr with AM/PM: 2022-09-01 05:30:45 PM

Few more useful date formats:

  • %j for day of the year
  • %W for week of the year (assuming Monday as first day of the week)
  • %U for week of the year (assuming Sunday as first day of the week
day = date( year=2018, month=9, day=17 ) print(f"The date: {day}") print(f"Day of the year: {day: %j}") print(f"Week of the year (Mon): {day: %W}") print(f"Week of the year (Sun): {day: %U}")

The outcome:

The date: 2018-09-17 Day of the year: 260 Week of the year (Mon): 38 Week of the year (Sun): 37 Padding

Padding with empty spaces.

val = 1 print(f"1: {val:1d}") print(f"2: {val:2d}") print(f"3: {val:3d}")

The output:

1: 1 2: 1 3: 1

Padding with zeros.

val = 1 print(f"1: {val:01d}") print(f"2: {val:02d}") print(f"3: {val:03d}")

The output:

1: 1 2: 01 3: 001

I usually use zero — padding with for loop to keep the text nicely aligned in the terminal.

for i in range(11): print(f"{i:02d}")

The output:

01 02 ... 09 10 Positive/negative sign

In some cases you will require to show a +/- sign next to a number.

positive = 1.23 negative = -1.23 print(f"1: {positive:+.2f} {negative:+.2f}") print(f"2: {positive:-.2f} {negative:-.2f}") print(f"3: {positive: .2f} {negative: .2f}")

The output:

1: +1.23 -1.23 2: 1.23 -1.23 3: 1.23 -1.23 Combining all things together # print variable with name, limit precision and thousands separator val = 11500.23456 print(f"{val = :,.3f}")

The output:

val = 11,500.235

We’re done .

Full code

 GitHub notebook

Connect with me

 Medium  Twitter / X  GitHub  Substack  LinkedIn

Resources

1⃣ https://docs.python.org/3/reference/lexical_analysis.html#f-strings

2⃣ https://docs.python.org/3/library/string.html#format-specification-mini-language

3⃣ https://strftime.org/

Categories: FLOSS Project Planets

Qt Creator 13 - CMake Update

Planet KDE - Fri, 2024-04-05 10:07

Here is a set of highlighted CMake features and fixes in Qt Creator 13. Have a look at the ChangeLog for all the CMake changes.

Categories: FLOSS Project Planets

Emanuele Rocca: PGP keys on Yubikey, with a side of Mutt

Planet Debian - Fri, 2024-04-05 09:22

Here are my notes about copying PGP keys to external hardware devices such as Yubikeys. Let me begin by saying that the gpg tools are pretty bad at this.

MAKE A COUPLE OF BACKUPS OF ~/.gnupg/ TO DIFFERENT ENCRYPTED USB STICKS BEFORE YOU START. GPG WILL MESS UP YOUR KEYS. SERIOUSLY.

For example, would you believe me if I said that saving changes results in the removal of your private key? Well check this out.

Now that you have multiple safe, offline backups of your keys, here are my notes.

apt install yubikey-manager scdaemon

Plug the Yubikey in, see if it’s recognized properly:

ykman list gpg --card-status

Change the default PIN (123456) and Admin PIN (12345678):

gpg --card-edit gpg/card> admin gpg/card> passwd

Look at the openpgp information and change the maximum number of retries, if you like. I have seen this failing a couple of times, unplugging the Yubikey and putting it back in worked.

ykman openpgp info ykman openpgp access set-retries 7 7 7

Copy your keys. MAKE A BACKUP OF ~/.gnupg/ BEFORE YOU DO THIS.

gpg --edit-key $KEY_ID gpg> keytocard # follow the prompts to copy the first key

Now choose the next key and copy that one too. Repeat till all subkeys are copied.

gpg> key 1 gpg> keytocard

Typing gpg --card-status you should be able to see all your keys on the Yubikey now.

Using the key on another machine

How do you use your PGP keys on the Yubikey on other systems?

Go to another system, if it does have a ~/.gnupg directory already move it somewhere else.

apt install scdaemon

Import your public key:

gpg -k gpg --keyserver pgp.mit.edu --recv-keys $KEY_ID

Check the fingerprint and if it is indeed your key say you trust it:

gpg --edit-key $KEY_ID > trust > 5 > y > save

Now try gpg --card-status and gpg --list-secret-keys, you should be able to see your keys. Try signing something, it should work.

gpg --output /tmp/x.out --sign /etc/motd gpg --verify /tmp/x.out Using the Yubikey with Mutt

If you’re using mutt with IMAP, there is a very simple trick to safely store your password on disk. Create an encrypted file with your IMAP password:

echo SUPERSECRET | gpg --encrypt > ~/.mutt_password.gpg

Add the following to ~/.muttrc:

set imap_pass=`gpg --decrypt ~/.mutt_password.gpg`

With the above, mutt now prompts you to insert the Yubikey and type your PIN in order to connect to the IMAP server.

Categories: FLOSS Project Planets

Real Python: The Real Python Podcast – Episode #199: Leveraging Documents and Data to Create a Custom LLM Chatbot

Planet Python - Fri, 2024-04-05 08:00

How do you customize a LLM chatbot to address a collection of documents and data? What tools and techniques can you use to build embeddings into a vector database? This week on the show, Calvin Hendryx-Parker is back to discuss developing an AI-powered, Large Language Model-driven chat interface.

[ 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

KDE: “Run a command” on notification trigger

Planet KDE - Fri, 2024-04-05 07:22

KDE had a feature a lot of people didn’t know about. You could run a command when a notification triggered. The feature wasn’t very well documented and nobody really blogged about it.

However with the release of KDE Plasma 6, the feature was removed. I learned about it by accident, as it is tracked by Bug #481069. I really need the feature and I re-implemented it in KDE Plasma 6. I will be available in KDE Plasma 6.1 and KDE Frameworks 6.1.

KDE: Run a command Text-to-Speech for calendar events

I’m using the “Run a command” feature for calendar events. Normally you get a popup notification. The popup notification is small and pop up where all of them are shown. When I’m concentrated and working on some code I simply miss them. If I play a game, I miss them.

The solution for me is to use a Text to Speech (TTS) Engine. I’ve setup speech-dispatcher with piper-tts on my system. When an a reminder triggers it says: “Andreas, you have an appointment in 10 minutes: Samba Meeting”.

You can find the python script I use here.

Endless possibilities

The opportunities endless. Here are some ideas what else you could do:

  • Start your meeting/conferencing application prior to the meeting
  • Change the desktop activity before a meeting
  • Lock the screen if a specific WiFi gets disconnected

If you have some nice idea or already used it in the past, leave a comment to let me know what else you can do.

Categories: FLOSS Project Planets

KStars 3.7.0 is Released

Planet KDE - Fri, 2024-04-05 07:03
KStars v3.7.0 is released on 2024.04.05 for Windows, MacOS & Linux. It's a bi-monthly bug-fix release with a couple of exciting features.
CI & CD Infrastructure
We say goodbye to KDE's binary factory as we transition to fully use Gitlab's CI/CD pipelines to build, test, and publish KStars. Over the last two months, Eric Dejouhanet worked with the KDE's Craft & System admin teams to transition KStars pipelines to the new framework. 


Short status on pipelines:
  • Merge requests run the custom build and the CI builds
  • Master runs the CI build (though there could be other things we run, such as CVE scans)
  • Craft recipes are run from the last commit of the master or release branch, they require "build" and "build-and-test-stable" to be run manually beforehand.
  • Publishing to Microsoft store is available after the Windows Craft is run.
This is still an ongoing process and we hope to have this process fully automated by 3.7.1 release where we will automatically publish latest releases for both stable and master branches.
Donut Buster
Rejoice Newtonian, SCT, and RC owners! With KStars new Donut Buster feature, your donut focusing woes might be something of the past. John Evans implemented this experimental feature to help protect against outliers that might affect your autofocus routine. In addition to that, the Focus Advisor is now automatically applied when creating new profiles. Based on the type of equipment you have in your optical train, the Focus Advisor would try to guess the optimal focus settings for your setup. Both features are experimental and would benefit from your feedback.
Custom Views
Akarsh Simha introduced the ability to orient the sky map to match the view through any instrument.

A view is a collection of settings: the orientation of the sky map, how the orientation changes as the sky map is panned, whether it is mirrored or not, and optionally the field-of-view to set the map to.
If no views are defined, KStars introduces a set of standard / "demo" views by default. Existing views can be edited and new views can be added using the "Edit Views..." interface. They can also be re-ordered in the interface. The ordering of the views in the "Edit Views..." dialog defines the order in which views will be cycled through using the keyboard shortcuts Shift + Page Up and Shift + Page Down. Thus, you can set up the views for easily switching between naked eye / finder scope / telescope views for easy star-hopping.

Furthermore, there is a new option in the View menu that enables mirroring the sky map so as to be able to match the view through an erecting prism used for example on a Schmidt-Cassegrain or Refracting type telescope.

The rotation feature overlay now also marks East in addition to north and zenith, so as to know easily whether the display is mirrored or not.

Blinking
Hy Murveit
added a very useful Blinking feature to the FITS Viewer tool. This adds several ways to blink; that is, compare multiple images.

In Analyze, one can now move from one session to the next (forward or backward).
Keyboard shortcuts are provided for that.
Another set of keyboard shortcuts both advance and show the next image in the same FITS Viewer.
Thus, for example, one can advance through all the captured images of the evening, showing all the captures on the FITS Viewer by repeating a keyboard shortcut.
A useful complement to this might be adding the ability to delete bad captures, but for now that will have to wait for a rainy day.

In the FITS Viewer, the Open File menu command (both in the main KStars top menu, and in the FITS Viewer menu) now allows multiple files to be selected. If they are then the files are opened in individual tabs.
Shift-selecting would select files from the first to the shift-clicked file. Clearly one wouldn't want to select 100 files resulting in 100 tabs, but this can be used to, e.g. compare 10 images.
Going along with the above, keyboard shortcuts have been added to move to the next or previous FITS Viewer tab, Also helpful to the above is a new command to zoom in/out all tabs (not just the current one).
There is a new Blink Directory menu command (in both menus, as above) which will open a single tab with a list of all the images below the directory selected (that is, both in that directory, and in directories below it). It initially displays the first image, but new commands work in that tab to switch to displaying the next (or previous) image file in the list. This could be used to blink hundreds of files.

Sky Flats
Dušan Poizl
added an option to capturing sky flats. When shooting flats at sky it often end up in never-ending loop of adjusting exposure because intensity of light change and calculation of exposure break down. Adjust the tolerance to 2000 ADU to higher for a better chance at capturing sky flats.
Scheduler Refactor
Wolfgang Reissenberger continues with his work on Separating Business Logic from UI in Scheduler. Over the years the Scheduler has grown to one of the most complex classes. With this release we refactored the Scheduler class and separated the UI from the underlying state model and its business logic. This opens the door for future development of new scheduling features and a much modular approach towards more flexible sequencing approaches.
Standalone Editor
To add any job to the scheduler, you need at minimum the following:
  1. Target
  2. Sequence File
The sequence file contains all your sequence settings (e.g. Capture 20x15 LRGB images). To create this file, you first need to add sequence job in the Capture module and then save the corresponding sequence. While this facilitates re-usability across different sessions, some users wanted to create sequence on-the-fly in the scheduler.



Hy Murveit developed the standalone sequence editor in the scheduler module where it relies on settings saved from your last astrophotography session. Now it's easier than ever to plan scheduler jobs without having Ekos or your equipment profile running!
   
Categories: FLOSS Project Planets

Size Policy for Qt Quick Controls

Planet KDE - Fri, 2024-04-05 06:57

When using Qt Quick Layouts, it is necessary for the user to specify the attached properties Layout.fillWidth or Layout.fillHeight to stretch a child component. This process can become cumbersome as more components require it. Inline components may serve as an alternative, but they may not be as effective when dealing with different component types. To tackle these challenges, the size policy feature has been introduced in Qt Quick Controls in version 6.7 (under tech preview), mirroring similar functionality found in widgets.

Categories: FLOSS Project Planets

Théodore 'nod_' Biadala: Drupal needs infrastructure innovation

Planet Drupal - Fri, 2024-04-05 06:30

Drupal is pretty expensive to host and maintain. There is already work well under way to address this with automatic updates and project browser. It’s great, and it’s not enough. What if we could ship drupal with a production-ready webserver that can handle real-time features? What if we could make HTTPS certificate management easier? What if we could significantly improve the performance of Drupal?

Exactly 2 years ago I started to talk about how can drupal scale down and in 2 years things have changed! Last week I attended the very interesting (and well organized) Drupalcamp Rennes 2024 where I saw Kévin Dunglas give a talk about FrankenPHP: The Modern PHP App Server, written in Go. Turns out the last two point on my “drupal scale down” have a solution: it can replace apache/php-fpm and be distributed as a single executable. I haven’t tested it yet, it’s possible to bundle server and application code to ship everything in one executable.

Drupal has always been about giving people more power than they expect (or even want in some cases…). On the content management side of things we’re very, very advanced, even if some interfaces and interactions can look and feel a bit dated. Defining content types, creating custom fields, workflows, content listing, layouts, decoupled, media library, and more we’ve been doing that for a long time, we have a very wide range of modules for practically any use case you can think of. And the vast majority of the modules work together without conflicts, and they’re all free.

What I would like to see is Drupal using FrankenPHP in the worker mode as the default way to put Drupal on production. This will make it possible to host Drupal more easily. Hook the included webserver to a startup/monitoring script (we’ll give examples) and you’re ready to serve the website. No need to install apache, nginx, or even PHP!

Now you can use the server to power your real-time features, without having to write or maintain a separate nodejs server, all in PHP. If we make sure Drupal can work in the worker mode, there won’t be a performance issue for this either. Without doing anything you’ll get a performance boost for all your users thanks to early hints, your CSS and JS will start loading before the HTML even arrives from the server. To get there we need a few steps:

  1. Create a configuration file suited to Drupal: #3437187: Add Caddyfile configuration
  2. Include FrankenPHP as a webserver option in DDEV: Feature request: FrankenPHP Support #5655
  3. Add a FrankenPHP runner to the gitlab testbots: #3438767: Support FrankenPHP as a webserver
  4. At this point if Drupal tests pass we’re ready to go, with a bonus step to increase performance.
  5. Bonus make Drupal work in the “worker mode”: #2218651: [meta] Make Drupal compatible with persistent app servers like ReactPHP, PHP-PM, PHPFastCGI, FrankenPHP, Swoole
  6. Implement early hints for CSS/JS assets in Drupal (issue to be open, proof of concept in the caddyfile issue)

Right now I need help making the DDEV integration work well with the recommended version of FrankenPHP, and making this available to the Drupal testbot. If you have a Drupal website using DDEV you can already try it out with ddev get theodoreb/ddev-frankenphp-drupal && ddev restart and it should mostly work (with some https problems for now). I would love to know what you think, leave a comment or let’s chat in #drupal slack.

If you’re interested in sponsoring me to work on this or other Drupal things, that would be great!

Categories: FLOSS Project Planets

Web Review, Week 2024-14

Planet KDE - Fri, 2024-04-05 05:22

Let’s go for my web review for the week 2024-14. I will be vacationing next week, so I might skip next week post. We’ll see.

German state moving 30,000 PCs to LibreOffice

Tags: tech, foss

Well done LibreOffice! I’d love to see many more announcements like this one.

https://blog.documentfoundation.org/blog/2024/04/04/german-state-moving-30000-pcs-to-libreoffice/


oss-security - backdoor in upstream xz/liblzma leading to ssh server compromise

Tags: tech, ssh, security, supply-chain

Good analysis of the backdoor recently discovered in xz. Really a bad situation. Luckily it was probably detected before it could do any real damage. What’s especially striking is the amount of patience it required, it’s really been put in place over a long stretch of time to reduce chances of detection.

https://www.openwall.com/lists/oss-security/2024/03/29/4


A Microcosm of the interactions in Open Source projects

Tags: tech, foss, community, security

Excellent post showing unhealthy consumer/maintainer dynamics in FOSS projects. This particular example was instrumental in getting the xz backdoor in place.

https://robmensching.com/blog/posts/2024/03/30/a-microcosm-of-the-interactions-in-open-source-projects/


Bullying in Open Source Software Is a Massive Security Vulnerability

Tags: tech, foss, security, burnout

You think the xz vulnerability was a one time event? Think again, this kind of bullying with ulterior motives happen regularly to critical projects.

https://www.404media.co/xz-backdoor-bullying-in-open-source-software-is-a-massive-security-vulnerability/


OSQI

Tags: tech, foss, sustainability, quality, security

Definitely a good idea, we’d need several such institutes across the world. Would governments be willing to try this?

https://www.tbray.org/ongoing/When/202x/2024/04/01/OSQI


Keeping your data from Apple is harder than expected | Aalto University

Tags: tech, apple, privacy

Can we let the myth of Apple being a proper steward with data privacy to rest please? I don’t know why people took their claims for granted to start… with so much opacity, it’s not a claim you could trust.

https://www.aalto.fi/en/news/keeping-your-data-from-apple-is-harder-than-expected


A ‘Law Firm’ of AI Generated Lawyers Is Sending Fake Threats as an SEO Scam

Tags: tech, ai, machine-learning, gpt, scam

AI supercharged scam. I guess we’ll see more of those.

https://www.404media.co/a-law-firm-of-ai-generated-lawyers-is-sending-fake-threats-as-an-seo-scam/


AI bots hallucinate software packages and devs download them • The Register

Tags: tech, ai, machine-learning, copilot, gpt, security, supply-chain

You should be mindful of the dependencies you add. Even more so when the name of the dependency has been proposed by a coding assistant.

https://www.theregister.com/2024/03/28/ai_bots_hallucinate_software_packages/


Towards 1-bit Machine Learning Models

Tags: tech, ai, machine-learning, power, energy

Smaller models with smarter architectures and low-bit quantized models are two venues for more efficient use. I’m really curious how far they’ll go. This article focuses on low-bit quantized models and the prospects are interesting.

https://mobiusml.github.io/1bit_blog/


LLaMA Now Goes Faster on CPUs

Tags: tech, ai, machine-learning, gpt, llama, optimization, performance, cpu

Excellent work to improve Llama execution speed on CPU. It probably has all the tricks of the trade to accelerate this compute kernel.

https://justine.lol/matmul/


Zoomer Tries RSS: In Praise of Yarr - tudor’s website

Tags: tech, rss, social-media

More people turning to RSS as a substitute for social media. There’s hope.

https://tudorr.ro/blog/zoomer-tries-rss/


KDE6 release: D-Bus and Polkit Galore | SUSE Security Team Blog

Tags: tech, processes, dbus, kde, security

Interesting article, shows quite well the complexities of D-Bus and Polkit. Unsurprisingly such complexity easily leads to mistakes which can compromise security. This then hints to interesting things to keep in mind when you have to deal with D-Bus and Polkit.

https://security.opensuse.org/2024/04/02/kde6-dbus-polkit.html


NTP Pool - The Internet Timekeeper | RIPE Labs

Tags: tech, ntp, dns, time

Fascinating article which explores the behavior of the NTP Pool. If you wondered how it gives you an NTP server to query, you’ll know the answer. It also covers the consequences of its restrictive approach. This even raises security concerns. Still even though it’s not perfect this keeps being an essential service mostly run by volunteers.

https://labs.ripe.net/author/giovane_moura/ntp-pool-the-internet-timekeeper/


Fast Development In Rust, Part One

Tags: tech, rust, performance, refactoring, type-systems, memory

Nice balanced view on some of Rust characteristics. This is much less naive than some of the “Rust is great” posts out there.

https://blog.sdf.com/p/fast-development-in-rust-part-one


On Garbage Collection

Tags: tech, memory, system

This is indeed a more interesting way to perceive garbage collection. This also lead to proper questions to explore on the topic.

https://xorvoid.com/on_garbage_collection.html


Optimizing SQLite for servers

Tags: tech, databases, sqlite, server, performance, complexity

With some tuning SQLite can go a long way, even for server type workloads. There are still a few caveats but in some case this can reduce complexity and cost quite a bit.

https://kerkour.com/sqlite-for-servers


Enforcing conventions in Django projects with introspection - lukeplant.me.uk

Tags: tech, craftsmanship, developer-experience, django, python

Another example of enforcing conventions using automated checks. This time using Python and Django tricks.

https://lukeplant.me.uk/blog/posts/enforcing-conventions-in-django-projects-with-introspection/


A proposal to add signals to JavaScript.

Tags: tech, javascript, web, frontend

A proposal for data bindings as first class citizens in JavaScript? This could be a good thing indeed.

https://github.com/proposal-signals/proposal-signals


Git as debugging tool - Lucas Seiki Oshiro

Tags: tech, git, version-control

Or why a clean commit history can help quite a lot to find how and why a bug was introduced. This shows a few nice tricks around git log to speed up the process.

https://lucasoshiro.github.io/posts-en/2023-02-13-git-debug/


Improvements to static analysis in the GCC 14 compiler | Red Hat Developer

Tags: tech, c, memory, static-analyzer, compiler

Improved static analysis for C straight from GCC. This is definitely welcome.

https://developers.redhat.com/articles/2024/04/03/improvements-static-analysis-gcc-14-compiler#


On Invariance and Inconsistency

Tags: tech, programming, safety, logic, mathematics

On the importance of invariants and consistent requirements in our trade. Admittedly it’s a long demonstration but it show the point well.

https://www.hansdieterhiep.nl/blog/on-invariance-and-inconsistency/


TDD’s Missing Skill: Behavioral Composition - by Kent Beck

Tags: tech, tests, tdd, design

This is indeed too often overlooked. Producing a test list and picking the tests in the right order is definitely a crucial skill to practice TDD. It goes hand in hand with software design skills.

https://tidyfirst.substack.com/p/tdds-missing-skill-behavioral-composition


Basic Things

Tags: tech, organization, community, craftsmanship

Lots of good advices of course. It goes a long way to improve the quality of the project and the ease to on-board people. This is quite some initial work though.

https://matklad.github.io/2024/03/22/basic-things.html


Programming Apprenticeships

Tags: tech, teaching, learning, pairing

Funny experiment. This shows what you can achieve in terms of teaching and learning during pair programming setups. Shadowing someone is a powerful approach.

https://two-wrongs.com/programming-apprenticeships.html


Mentorship, coaching, sponsorship: three different — and equally important — tools for developing talent - Jacob Kaplan-Moss

Tags: management, coaching, mentoring

This is a nice way to frame the three activities. They help people progress but in different ways.

https://jacobian.org/2024/apr/1/mentorship-coaching-sponsorship/


Ping Me, Please!

Tags: tech, remote-working, asynchronous, communication

When you’re distributed, this is all about asynchronous communication. You can’t walk to a person desk (and you should probably avoid it anyway if colocated).

https://www.yegor256.com/2024/04/01/ping-me-please.html


Bye for now!

Categories: FLOSS Project Planets

Embedding the Servo Web Engine in Qt

Planet KDE - Fri, 2024-04-05 04:00

With the Qt WebEngine module, Qt makes it possible to embed a webview component inside an otherwise native application. Under the hood, Qt WebEngine uses the Chromium browser engine, currently the de facto standard engine for such use cases.

While the task of writing a brand new standard-compliant browser engine is infamous as being almost unachievable nowadays (and certainly so with Chromium coming in at 31 million lines of code), the Rust ecosystem has been brewing up a new web rendering engine called Servo. Initially created by Mozilla in 2012, Servo is still being developed today, now under the stewardship of the Linux Foundation.

With the browser inherently being exposed to the internet, it is usually the biggest attack vector on a system. Naturally this makes Servo very attractive as an alternative browser engine, given that it is written in a memory-safe language.

A Servo WebView

At KDAB we managed to embed the Servo web engine inside Qt, by using our CXX-Qt library as a bridge between Rust and C++. This means that we can now use Servo as an alternative to Chromium for webviews in Qt applications.

From a QML perspective this component is similar to the Chromium WebView, such as providing canGoBack, canGoForward, loading, title, url properties and goBack, goForward methods. The QML item itself acts in the same way with the contents being rendered to match its size.

import QtQuick import QtQuick.Window import com.kdab.servo Window { height: 720 width: 1280 title: webView.title visible: true ServoWebView { id: webView anchors.fill: parent url: "https://servo.org/" } }

The screenshot below shows a basic QML application with a toolbar containing back, forward, go buttons and an address bar. We use CXX-Qt to define Qt properties, invokables, and event handlers (e.g. touch events) in Rust and trigger events in the Servo engine. Then any update requests from Servo can trigger an update of the Qt side via the Qt event loop.

As we move towards stabilising CXX-Qt at KDAB, investigating real world use cases, such as exposing Servo to Qt, allows us to identify potential missing functionality and explore what is possible when joining the Rust and Qt ecosystems together.

Technical details

Under the hood most of the heavy lifting is done by our CXX-Qt bindings, which already bridges the obvious gap between the Rust and Qt/C++ worlds. However, some further glue is needed to connect the rendering contexts of Servo to being able to render the surfaces into the actual Qt application. Internally, Servo uses surfman, a Rust library to manage rendering surfaces. At the time of writing, surfman supports OpenGL and Metal, with support for Vulkan being planned.

We use surfman to create a new OpenGL context, that Servo then uses for rendering. To render the result into the QtQuick scene, we borrow the surface from Servo, create a new framebuffer object and blit the framebuffer into a QQuickFrameBufferObject on the Qt side.

Future possibilities

Servo development is active again after a period of less activity, therefore the API is evolving and there is work to improve the API for embedders. This could result in a simpler and documented process for integrating Servo into apps. Also as part of the Tauri and Servo collaboration, a backend for WRY could become available. All of these result in many possible changes for the bridge to Qt, as currently this demo directly constructs Servo components (similar to servoshell) but could instead use a shared library or WRY instead.

On the Qt side, there are areas that could be improved or investigated further. For example, currently we are using a framebuffer object which forces use of the OpenGL backend, but with RHI, developers might want to use other backends. A way to solve this for QML would be to change the implementation to instead use a custom Qt Scene Graph node, which can then have implementations for Vulkan, OpenGL etc and read from the Servo engine.

Alternatively Qt 6.7 has introduced a new QQuickRhiItem element, which is currently a technical preview, but can be used as a rendering API-agnostic alternative to QQuickFrameBufferObject.

If this sounds interesting to your use case or you would like to collaborate with us, the code for this tech demo is available on GitHub under KDABLabs/cxx-qt-servo-webview or contact KDAB directly. We also have a Zulip chat if you want to discuss any parts of bridging Servo or CXX-Qt with us.

Come and see us at Embedded World 2024 where we will have the Servo demo and others on display!

 

The post Embedding the Servo Web Engine in Qt appeared first on KDAB.

Categories: FLOSS Project Planets

Don't Panic: A blog about Drupal: 12 funny Drupal modules

Planet Drupal - Fri, 2024-04-05 02:26

For those of you who usually read my blog, it's no news that I dabble with the content management system Drupal. This website is built on Drupal, as well as many of my other websites such as Alla Talar Svenska or the podcast platform Voffor Då Då. Drupal is more or less a Swiss Army knife when it comes to building different kinds of solutions, and behind it is an open-source community that ensures its development and maintenance.

A community that also has a sense of humor. Which is evident when there's a bunch of add-on modules that are more or less made for fun, or to have fun. Here's a dozen of such add-on modules and a brief explanation of what they do.

Pirate

International Talk Like a Pirate Day is a parody holiday created in 1995 by John Baur and Mark Summers. When the 19th of September, which is the special holiday International Talk Like a Pirate Day, arrives, the text on your website changes to pirate talk. A simple text filter in this module makes the magic happen - but only once a year.

Read more and find the module at https://www.drupal.org/project/pirate

Thanos

How's your Marvel knowledge? Do you remember the purple supervillain Thanos who had a mission to ensure the universe's survival - by simply removing 50% of all living beings? This module has the same mission. Kind of. It removes half of your uploaded files. Randomly. Every now and then. Really makes you feel alive, doesn't it?

Read more and find the module at https://www.drupal.org/project/thanos

Christmas lights

Colorful lights hanging from the top of your webpage? Absolutely! And you don't have to feel restricted to Christmas time when setting the dates for when the lights should be displayed - you can simply choose to have them shown from January 1st to December 31st. So you'll always have a bit of Christmas spirit on your website!

Read more and find the module at https://www.drupal.org/project/christmas_lights

Christmas snow

And while you're hanging up the Christmas lights - why not install this module to have a lovely snowfall on your website. "Man it doesn't show signs of stopping, and I brought me some corn for popping, the lights are turned way down low. Let it snow! Let it snow!"

Read more and find the module at https://www.drupal.org/project/christmas_snow

Nyan cat

Every now and then you do things in the Drupal interface that triggers a progress indicator to appear, so you can see, in a user-friendly way, that something is happening. That indicator isn't the sexiest in the world, needless to say. But now you can fix that. With this module, you'll see Nyan cat count up from 0 to 100%. And you'll get the song too! Not bad! Not bad at all!

Read more and find the module at https://www.drupal.org/project/nyan

Konami code

I grew up with a Nintendo 8-bit game console and through the game manufacturer Konami, the Konami code became part of popular culture. You know, you pressed UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A and you got more lives, or better weapons, or could become invisible, or something else that made the game a bit easier. This code has found its way into various places, and through this module, you can make different things happen on your website. Such as flipping the text on the page, randomly changing images, sending the visitor to a new web address - or why not have dinosaurs running around on the screen like in Jurassic Park?

Read more and find the module at https://www.drupal.org/project/konamicode

Fun modules for Drupal 7

In 2011, version 7 of Drupal was released and became a favorite among many web developers. That version became so big that its End of Life has been prolonged many times. You could almost say that Drupal 7 is Drupal's version of Windows XP. However, it should be noted that the later versions of Drupal are so much better, so those of you who are still on version 7 - upgrade! But before you do that, you can try out these fun modules, which only work in Drupal 7!

dRuPaul

The fashion model, actor, and drag queen Ru Paul is not entirely unknown, and if you feel like you want more Ru Paul, by activating this module, you can ensure that images are replaced with an animated GIF, provided that the fields for the image use Field API, which is highly likely that they do. Extra credit to the module's maintainer who has one of the funniest project descriptions I've seen on drupal.org.

Read more and test it out at https://www.drupal.org/project/drupaul

Malkovichification

Have you seen "Being John Malkovich"? Then you probably already understand what this module does to your website. It replaces every single word with Malkovich, and then it's Malkovich Malkovich Malkovich, Malkovich Malkovich. Malkovich Malkovich Malkovich Malkovich Malkovich, Malkovich Malkovich Malkovich; Malkovich Malkovich! Malkovich!!!

Read more and test it out at https://www.drupal.org/project/malkovichification

Little helper

Do you remember the Microsoft Office assistant Clippy? Of course you do. That little creature has eternal life through its annoying way of popping up and absolutely not helping in any constructive way! Now you can have the same functionality in Drupal ( 7)! Install, lean back, and look forward to getting annoyed!

Read more and test it out at https://www.drupal.org/project/little_helper

Beer o'clock

When is it time to crack open the beer? With the help of this module, you can easily have a webpage that simply tells you when it's "beer o'clock."

Read more and test it out at https://www.drupal.org/project/beer_o_clock

Lebowski

Another wonderful movie is "The Big Lebowski". This module sends out lovely quotes from the movie. A way to get a little encouraged when visiting your website!

Read more and test it out at https://www.drupal.org/project/lebowski

Cornify

Who doesn't like unicorns and rainbows? Answer: Nobody! This module uses the service cornify.com/ and with a simple click, you'll flood your website with unicorns, pink colors, rainbows, and all sorts of other fun stuff. Highly recommended!

Read more and test it out at https://www.drupal.org/project/cornify_block

Are there more?

Here you have a selection of fun modules for Drupal, both modern versions as well as for Drupal 7. I hope they can brighten up your and your visitors' day a bit. Have I missed your personal favorite? Write in the comments section, it's always fun to get new tips!

Categories: FLOSS Project Planets

Don't Panic: A blog about Drupal: ...

Planet Drupal - Fri, 2024-04-05 02:26

For those of you who usually read my blog, it's no news that I dabble with the content management system Drupal. This website is built on Drupal, as well as many of my other websites such as Alla Talar Svenska or the podcast platform Voffor Då Då. Drupal is more or less a Swiss Army knife when it comes to building different kinds of solutions, and behind it is an open-source community that ensures its development and maintenance.

A community that also has a sense of humor. Which is evident when there's a bunch of add-on modules that are more or less made for fun, or to have fun. Here's a dozen of such add-on modules and a brief explanation of what they do.

Pirate

International Talk Like a Pirate Day is a parody holiday created in 1995 by John Baur and Mark Summers. When the 19th of September, which is the special holiday International Talk Like a Pirate Day, arrives, the text on your website changes to pirate talk. A simple text filter in this module makes the magic happen - but only once a year.

Read more and find the module at https://www.drupal.org/project/pirate

Thanos

How's your Marvel knowledge? Do you remember the purple supervillain Thanos who had a mission to ensure the universe's survival - by simply removing 50% of all living beings? This module has the same mission. Kind of. It removes half of your uploaded files. Randomly. Every now and then. Really makes you feel alive, doesn't it?

Read more and find the module at https://www.drupal.org/project/thanos

Christmas lights

Colorful lights hanging from the top of your webpage? Absolutely! And you don't have to feel restricted to Christmas time when setting the dates for when the lights should be displayed - you can simply choose to have them shown from January 1st to December 31st. So you'll always have a bit of Christmas spirit on your website!

Read more and find the module at https://www.drupal.org/project/christmas_lights

Christmas snow

And while you're hanging up the Christmas lights - why not install this module to have a lovely snowfall on your website. "Man it doesn't show signs of stopping, and I brought me some corn for popping, the lights are turned way down low. Let it snow! Let it snow!"

Read more and find the module at https://www.drupal.org/project/christmas_snow

Nyan cat

Every now and then you do things in the Drupal interface that triggers a progress indicator to appear, so you can see, in a user-friendly way, that something is happening. That indicator isn't the sexiest in the world, needless to say. But now you can fix that. With this module, you'll see Nyan cat count up from 0 to 100%. And you'll get the song too! Not bad! Not bad at all!

Read more and find the module at https://www.drupal.org/project/nyan

Konami code

I grew up with a Nintendo 8-bit game console and through the game manufacturer Konami, the Konami code became part of popular culture. You know, you pressed UP UP DOWN DOWN LEFT RIGHT LEFT RIGHT B A and you got more lives, or better weapons, or could become invisible, or something else that made the game a bit easier. This code has found its way into various places, and through this module, you can make different things happen on your website. Such as flipping the text on the page, randomly changing images, sending the visitor to a new web address - or why not have dinosaurs running around on the screen like in Jurassic Park?

Read more and find the module at https://www.drupal.org/project/konamicode

Fun modules for Drupal 7

In 2011, version 7 of Drupal was released and became a favorite among many web developers. That version became so big that its End of Life has been prolonged many times. You could almost say that Drupal 7 is Drupal's version of Windows XP. However, it should be noted that the later versions of Drupal are so much better, so those of you who are still on version 7 - upgrade! But before you do that, you can try out these fun modules, which only work in Drupal 7!

dRuPaul

The fashion model, actor, and drag queen Ru Paul is not entirely unknown, and if you feel like you want more Ru Paul, by activating this module, you can ensure that images are replaced with an animated GIF, provided that the fields for the image use Field API, which is highly likely that they do. Extra credit to the module's maintainer who has one of the funniest project descriptions I've seen on drupal.org.

Read more and test it out at https://www.drupal.org/project/drupaul

Malkovichification

Have you seen "Being John Malkovich"? Then you probably already understand what this module does to your website. It replaces every single word with Malkovich, and then it's Malkovich Malkovich Malkovich, Malkovich Malkovich. Malkovich Malkovich Malkovich Malkovich Malkovich, Malkovich Malkovich Malkovich; Malkovich Malkovich! Malkovich!!!

Read more and test it out at https://www.drupal.org/project/malkovichification

Little helper

Do you remember the Microsoft Office assistant Clippy? Of course you do. That little creature has eternal life through its annoying way of popping up and absolutely not helping in any constructive way! Now you can have the same functionality in Drupal ( 7)! Install, lean back, and look forward to getting annoyed!

Read more and test it out at https://www.drupal.org/project/little_helper

Beer o'clock

When is it time to crack open the beer? With the help of this module, you can easily have a webpage that simply tells you when it's "beer o'clock."

Read more and test it out at https://www.drupal.org/project/beer_o_clock

Lebowski

Another wonderful movie is "The Big Lebowski". This module sends out lovely quotes from the movie. A way to get a little encouraged when visiting your website!

Read more and test it out at https://www.drupal.org/project/lebowski

Cornify

Who doesn't like unicorns and rainbows? Answer: Nobody! This module uses the service cornify.com/ and with a simple click, you'll flood your website with unicorns, pink colors, rainbows, and all sorts of other fun stuff. Highly recommended!

Read more and test it out at https://www.drupal.org/project/cornify_block

Are there more?

Here you have a selection of fun modules for Drupal, both modern versions as well as for Drupal 7. I hope they can brighten up your and your visitors' day a bit. Have I missed your personal favorite? Write in the comments section, it's always fun to get new tips!

Categories: FLOSS Project Planets

Salsa Digital: Ming Quah at DrupalSouth 2024

Planet Drupal - Fri, 2024-04-05 00:44
Ming Quah at DrupalSouth 2024 Ming’s DrupalSouth 2024 presentation was on Day 2 of the event. The session gave attendees an overview of the NIST domains and showed what Drupal developers and DevOps specialists should do to comply with the NIST CSF. The framework was analysed in the context of seven key layers for Drupal security. View the presentation description on DrupalSouth website
Categories: FLOSS Project Planets

Salsa Digital: Suchi Garg at DrupalSouth 2024

Planet Drupal - Fri, 2024-04-05 00:44
Suchi Garg at DrupalSouth 2024 Suchi’s workshop at DrupalSouth 2024 on Day 2 prepared first-time contributors for the code sprint. The session focused on the dynamics of mentored contribution and explored the benefits and types of contribution, tooling and documentation, and more. View the presentation description on the DrupalSouth website
Categories: FLOSS Project Planets

Salsa Digital: Gaurav Garg and Govind Kumar Malu at DrupalSouth 2024

Planet Drupal - Fri, 2024-04-05 00:44
Gaurav Garg and Govind Kumar Malu at DrupalSouth 2024 Gauravg and Govind’s session was on Day 2 of DrupalSouth 2024 and took attendees through Drupal testing using Cypress and automation. The session showcased practical examples that illustrate how Cypress commands interact with Drupal sites. Attendees learned strategies for executing tests, analysing results and maintaining synchronisation between evolving Drupal applications and the test suite.   View the presentation description on the DrupalSouth website
Categories: FLOSS Project Planets

Salsa Digital: Steve Worley and Joseph Zhao at DrupalSouth 2024

Planet Drupal - Fri, 2024-04-05 00:44
Steve Worley at DrupalSouth 2024 Steve’s second session at DrupalSouth 2024 (Day 2) was as a co-presenter with Joseph Zhao from GovCMS. They took attendees through how they test and ensure that government websites are strong, safe and easy to use. The presentation also covered practical testing methods and tools that will help government agencies deliver high-quality digital services. View the presentation description on the DrupalSouth website
Categories: FLOSS Project Planets

Salsa Digital: Amey Mudras and Govind Kumar Malu at DrupalSouth 2024

Planet Drupal - Fri, 2024-04-05 00:44
Amey Mudras and Govind Kumar Malu at DrupalSouth 2024 Amey and Govind’s session at DrupalSouth 2024 focused on simplifying the complex web of structures in Drupal and explored how consolidating components into a single directory can be a game-changer for projects. Attendees left the session armed with practical insights that can be immediately applied to enhance their Drupal projects. View the presentation description on the DrupalSouth website
Categories: FLOSS Project Planets

Pages