The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Archive for the ‘Python’ Category

unix – How come is this command returning “GET A LIFE!”? – Stack Overflow

Posted by jpluimers on 2025/06/11

Didn’t know nx had a scriptable RPN command-line calculator dc (for Desk Calculator) which does not seem to need white space characters in the input stream or input file.

It likely is a source for command-injection attacks given the question [Wayback/Archive] unix – How come is this command returning “GET A LIFE!”? – Stack Overflow, so I did a bit of digging and found this great platform:

Read the rest of this entry »

Posted in *nix, *nix-tools, Development, Power User, PowerShell, Python, Scripting, Software Development | Leave a Comment »

What is the Python 3 equivalent of “python -m SimpleHTTPServer” – Stack Overflow

Posted by jpluimers on 2025/05/29

Now that Python 2 has been dead for long enough (has it been unsupported for 5 years? yes it has: [Wayback/Archive] Status of Python Versions), it was finally time to change my alias for running a local web-server to serve files from a directory (:

So, from [Wayback/Archive] What is the Python 3 equivalent of “python -m SimpleHTTPServer” – Stack Overflow (thanks [Wayback/Archive] ryanbraganza, [Wayback/Archive] k.avinash and [Wayback/Archive] Petr Viktorin):

python -m http.server 8000, it will start the server on port 8000

Docs with the migration hints: [Wayback/Archive] 20.19. SimpleHTTPServer — Simple HTTP request handler — Python 2.7.18 documentation

Read the rest of this entry »

Posted in *nix, *nix-tools, bash, Batch-Files, Development, Power User, Python, Scripting, Software Development | Leave a Comment »

GitHub – randomaccess3/googleURLParser: parser for Google search strings

Posted by jpluimers on 2025/05/01

Back when I observed the Google Search sei parameter which I hadn’t seen before yet, I bumped into [Wayback/Archive] GitHub – randomaccess3/googleURLParser: parser for Google search strings

It covers a truckload of parameters, including the sei one, which isn’t as new as I thought, as it was at least 2017 old: [Wayback/Archive] [Neat URL] Yet another Google parameter… · Issue #25 · Smile4ever/firefoxaddons · GitHub

Links referred from the parser tool for further reading:

Read the rest of this entry »

Posted in Development, Google, GoogleImageSearch, GoogleSearch, Perl, Power User, Python, Scripting, Software Development | Tagged: | Leave a Comment »

Ungendered writing – #awareness

Posted by jpluimers on 2025/03/14

Maybe the outcome of this research study is even more reason to promote awareness around ungendered writing.

In this world at large, inclusivity should be the norm and showing that in your writing should increase funding rates for science articles.

[Wayback/Archive] Ungendered writing: Writing styles are unlikely to account for gender differences in funding rates in the natural and technical sciences – ScienceDirect.

Read the rest of this entry »

Posted in Awareness, Development, Inclusion / inclusive society, Perl, Python, Scripting, Software Development | Leave a Comment »

Weather info in plain text or JSON

Posted by jpluimers on 2025/03/06

Two sites that can help you out getting weather info on the console:

wttr.in

wttr.in is developed by [Wayback/Archive] Igor Chubin (@igor_chubin) / X and looks at the request header to figure out what kind of output it sends.

It supports various output formats, so on my TODO list is to see how they do their mapping: always an opportunity to learn (it’s based on Python and Go so I am curious what libraries they use as well).

From the documentation:

wttr.in currently supports five output formats:

  • ANSI for the terminal;
  • Plain-text for the terminal and scripts;
  • HTML for the browser;
  • PNG for the graphical viewers;
  • JSON for scripts and APIs;
  • Prometheus metrics for scripts and APIs.

The ANSI and HTML formats are selected based on the User-Agent string.

There are more parameters in the documentation on the main page of the repository and through this command:

curl wttr.in/:help

The idea is derived from [Wayback/Archive] GitHub – schachmat/wego: weather app for the terminal.

Oh: Igor has more repositories at [Wayback/Archive] chubin (Igor Chubin) · GitHub (including [Wayback/Archive] GitHub – chubin/cheat.sh: the only cheat sheet you need which is hosted at [Wayback/Archive] cheat.sh; I thought I had blogged about that before, but found it only in a draft note mentioning that I got it via [WaybackSave/Archive] Nicolas Krassas on X: “The only cheat sheet you need cheat.sh)

7timer

A 7 timer JSON usage example is at [Wayback/Archive] Get Weather from 7Timer! · GitHub

It has documentation at

Output formats can be chosen from HTML, PNG, XML and JSON.

Via

[Wayback/Archive] Hacker Public Radio – hpr4266 :: What’s the weather?
Lee writes a script to check what the weather is like ~ The Technology Community Podcast

HPR is a great podcast series!

--jeroen

Posted in *nix, *nix-tools, ash/dash, bash, bash, Development, Go (golang), JavaScript/ECMAScript, JSON, Power User, Python, Scripting, Software Development, Web Development, XML/XSD | Leave a Comment »

Some interesting tweets by @isotopp and others on home power measurement and what to do to optimise energy usage at home

Posted by jpluimers on 2025/02/26

For my link archive (browse back and forth in the tweets: lots of useful tips):

[Wayback/Archive] Kris on Twitter: “@mausdompteur @HildebrandtRalf … Tasmota Support P1-mqtt in Python, für den oa Zuidwijk Slimme Lezer Diese Lösung setze ich ein.”

A few of his power usage pictures:

Read the rest of this entry »

Posted in Development, Hardware, IoT Internet of Things, LifeHacker, Network-and-equipment, Power User, Python, Scripting, Software Development | Leave a Comment »

How to send raw network packets in Python with tun/tap

Posted by jpluimers on 2025/02/20

For my link archive: [Wayback/Archive] How to send raw network packets in Python with tun/tap

I never really played around with tun and tap, so this is a nice opportunity to do so. I know they were the base for VPN on Linux, but just now I learned TUN/TAP are not available on nx, but also on Windows. Cool!

Via [Wayback/Archive] 🔎Julia Evans🔍 on Twitter: “how to send raw network packets in Python with tun/tap …”

--jeroen

Posted in *nix, *nix-tools, Development, Ethernet, Hardware, Linux, Network-and-equipment, Power User, Python, Scripting, Software Development | Leave a Comment »

Stable Diffusion – a Hugging Face Space by stabilityai

Posted by jpluimers on 2025/02/06

I’m anxious to see how some 2.5 years after the introduction, Stable Diffusion has evolved.

By then, you could run it either on-line at for instance [Wayback/Archive] Stable Diffusion – a Hugging Face Space by stabilityai:

Stable Diffusion DemoStable Diffusion is a state of the art text-to-image model that generates images from text.

or run it yourself if your GPU was powerful enough by using the base repository [Wayback/Archive] CompVis/stable-diffusion or one of the many forks: [Wayback/Archive] Forks · CompVis/stable-diffusion (back then some 1.4k!)

The original announcement was [Wayback/Archive] Stable Diffusion Public Release — Stability.Ai.

Read the rest of this entry »

Posted in AI and ML; Artificial Intelligence & Machine Learning, Development, Python, Scripting, Software Development | Tagged: | Leave a Comment »

Bridgy Fed – bridges to/from BlueSky, Fediverse (including Mastodon) and many web-sites

Posted by jpluimers on 2025/01/29

I bumped into [Wayback/Archive] Bridgy Fed a while ago. The highlights:

Source is written in Python and HTML. It is available from [Wayback/Archive] GitHub – snarfed/bridgy-fed: 🌉 A bridge between decentralized social network protocols.

The blog post re-introducing it: [Wayback/Archive] Re-introducing Bridgy Fed | snarfed.org.

There is docs too: [Wayback/Archive] Bridgy Fed: docs

Bridgy Fed is a kind of a spin-off from the longer existing [Wayback/Archive] Bridgy which has documentation at [Wayback/Archive] About – Bridgy and source code at [Wayback/Archive] GitHub – snarfed/bridgy: 📣 Connects your web site to social media. Likes, retweets, mentions, cross-posting, and more….

Via [Wayback/Archive] Ionica Smeets (@ionica.mathstodon.xyz.ap.brid.gy) — Bluesky who’s primary social media presence is at [Wayback/Archive] Ionica Smeets (@ionica@mathstodon.xyz) – Mathstodon.

I created my [Wayback/Archive] wiert.me profile – Bridgy Fed which resulted in these two entities (that by the time you read this should have some updates):

--jeroen

Posted in Blogging, BlueSky, Development, Fediverse, HTML, Mastodon, Python, Scripting, SocialMedia, Software Development, Web Development | Leave a Comment »

python – What is a virtualenv, and why should I use one? – Stack Overflow

Posted by jpluimers on 2025/01/29

I knew that venv is always needed inside your project directory when using Python, and roughly why, but not exactly why, so the points in the below StackOverflow Q/A sequence and underlying article are important to save in my link archive.

[Wayback/Archive] python – What is a virtualenv, and why should I use one? – Stack Overflow (thanks [Wayback/Archive] Kevin and [Wayback/Archive] Thanh Nguyen).

Read the rest of this entry »

Posted in Development, Python, Scripting, Software Development | Leave a Comment »