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

Delete (very) old tweets obtained from a twitter archive

Posted by jpluimers on 2023/10/24

[Wayback/Archive] Delete (very) old tweets obtained from a twitter archive comments:

# Largely copied from http://www.mathewinkson.com/2015/03/delete-old-tweets-selectively-using-python-and-tweepy
# However, Mathew's script cannot delete tweets older than something like a year (these tweets are not available from the twitter API)
# This script is a complement on first use, to delete old tweets. It uses your twitter archive to find tweets' ids to delete
# How to use it :
#     - download and extract your twitter archive (tweet.js will contain all your tweets with dates and ids)
#     - put this script in the extracted directory
#     - complete the secrets to access twitter's API on your behalf and, possibly, modify days_to_keep
#     - delete the few junk characters at the beginning of tweet.js, until the first '['   (it crashed my json parser)
#     - review the script !!!! It has not been thoroughly tested, it may have some unexpected behaviors...
#     - run this script
#     - forget this script, you can now use Mathew's script for your future deletions
#
#  License : Unlicense http://unlicense.org/

It is by [Wayback/Archive] Anil (@TheOtherAnil), who also wrote [Wayback/Archive] @captions_please (mentioned in my earlier post Two more Twitter bots that help with inclusion and accessibility (a11y): @get_altText and @captions_please), see:

[Wayback/Archive] Anil on Twitter: “@captions_please @jazzthefraz ah sorry the bot didn’t run earlier because of a bug. Should be fixed now.”

–jeroen

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

GitHub – kellyjonbrazil/jc: CLI tool and python library that converts the output of popular command-line tools and file-types to JSON or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.

Posted by jpluimers on 2023/10/17

I already knew about jq and jo (output: the echo for JSON), but not yet about jc for JSON.

Like jq is for querying (the sed for JSON), jc tries to be the universal parser of common command-line tools into JSON:

[Wayback/Archive] kellyjonbrazil/jc: CLI tool and python library that converts the output of popular command-line tools and file-types to JSON or Dictionaries. This allows piping of output to tools like jq and simplifying automation scripts.

Via [Wayback/ArchiveKris on Twitter: ““Jc” verwandelt den Output von üblichen Linux Kommandozeilen Tools in JSON. “Jc” kann auch als Import in Python Programmen verwendet werden und mit subprocess kombiniert werden. Danke, ⁦@janwalzer⁩ und ⁦@the_mutax⁩ für den Tip. “

A few weeks later though, Kris discovered that command-line tools aren’t that portable in their output format: [Wayback/Archive] Kris on Twitter: “As much as I love the idea of @kellyjonbrazil’s jc, this is not a winnable game. sigh Probably still better than a self-cooked parser, but the slightest bit of extra makes it catch fire in multiple possible ways …”

Read the rest of this entry »

Posted in *nix, *nix-tools, bash, bash, Development, JavaScript/ECMAScript, jo, jq, JSON, man/manual pages, mankier, Power User, Python, Scripting, Software Development | Leave a Comment »

Burninator Sec: Twitter Removed the Blocked Account Export – Let’s Put it Back!

Posted by jpluimers on 2023/08/18

Hoping I can still use the Twitter API to perform thousands of requests: [Wayback/Archive] Burninator Sec: Twitter Removed the Blocked Account Export – Let’s Put it Back!

I dug around in the Data Archive and eventually found block.js, which is a JSON object of all the blocked accounts in their ideas. From there you can write a quick Python script to use the Twitter API to resolve all of those IDs to usernames.

Related: [Wayback/Archive] How to download your Twitter archive and Tweets | Twitter Help.

Via [Wayback/Archive] twitter export blocklist – Google Search and

Read the rest of this entry »

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

Looking for maintainer(s) for fritzcap (Python project that captures calls from a Fritz!Box)

Posted by jpluimers on 2023/07/12

Given my health uncertainty, I am looking for maintainers for the fritzcap project (it captures calls from a Fritz!Box modem/router and is written in Python).

History

The fritzcap project was originally started in2007 by [Wayback/Archive] spongebob | IP Phone Forum, first as a binary fritzcap.exe Windows executable (see his first post at [Wayback/Archive] FritzBox: Tool für Etherreal Trace und Audiodaten-Extraktion | IP Phone Forum). In 2010 it became an open source Python project at [Wayback/Archive] Google Code Archive – Long-term storage for Google Code Project Hosting.

Read the rest of this entry »

Posted in About, Audio, Cloud, Communications Development, Containers, Development, Docker, ffmpeg, Fritz!, Fritz!Box, fritzcap, Hardware, HTTP, Infrastructure, Internet protocol suite, Media, Network-and-equipment, Personal, Power User, Python, Scripting, Software Development, TCP | Leave a Comment »

doegox/EMV-CAP: This tool emulates an EMV-CAP device, to illustrate the article “Banque en ligne : à la decouverte d’EMV-CAP” published in MISC, issue #56

Posted by jpluimers on 2023/06/21

For my link archive: [Wayback/Archive] doegox/EMV-CAP: This tool emulates an EMV-CAP device, to illustrate the article “Banque en ligne : à la decouverte d’EMV-CAP” published in MISC, issue #56.

Via: [Archive] Philippe Teuwen on Twitter: “Our 10 years old EMV-CAP emulator is now republished on Github under GPL3+, use it responsibly! …” / Twitter

Related:

–jeroen

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

Don’t stick at version 3.7: How to Update Your Python Version Without Risk

Posted by jpluimers on 2023/02/22

For anyone else that things they are still stuck at Python 3.7 or older: [Wayback/Archive] How to Update Your Python Version Without Risk

Via [Wayback/Archive] CircuitSwan on Twitter: “#Python codebases are rarely updated due to time constraints, complexity & fear of breaking the build. Learn best practices to overcome this issue and reduce security risks! #100daysofcode”.

–jeroen

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

Google Cloud Shell: tools, languages and “safe mode”

Posted by jpluimers on 2023/01/19

After publishing Free Linux cloud shell for Gmail users – shell in the browser that works in all locations I’ve been so far, the Google Cloud Shell got extended quite a bit.

There is now [Wayback/Archive] Safe Mode (which skips initialisation scripts):

If there’s a problem in your .bashrc or .tmux.conf files, Cloud Shell immediately close after connection. To resolve this, open Cloud Shell in safe mode by appending cloudshellsafemode=true to the URL. This restarts your Cloud Shell instance and logs you in as root, allowing you to fix any issues in the files.

To permanently delete all files in your home directory and restore your Cloud Shell home directory to a clean state, you can reset your Cloud Shell VM.

And there is support for way more [Wayback/Archive] tools and languages:

Read the rest of this entry »

Posted in .NET, C#, Cloud, Development, Go (golang), Google, GoogleCloudShell, Infrastructure, Java, Java Platform, JavaScript/ECMAScript, Node.js, Perl, PHP, Power User, Python, Ruby, Scripting, Software Development | Leave a Comment »

Kevlin Henney on Twitter: “#FizzBuzzFriday… ” Python table lookup versus C# functional programming

Posted by jpluimers on 2022/12/27

[Archive.is] Kevlin Henney on Twitter: “#FizzBuzzFriday… “.

Related: [Wayback] Your C# is already functional, but only if you let it | In Absentia:

A few days ago I tweeted a C# code snippet, showing a FizzBuzz implementation using some of the new features in C# 8.0. The tweet “went viral”, as the kids say, with several people admiring the terse

–jeroen

Read the rest of this entry »

Posted in .NET, C#, Development, Functional Programming, Python, Software Development | Leave a Comment »

SimenHolmestad/Privacynator: A utility for removing Personally Identifiable Information (PII) from videos.

Posted by jpluimers on 2022/12/21

[Archive] SimenHolmestad/Privacynator: A utility for removing Personally Identifiable Information (PII) from videos.

Privacynator is an utility for removing Personally Identifiable Information (PII) from videos. It is primarily meant for videos captured from cars.
Privacynator uses the Detectron2 model from facebook research: https://github.com/facebookresearch/detectron2.

It is written in Python 3.

It is unlike this: Need to check if “PrivacyNator” is already out: a local TensorFlowJS app that blurs your screen when you are not behind it

–jeroen

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

Kristian Köhntopp on Twitter: “Basically, show me a Python regex with \d and without ASCII flag, and I can show you a bug, often exploitable.… “

Posted by jpluimers on 2022/12/14

An interesting thought: [Archive] Kristian Köhntopp on Twitter: “Basically, show me a Python regex with \d and without ASCII flag, and I can show you a bug, often exploitable.… “

Basically, input parsing is still very much underrated by most systems and a constant source of peculiarities and therefore bugs, or phrased differently: [Archive] Kristian Köhntopp on Twitter: “In many cases an uncaught exception, and hence a component crash.… “

Kris also states [Archive] Kristian Köhntopp on Twitter: “Again, Python is not alone in this. Perl, when “use utf8;” is active (which it should) also does this, so every single fucking Regex needs a ‘/a‘ at the end. Nobody ever asked \d to match tengwar or klingon numeric symbols.… “.

The point is in the last few words as Arabic numerals are so white spread over the world that the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8 , 9 they represent should be the de facto \d pattern, but aren’t in Python as per [Wayback/Archive] re — Regular expression operations — Python 3.10.0 documentation: /d (emphasis mine):

Read the rest of this entry »

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